@mantajs/dashboard 0.1.0

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 (2067) hide show
  1. package/dist/Inter-Medium-RUQTUVA3.ttf +0 -0
  2. package/dist/Inter-Regular-CKBOXRQ3.ttf +0 -0
  3. package/dist/RobotoMono-Medium-LUNBMOOH.ttf +0 -0
  4. package/dist/RobotoMono-Regular-27MA6W2G.ttf +0 -0
  5. package/dist/add-campaign-promotions-OYPGISTF.mjs +263 -0
  6. package/dist/add-locales-F4BOSZNU.mjs +82 -0
  7. package/dist/adjust-inventory-O6XSKODS.mjs +217 -0
  8. package/dist/api-key-management-create-PHBRTKUI.mjs +176 -0
  9. package/dist/api-key-management-detail-SZR6LLZY.mjs +493 -0
  10. package/dist/api-key-management-edit-KYBWESGG.mjs +110 -0
  11. package/dist/api-key-management-list-2T35G3KT.mjs +356 -0
  12. package/dist/api-key-management-sales-channels-WZAGFYC5.mjs +206 -0
  13. package/dist/app.css +5327 -0
  14. package/dist/app.js +195982 -0
  15. package/dist/app.mjs +81 -0
  16. package/dist/campaign-budget-edit-B5MSE26J.mjs +147 -0
  17. package/dist/campaign-configuration-QOE3D2BE.mjs +154 -0
  18. package/dist/campaign-create-FJOECKGT.mjs +31 -0
  19. package/dist/campaign-detail-2SHJIBIS.mjs +677 -0
  20. package/dist/campaign-edit-K2POQH7M.mjs +206 -0
  21. package/dist/campaign-list-PEOTTWBA.mjs +192 -0
  22. package/dist/categories-metadata-4OV6MKAD.mjs +74 -0
  23. package/dist/category-create-G2JK5KDF.mjs +423 -0
  24. package/dist/category-detail-2TPOPANL.mjs +579 -0
  25. package/dist/category-edit-4V4SHFZL.mjs +224 -0
  26. package/dist/category-list-WHGMREI2.mjs +309 -0
  27. package/dist/category-organize-B4I6TDK4.mjs +113 -0
  28. package/dist/category-products-LKS7U7MI.mjs +284 -0
  29. package/dist/chunk-27MGH3HR.mjs +259 -0
  30. package/dist/chunk-2SSUH2HJ.mjs +43 -0
  31. package/dist/chunk-2WYSM6OA.mjs +340 -0
  32. package/dist/chunk-3BF5SC66.mjs +127 -0
  33. package/dist/chunk-3C6WQ7NH.mjs +46 -0
  34. package/dist/chunk-3ISBJK7K.mjs +45 -0
  35. package/dist/chunk-3TPUO6MD.mjs +471 -0
  36. package/dist/chunk-3TZOFKX2.mjs +110 -0
  37. package/dist/chunk-3XBFXGEA.mjs +310 -0
  38. package/dist/chunk-43TDMTAG.mjs +431 -0
  39. package/dist/chunk-4EGKSECC.mjs +49 -0
  40. package/dist/chunk-4FM6S5CX.mjs +17 -0
  41. package/dist/chunk-4GQOUCX6.mjs +0 -0
  42. package/dist/chunk-4GQYRG3L.mjs +401 -0
  43. package/dist/chunk-4XSXVVYD.mjs +18 -0
  44. package/dist/chunk-535OVBXR.mjs +226 -0
  45. package/dist/chunk-54IEHX46.mjs +116 -0
  46. package/dist/chunk-5AFMB7XQ.mjs +260 -0
  47. package/dist/chunk-5BQQRHQS.mjs +79 -0
  48. package/dist/chunk-5FMYPGTX.mjs +149 -0
  49. package/dist/chunk-5ISRTMYH.mjs +175 -0
  50. package/dist/chunk-5LGRZSEH.mjs +360 -0
  51. package/dist/chunk-67DYV3AY.mjs +123 -0
  52. package/dist/chunk-6CLQKVAU.mjs +79 -0
  53. package/dist/chunk-6F74MBBU.mjs +98 -0
  54. package/dist/chunk-6GU6IDUA.mjs +8 -0
  55. package/dist/chunk-6HTZNHPT.mjs +34 -0
  56. package/dist/chunk-6OU4CHZI.mjs +61 -0
  57. package/dist/chunk-6WKBBTKM.mjs +29 -0
  58. package/dist/chunk-6X2UTJF3.mjs +101 -0
  59. package/dist/chunk-73OGFYCU.mjs +280 -0
  60. package/dist/chunk-774WSTCC.mjs +19 -0
  61. package/dist/chunk-7AXHHXCX.mjs +4 -0
  62. package/dist/chunk-7OYLCEKK.mjs +24 -0
  63. package/dist/chunk-A63RZVX6.mjs +225 -0
  64. package/dist/chunk-ADOCJB6L.mjs +35 -0
  65. package/dist/chunk-AM2BU2RH.mjs +6 -0
  66. package/dist/chunk-AMRS4CSX.mjs +9 -0
  67. package/dist/chunk-APGDAT7X.mjs +171 -0
  68. package/dist/chunk-B6ZOPCPA.mjs +73 -0
  69. package/dist/chunk-BMJ5RYIO.mjs +39 -0
  70. package/dist/chunk-BTYBTKWK.mjs +61 -0
  71. package/dist/chunk-BW322BVH.mjs +52 -0
  72. package/dist/chunk-BW4QA6B6.mjs +49 -0
  73. package/dist/chunk-BYOPZAGX.mjs +124 -0
  74. package/dist/chunk-BZKI5J2M.mjs +128 -0
  75. package/dist/chunk-C32SLRTC.mjs +117 -0
  76. package/dist/chunk-C5P5PL3E.mjs +31 -0
  77. package/dist/chunk-C76H5USB.mjs +16 -0
  78. package/dist/chunk-C7F7MMXS.mjs +68 -0
  79. package/dist/chunk-CBSCX7RE.mjs +13 -0
  80. package/dist/chunk-CBYAN3G4.mjs +94 -0
  81. package/dist/chunk-CDORR33H.mjs +162 -0
  82. package/dist/chunk-CN7JXSGW.mjs +83 -0
  83. package/dist/chunk-CQOOXWPZ.mjs +175 -0
  84. package/dist/chunk-D3YQN7HV.mjs +30 -0
  85. package/dist/chunk-D6UW7URG.mjs +275 -0
  86. package/dist/chunk-DFFLVEZ5.mjs +40 -0
  87. package/dist/chunk-DG7J63J2.mjs +1764 -0
  88. package/dist/chunk-DK4WIVY6.mjs +749 -0
  89. package/dist/chunk-DLZWPHHO.mjs +20 -0
  90. package/dist/chunk-DODQ3KJT.mjs +345 -0
  91. package/dist/chunk-DQUXK4WW.mjs +170 -0
  92. package/dist/chunk-DTZXEQXZ.mjs +516 -0
  93. package/dist/chunk-DYDGGABK.mjs +87 -0
  94. package/dist/chunk-EHAU7SOS.mjs +1280 -0
  95. package/dist/chunk-EMIHDNB7.mjs +64 -0
  96. package/dist/chunk-EVKJNVKW.mjs +610 -0
  97. package/dist/chunk-F6ZOHZVB.mjs +9 -0
  98. package/dist/chunk-FA2DYBNX.mjs +6 -0
  99. package/dist/chunk-FAB3VINY.mjs +126 -0
  100. package/dist/chunk-FBYTX6K7.mjs +1144 -0
  101. package/dist/chunk-FHSC5X62.mjs +31 -0
  102. package/dist/chunk-FKNW5MLZ.mjs +4112 -0
  103. package/dist/chunk-FWRPGWPC.mjs +128 -0
  104. package/dist/chunk-FXYH54JP.mjs +16 -0
  105. package/dist/chunk-G22WWLPG.mjs +44 -0
  106. package/dist/chunk-G2J2T2QU.mjs +85 -0
  107. package/dist/chunk-G4BWCU5P.mjs +51 -0
  108. package/dist/chunk-GIZFNLKK.mjs +382 -0
  109. package/dist/chunk-H65COXEW.mjs +422 -0
  110. package/dist/chunk-HBXV7ENS.mjs +92 -0
  111. package/dist/chunk-HI6URQ7H.mjs +83 -0
  112. package/dist/chunk-HP2JH45P.mjs +89 -0
  113. package/dist/chunk-HQKGZADC.mjs +132 -0
  114. package/dist/chunk-HWHFHWIB.mjs +98060 -0
  115. package/dist/chunk-I3VB6NM2.mjs +45 -0
  116. package/dist/chunk-I4OBEAOJ.mjs +58 -0
  117. package/dist/chunk-INE2QCSC.mjs +39 -0
  118. package/dist/chunk-IQBAUTU5.mjs +22 -0
  119. package/dist/chunk-IR5DHEKS.mjs +9 -0
  120. package/dist/chunk-IUCDCPJU.mjs +0 -0
  121. package/dist/chunk-IW4TACOD.mjs +55 -0
  122. package/dist/chunk-JHATTPS3.mjs +6 -0
  123. package/dist/chunk-JIWT5652.mjs +41 -0
  124. package/dist/chunk-JUZ754L2.mjs +66 -0
  125. package/dist/chunk-KCWP7RF5.mjs +822 -0
  126. package/dist/chunk-KEQOAJC2.mjs +108 -0
  127. package/dist/chunk-KFYQTOGB.mjs +164 -0
  128. package/dist/chunk-KI7TOXBR.mjs +35 -0
  129. package/dist/chunk-KIIT4BNH.mjs +32 -0
  130. package/dist/chunk-KSDXSKJ7.mjs +1106 -0
  131. package/dist/chunk-LFLGEXIG.mjs +34 -0
  132. package/dist/chunk-LGNTHZ5Y.mjs +23 -0
  133. package/dist/chunk-LPEUYMRK.mjs +183 -0
  134. package/dist/chunk-LQTHYS2Z.mjs +0 -0
  135. package/dist/chunk-LSEYENCI.mjs +14 -0
  136. package/dist/chunk-LT4MVCA7.mjs +19 -0
  137. package/dist/chunk-MFALVTRQ.mjs +181 -0
  138. package/dist/chunk-MLNUGLGT.mjs +79 -0
  139. package/dist/chunk-MNXC6Q4F.mjs +30 -0
  140. package/dist/chunk-MOSRJHJ3.mjs +31 -0
  141. package/dist/chunk-MSDRGCRR.mjs +42 -0
  142. package/dist/chunk-N3SAXQVR.mjs +391 -0
  143. package/dist/chunk-NEZX6265.mjs +50 -0
  144. package/dist/chunk-NFEK63OE.mjs +20 -0
  145. package/dist/chunk-NOAFLTPV.mjs +99 -0
  146. package/dist/chunk-NTEWUH4C.mjs +65 -0
  147. package/dist/chunk-O333RR6K.mjs +116 -0
  148. package/dist/chunk-O7JNIATG.mjs +97 -0
  149. package/dist/chunk-OBQI23QM.mjs +161 -0
  150. package/dist/chunk-OC7BQLYI.mjs +17 -0
  151. package/dist/chunk-OFN7DIZA.mjs +363 -0
  152. package/dist/chunk-OMC5JCQH.mjs +31 -0
  153. package/dist/chunk-ONB3JEHR.mjs +9 -0
  154. package/dist/chunk-OXPE5TAY.mjs +495 -0
  155. package/dist/chunk-OZPB6JBL.mjs +86 -0
  156. package/dist/chunk-P3DRE4IY.mjs +39 -0
  157. package/dist/chunk-P3UUX2T6.mjs +9 -0
  158. package/dist/chunk-PA3T6IWL.mjs +122 -0
  159. package/dist/chunk-PCV2O6DU.mjs +42 -0
  160. package/dist/chunk-PMA2D6IL.mjs +49 -0
  161. package/dist/chunk-PRLQLEEQ.mjs +50 -0
  162. package/dist/chunk-PT47ROAO.mjs +556 -0
  163. package/dist/chunk-PUS5XMLP.mjs +522 -0
  164. package/dist/chunk-PXZ7QYKX.mjs +14 -0
  165. package/dist/chunk-PYIO3TDQ.mjs +18 -0
  166. package/dist/chunk-QBIQEVTU.mjs +78 -0
  167. package/dist/chunk-QISH26J3.mjs +56 -0
  168. package/dist/chunk-QJ6SBVJ2.mjs +17 -0
  169. package/dist/chunk-QMRGIWOP.mjs +88 -0
  170. package/dist/chunk-QOCJPBRB.mjs +41 -0
  171. package/dist/chunk-QZ7TP4HQ.mjs +7 -0
  172. package/dist/chunk-R3FD2XEU.mjs +108 -0
  173. package/dist/chunk-R4ZOO4ON.mjs +98 -0
  174. package/dist/chunk-R65S6ZZV.mjs +70 -0
  175. package/dist/chunk-RIV7FKGN.mjs +31 -0
  176. package/dist/chunk-RNV5E7NV.mjs +157 -0
  177. package/dist/chunk-RPAL6FHW.mjs +73 -0
  178. package/dist/chunk-RYJ2UVJE.mjs +87 -0
  179. package/dist/chunk-S22SJRPO.mjs +265 -0
  180. package/dist/chunk-S4DMV3ZT.mjs +35 -0
  181. package/dist/chunk-SC6BSTC7.mjs +38 -0
  182. package/dist/chunk-SQDIZZDW.mjs +29 -0
  183. package/dist/chunk-SR45O6K3.mjs +47 -0
  184. package/dist/chunk-TDK3JDOB.mjs +31 -0
  185. package/dist/chunk-TOCMU7UV.mjs +221 -0
  186. package/dist/chunk-U726TGCM.mjs +36 -0
  187. package/dist/chunk-UC26CCHZ.mjs +45 -0
  188. package/dist/chunk-VCSSQVPD.mjs +63 -0
  189. package/dist/chunk-VT2JJ5C2.mjs +37 -0
  190. package/dist/chunk-W7625H47.mjs +18 -0
  191. package/dist/chunk-WATKBUHQ.mjs +12 -0
  192. package/dist/chunk-WAXMT4IY.mjs +108 -0
  193. package/dist/chunk-WG7UTTKY.mjs +44 -0
  194. package/dist/chunk-WKOPGFW5.mjs +8 -0
  195. package/dist/chunk-WMOGMKQN.mjs +0 -0
  196. package/dist/chunk-WRSGHGAT.mjs +41 -0
  197. package/dist/chunk-WVA4O7QS.mjs +182 -0
  198. package/dist/chunk-X5VECN6S.mjs +84 -0
  199. package/dist/chunk-X6BAAGCL.mjs +48 -0
  200. package/dist/chunk-XDCNT5GQ.mjs +792 -0
  201. package/dist/chunk-XDJ7OMBR.mjs +160 -0
  202. package/dist/chunk-XGSMYYUJ.mjs +47 -0
  203. package/dist/chunk-XLDQPLK4.mjs +97 -0
  204. package/dist/chunk-XNIVMZHA.mjs +50 -0
  205. package/dist/chunk-XR4GEMGR.mjs +31 -0
  206. package/dist/chunk-XRTVFYCW.mjs +0 -0
  207. package/dist/chunk-XUQVQCAO.mjs +16 -0
  208. package/dist/chunk-XWO5BP42.mjs +37 -0
  209. package/dist/chunk-YCDDT44O.mjs +117 -0
  210. package/dist/chunk-YFIYCS7F.mjs +106 -0
  211. package/dist/chunk-YIOBBZUB.mjs +302 -0
  212. package/dist/chunk-YOSHYW6O.mjs +174 -0
  213. package/dist/chunk-YOYOJU5D.mjs +0 -0
  214. package/dist/chunk-YPDX5USE.mjs +193 -0
  215. package/dist/chunk-ZCARHA6C.mjs +144 -0
  216. package/dist/chunk-ZJRFL6ZN.mjs +34 -0
  217. package/dist/chunk-ZQJPHZKI.mjs +1150 -0
  218. package/dist/chunk-ZQRKUG6J.mjs +72 -0
  219. package/dist/collection-add-products-KTACHFJO.mjs +287 -0
  220. package/dist/collection-create-PBAAYBMB.mjs +134 -0
  221. package/dist/collection-detail-7GFJ3MAT.mjs +469 -0
  222. package/dist/collection-edit-7GW5PA32.mjs +125 -0
  223. package/dist/collection-list-EFER73U6.mjs +257 -0
  224. package/dist/collection-metadata-EVPJGU6A.mjs +73 -0
  225. package/dist/customer-create-IA56MXE6.mjs +183 -0
  226. package/dist/customer-create-address-27M25HTO.mjs +293 -0
  227. package/dist/customer-detail-NCPDOSIN.mjs +706 -0
  228. package/dist/customer-edit-XQ5NWIVX.mjs +194 -0
  229. package/dist/customer-group-add-customers-XMR2WBXX.mjs +244 -0
  230. package/dist/customer-group-create-RY4FVEIW.mjs +113 -0
  231. package/dist/customer-group-detail-GWTXNJ3C.mjs +437 -0
  232. package/dist/customer-group-edit-MQWARIQZ.mjs +110 -0
  233. package/dist/customer-group-list-KZHWADWX.mjs +268 -0
  234. package/dist/customer-group-metadata-JQJRLLXG.mjs +44 -0
  235. package/dist/customer-list-UI5EQDII.mjs +163 -0
  236. package/dist/customer-metadata-HN2DYD5I.mjs +44 -0
  237. package/dist/customers-add-customer-group-3XYEAGX4.mjs +279 -0
  238. package/dist/edit-inventory-item-ELQTABU4.mjs +130 -0
  239. package/dist/edit-inventory-item-attributes-P4WS4UTE.mjs +297 -0
  240. package/dist/edit-reservation-77DUKBGX.mjs +249 -0
  241. package/dist/edit-rules-OOIFNR4Z.mjs +272 -0
  242. package/dist/en.json +3311 -0
  243. package/dist/home-KFQGXKRT.mjs +16 -0
  244. package/dist/index.d.ts +10 -0
  245. package/dist/inventory-create-HQNGRBCA.mjs +599 -0
  246. package/dist/inventory-detail-2MFCIKDT.mjs +751 -0
  247. package/dist/inventory-list-IPORNDO4.mjs +413 -0
  248. package/dist/inventory-metadata-RC7I7WAH.mjs +74 -0
  249. package/dist/inventory-stock-MPV35U3M.mjs +294 -0
  250. package/dist/invite-FVE4ZBKB.mjs +362 -0
  251. package/dist/location-create-WZ43K3W7.mjs +240 -0
  252. package/dist/location-detail-POZVJTS7.mjs +823 -0
  253. package/dist/location-edit-VCS7GVWQ.mjs +256 -0
  254. package/dist/location-fulfillment-providers-TXNXNHRD.mjs +291 -0
  255. package/dist/location-list-KVBA6J47.mjs +323 -0
  256. package/dist/location-sales-channels-P6O7KJAO.mjs +189 -0
  257. package/dist/location-service-zone-create-J43WN6G4.mjs +174 -0
  258. package/dist/location-service-zone-edit-KHHMSPXD.mjs +137 -0
  259. package/dist/location-service-zone-manage-areas-6ZPMKMSX.mjs +155 -0
  260. package/dist/location-service-zone-shipping-option-create-XXHX5DWG.mjs +796 -0
  261. package/dist/location-service-zone-shipping-option-edit-4CGPQ3VT.mjs +368 -0
  262. package/dist/location-service-zone-shipping-option-pricing-5HN2Z5RB.mjs +357 -0
  263. package/dist/login-IMDOL4BZ.mjs +325 -0
  264. package/dist/manage-locations-PWHIZBEM.mjs +250 -0
  265. package/dist/no-match-7QRDCDCD.mjs +33 -0
  266. package/dist/order-allocate-items-PL4YRRG4.mjs +558 -0
  267. package/dist/order-create-claim-H75RPNWI.mjs +2143 -0
  268. package/dist/order-create-edit-6ZOYALA6.mjs +772 -0
  269. package/dist/order-create-exchange-BUZTV7O7.mjs +2144 -0
  270. package/dist/order-create-fulfillment-YJS27E6Y.mjs +610 -0
  271. package/dist/order-create-refund-MY2VRRFA.mjs +690 -0
  272. package/dist/order-create-return-W3KT5LKU.mjs +1288 -0
  273. package/dist/order-create-shipment-QMFZC6ZM.mjs +284 -0
  274. package/dist/order-detail-VYLTG5MG.mjs +3553 -0
  275. package/dist/order-edit-billing-address-ZZ4KK47F.mjs +300 -0
  276. package/dist/order-edit-email-TCRXOK3W.mjs +148 -0
  277. package/dist/order-edit-shipping-address-C3K5IZRG.mjs +297 -0
  278. package/dist/order-export-IFN234IN.mjs +123 -0
  279. package/dist/order-list-57XK2DRD.mjs +247 -0
  280. package/dist/order-metadata-5ESVMAPY.mjs +73 -0
  281. package/dist/order-receive-return-7N3532LA.mjs +554 -0
  282. package/dist/order-request-transfer-VUPJ2FET.mjs +575 -0
  283. package/dist/price-list-configuration-OH3KGRDN.mjs +355 -0
  284. package/dist/price-list-create-77TLF2P2.mjs +960 -0
  285. package/dist/price-list-detail-KDMHC6V4.mjs +559 -0
  286. package/dist/price-list-edit-WMWJFW7S.mjs +227 -0
  287. package/dist/price-list-list-JJXWBCTJ.mjs +251 -0
  288. package/dist/price-list-prices-add-RWB7WFOE.mjs +615 -0
  289. package/dist/price-list-prices-edit-ICTQBHHM.mjs +313 -0
  290. package/dist/product-attributes-WGLFWXTC.mjs +340 -0
  291. package/dist/product-create-O3LW54UN.mjs +2231 -0
  292. package/dist/product-create-option-FWBTGNZG.mjs +151 -0
  293. package/dist/product-create-variant-7EIWI54C.mjs +823 -0
  294. package/dist/product-detail-Q3MTTA4P.mjs +1256 -0
  295. package/dist/product-edit-6C5XFLX6.mjs +313 -0
  296. package/dist/product-edit-option-FIDTMKUN.mjs +156 -0
  297. package/dist/product-export-TX7U6SYH.mjs +131 -0
  298. package/dist/product-image-variants-edit-DWZWPK64.mjs +334 -0
  299. package/dist/product-import-NPPDYH7E.mjs +268 -0
  300. package/dist/product-list-RZNYCKTQ.mjs +459 -0
  301. package/dist/product-media-CG4RFOTX.mjs +701 -0
  302. package/dist/product-metadata-YNSTB5IC.mjs +74 -0
  303. package/dist/product-organization-33W4FFCO.mjs +281 -0
  304. package/dist/product-prices-LAVS64HJ.mjs +227 -0
  305. package/dist/product-sales-channels-XBALPVAL.mjs +165 -0
  306. package/dist/product-shipping-profile-KKDCYD3N.mjs +145 -0
  307. package/dist/product-stock-PEGYC4J5.mjs +545 -0
  308. package/dist/product-tag-create-DJQIEWOF.mjs +127 -0
  309. package/dist/product-tag-detail-JPNWE5QK.mjs +304 -0
  310. package/dist/product-tag-edit-76EA7NLB.mjs +140 -0
  311. package/dist/product-tag-list-KOYJZMGY.mjs +282 -0
  312. package/dist/product-tag-metadata-HMCF2W4C.mjs +73 -0
  313. package/dist/product-type-create-NRLNMABQ.mjs +103 -0
  314. package/dist/product-type-detail-IJ6FGSB2.mjs +265 -0
  315. package/dist/product-type-edit-BHTPMMVI.mjs +117 -0
  316. package/dist/product-type-list-MQ2PW2IE.mjs +201 -0
  317. package/dist/product-type-metadata-5Y5M2IQP.mjs +73 -0
  318. package/dist/product-variant-detail-N7YAKUOH.mjs +571 -0
  319. package/dist/product-variant-edit-L2T5V2HJ.mjs +539 -0
  320. package/dist/product-variant-manage-inventory-items-QK7Z4KHF.mjs +343 -0
  321. package/dist/product-variant-media-IOAZGVL2.mjs +376 -0
  322. package/dist/product-variant-metadata-VTAPSZ24.mjs +77 -0
  323. package/dist/profile-detail-FRZ74HAF.mjs +96 -0
  324. package/dist/profile-edit-ZNXO6WME.mjs +177 -0
  325. package/dist/promotion-add-campaign-DO67QK6M.mjs +45 -0
  326. package/dist/promotion-create-I7OYJO55.mjs +1227 -0
  327. package/dist/promotion-detail-Q7MMF7CC.mjs +509 -0
  328. package/dist/promotion-edit-details-6BSOOWQN.mjs +498 -0
  329. package/dist/promotion-list-L22GJE3P.mjs +216 -0
  330. package/dist/refund-reason-create-UFAJFFFX.mjs +195 -0
  331. package/dist/refund-reason-edit-HM42SYVK.mjs +196 -0
  332. package/dist/refund-reason-list-YROTDEQW.mjs +246 -0
  333. package/dist/region-add-countries-2VAVXMJQ.mjs +223 -0
  334. package/dist/region-create-NA7Y2LN4.mjs +497 -0
  335. package/dist/region-detail-3BARMXUE.mjs +494 -0
  336. package/dist/region-edit-WAU347DP.mjs +310 -0
  337. package/dist/region-list-V4R2REMH.mjs +215 -0
  338. package/dist/region-metadata-UZXRJHUJ.mjs +74 -0
  339. package/dist/reservation-create-M3NKBTYW.mjs +312 -0
  340. package/dist/reservation-detail-JRY5S7TS.mjs +235 -0
  341. package/dist/reservation-list-HSF22GFZ.mjs +302 -0
  342. package/dist/reservation-metadata-UQZXHUCV.mjs +74 -0
  343. package/dist/reset-password-Y5WVXV4Q.mjs +381 -0
  344. package/dist/return-reason-create-HM54WRJY.mjs +163 -0
  345. package/dist/return-reason-edit-VSIRHVQ6.mjs +168 -0
  346. package/dist/return-reason-list-EYLIXARO.mjs +245 -0
  347. package/dist/sales-channel-add-products-WNHRWOZS.mjs +274 -0
  348. package/dist/sales-channel-create-BW5VCR34.mjs +156 -0
  349. package/dist/sales-channel-detail-GKI35W5H.mjs +442 -0
  350. package/dist/sales-channel-edit-NCWKYFYJ.mjs +166 -0
  351. package/dist/sales-channel-list-BHMHTVP5.mjs +207 -0
  352. package/dist/sales-channel-metadata-GY2GM5OH.mjs +79 -0
  353. package/dist/settings-FKUZ6EYT.mjs +19 -0
  354. package/dist/settings-XEM2NEDH.mjs +549 -0
  355. package/dist/shipping-option-type-create-WKI3RSYP.mjs +198 -0
  356. package/dist/shipping-option-type-detail-RJ75KMFI.mjs +180 -0
  357. package/dist/shipping-option-type-edit-4KGCJFG3.mjs +197 -0
  358. package/dist/shipping-option-type-list-NAT6DIHR.mjs +279 -0
  359. package/dist/shipping-profile-create-26R64I3Z.mjs +125 -0
  360. package/dist/shipping-profile-detail-WTKQSOIX.mjs +165 -0
  361. package/dist/shipping-profile-metadata-6D3FYDC4.mjs +75 -0
  362. package/dist/shipping-profiles-list-WRPIJBZZ.mjs +251 -0
  363. package/dist/store-add-currencies-OX2WXFMS.mjs +300 -0
  364. package/dist/store-add-locales-37443R2E.mjs +82 -0
  365. package/dist/store-detail-IIKGTBWO.mjs +781 -0
  366. package/dist/store-edit-5ZS562ZO.mjs +247 -0
  367. package/dist/store-metadata-3P5YI3YQ.mjs +72 -0
  368. package/dist/tax-region-create-BFOF2UVZ.mjs +301 -0
  369. package/dist/tax-region-detail-JDWO7JFL.mjs +388 -0
  370. package/dist/tax-region-edit-I2DTFHH4.mjs +167 -0
  371. package/dist/tax-region-list-P4LDOPZD.mjs +100 -0
  372. package/dist/tax-region-province-create-GKJ7WMRS.mjs +312 -0
  373. package/dist/tax-region-province-detail-NEYURIVX.mjs +280 -0
  374. package/dist/tax-region-tax-override-create-EBTFIY7C.mjs +681 -0
  375. package/dist/tax-region-tax-override-edit-UUKEKERW.mjs +273 -0
  376. package/dist/tax-region-tax-rate-create-MECFGVPL.mjs +195 -0
  377. package/dist/tax-region-tax-rate-edit-7DYSPYOD.mjs +195 -0
  378. package/dist/translation-list-2QIA5IZ4.mjs +582 -0
  379. package/dist/translations-edit-K7EMV5N3.mjs +674 -0
  380. package/dist/user-detail-3IEU4KU4.mjs +172 -0
  381. package/dist/user-edit-ZBB4RMTP.mjs +118 -0
  382. package/dist/user-invite-GAGIM5DO.mjs +343 -0
  383. package/dist/user-list-YTZQNYSO.mjs +165 -0
  384. package/dist/user-metadata-WQ57HEMA.mjs +74 -0
  385. package/dist/workflow-execution-detail-RRZJQZV6.mjs +840 -0
  386. package/dist/workflow-execution-list-C3EJMVSZ.mjs +179 -0
  387. package/package.json +91 -0
  388. package/src/app.tsx +34 -0
  389. package/src/assets/fonts/Inter-Medium.ttf +0 -0
  390. package/src/assets/fonts/Inter-Regular.ttf +0 -0
  391. package/src/assets/fonts/RobotoMono-Medium.ttf +0 -0
  392. package/src/assets/fonts/RobotoMono-Regular.ttf +0 -0
  393. package/src/components/authentication/protected-route/index.ts +1 -0
  394. package/src/components/authentication/protected-route/protected-route.tsx +30 -0
  395. package/src/components/common/action-menu/action-menu.tsx +125 -0
  396. package/src/components/common/action-menu/index.ts +1 -0
  397. package/src/components/common/badge-list-summary/badge-list-summary.tsx +81 -0
  398. package/src/components/common/badge-list-summary/index.ts +1 -0
  399. package/src/components/common/chip-group/chip-group.tsx +111 -0
  400. package/src/components/common/chip-group/index.ts +1 -0
  401. package/src/components/common/conditional-tooltip/conditional-tooltip.tsx +20 -0
  402. package/src/components/common/conditional-tooltip/index.ts +1 -0
  403. package/src/components/common/customer-info/customer-info.tsx +202 -0
  404. package/src/components/common/customer-info/index.ts +1 -0
  405. package/src/components/common/date-range-display/date-range-display.tsx +73 -0
  406. package/src/components/common/date-range-display/index.ts +1 -0
  407. package/src/components/common/display-id/display-id.tsx +30 -0
  408. package/src/components/common/display-id/index.ts +1 -0
  409. package/src/components/common/empty-table-content/empty-table-content.tsx +106 -0
  410. package/src/components/common/empty-table-content/index.ts +1 -0
  411. package/src/components/common/file-preview/file-preview.tsx +130 -0
  412. package/src/components/common/file-preview/index.ts +1 -0
  413. package/src/components/common/file-upload/file-upload.tsx +156 -0
  414. package/src/components/common/file-upload/index.ts +1 -0
  415. package/src/components/common/form/form.tsx +222 -0
  416. package/src/components/common/form/index.ts +1 -0
  417. package/src/components/common/icon-avatar/icon-avatar.tsx +42 -0
  418. package/src/components/common/icon-avatar/index.ts +1 -0
  419. package/src/components/common/infinite-list/index.ts +1 -0
  420. package/src/components/common/infinite-list/infinite-list.tsx +156 -0
  421. package/src/components/common/json-view-section/index.ts +1 -0
  422. package/src/components/common/json-view-section/json-view-section.tsx +201 -0
  423. package/src/components/common/link-button/index.ts +1 -0
  424. package/src/components/common/link-button/link-button.tsx +29 -0
  425. package/src/components/common/list-summary/index.ts +1 -0
  426. package/src/components/common/list-summary/list-summary.tsx +70 -0
  427. package/src/components/common/listicle/index.ts +1 -0
  428. package/src/components/common/listicle/listicle.tsx +34 -0
  429. package/src/components/common/logo-box/avatar-box.tsx +87 -0
  430. package/src/components/common/logo-box/index.ts +2 -0
  431. package/src/components/common/logo-box/logo-box.tsx +74 -0
  432. package/src/components/common/metadata-section/index.ts +1 -0
  433. package/src/components/common/metadata-section/metadata-section.tsx +49 -0
  434. package/src/components/common/progress-bar/index.ts +1 -0
  435. package/src/components/common/progress-bar/progress-bar.tsx +33 -0
  436. package/src/components/common/section/index.ts +1 -0
  437. package/src/components/common/section/section-row.tsx +41 -0
  438. package/src/components/common/segmented-control/index.ts +2 -0
  439. package/src/components/common/segmented-control/segmented-control.tsx +53 -0
  440. package/src/components/common/sidebar-link/indext.ts +1 -0
  441. package/src/components/common/sidebar-link/sidebar-link.tsx +47 -0
  442. package/src/components/common/skeleton/index.ts +1 -0
  443. package/src/components/common/skeleton/skeleton.tsx +327 -0
  444. package/src/components/common/sortable-list/index.ts +1 -0
  445. package/src/components/common/sortable-list/sortable-list.tsx +228 -0
  446. package/src/components/common/sortable-tree/index.ts +1 -0
  447. package/src/components/common/sortable-tree/keyboard-coordinates.ts +156 -0
  448. package/src/components/common/sortable-tree/sortable-tree-item.tsx +62 -0
  449. package/src/components/common/sortable-tree/sortable-tree.tsx +379 -0
  450. package/src/components/common/sortable-tree/tree-item.tsx +207 -0
  451. package/src/components/common/sortable-tree/types.ts +23 -0
  452. package/src/components/common/sortable-tree/utils.ts +299 -0
  453. package/src/components/common/switch-box/index.ts +1 -0
  454. package/src/components/common/switch-box/switch-box.tsx +76 -0
  455. package/src/components/common/tax-badge/tax-badge.tsx +30 -0
  456. package/src/components/common/thumbnail/index.ts +1 -0
  457. package/src/components/common/thumbnail/thumbnail.tsx +32 -0
  458. package/src/components/common/user-link/index.ts +1 -0
  459. package/src/components/common/user-link/user-link.tsx +45 -0
  460. package/src/components/data-grid/components/data-grid-boolean-cell.tsx +71 -0
  461. package/src/components/data-grid/components/data-grid-cell-container.tsx +97 -0
  462. package/src/components/data-grid/components/data-grid-country-select-cell.tsx +149 -0
  463. package/src/components/data-grid/components/data-grid-currency-cell.tsx +140 -0
  464. package/src/components/data-grid/components/data-grid-duplicate-cell.tsx +21 -0
  465. package/src/components/data-grid/components/data-grid-keyboard-shortcut-modal.tsx +245 -0
  466. package/src/components/data-grid/components/data-grid-multiline-cell.tsx +103 -0
  467. package/src/components/data-grid/components/data-grid-number-cell.tsx +94 -0
  468. package/src/components/data-grid/components/data-grid-readonly-cell.tsx +43 -0
  469. package/src/components/data-grid/components/data-grid-root.tsx +1156 -0
  470. package/src/components/data-grid/components/data-grid-row-error-indicator.tsx +55 -0
  471. package/src/components/data-grid/components/data-grid-select-cell.tsx +55 -0
  472. package/src/components/data-grid/components/data-grid-skeleton.tsx +63 -0
  473. package/src/components/data-grid/components/data-grid-text-cell.tsx +75 -0
  474. package/src/components/data-grid/components/data-grid-textarea-modal-cell.tsx +233 -0
  475. package/src/components/data-grid/components/data-grid-toggleable-number-cell.tsx +206 -0
  476. package/src/components/data-grid/components/index.ts +9 -0
  477. package/src/components/data-grid/context/data-grid-context.tsx +45 -0
  478. package/src/components/data-grid/context/index.ts +2 -0
  479. package/src/components/data-grid/context/use-data-grid-context.tsx +14 -0
  480. package/src/components/data-grid/data-grid.tsx +56 -0
  481. package/src/components/data-grid/helpers/create-data-grid-column-helper.ts +93 -0
  482. package/src/components/data-grid/helpers/create-data-grid-price-columns.tsx +136 -0
  483. package/src/components/data-grid/helpers/index.ts +2 -0
  484. package/src/components/data-grid/hooks/index.ts +14 -0
  485. package/src/components/data-grid/hooks/use-data-grid-cell-error.tsx +78 -0
  486. package/src/components/data-grid/hooks/use-data-grid-cell-handlers.tsx +162 -0
  487. package/src/components/data-grid/hooks/use-data-grid-cell-metadata.tsx +75 -0
  488. package/src/components/data-grid/hooks/use-data-grid-cell-snapshot.tsx +75 -0
  489. package/src/components/data-grid/hooks/use-data-grid-cell.tsx +257 -0
  490. package/src/components/data-grid/hooks/use-data-grid-clipboard-events.tsx +105 -0
  491. package/src/components/data-grid/hooks/use-data-grid-column-visibility.tsx +68 -0
  492. package/src/components/data-grid/hooks/use-data-grid-duplicate-cell.tsx +18 -0
  493. package/src/components/data-grid/hooks/use-data-grid-error-highlighting.tsx +133 -0
  494. package/src/components/data-grid/hooks/use-data-grid-form-handlers.tsx +236 -0
  495. package/src/components/data-grid/hooks/use-data-grid-keydown-event.tsx +732 -0
  496. package/src/components/data-grid/hooks/use-data-grid-mouse-up-event.tsx +96 -0
  497. package/src/components/data-grid/hooks/use-data-grid-navigation.tsx +113 -0
  498. package/src/components/data-grid/hooks/use-data-grid-query-tool.tsx +15 -0
  499. package/src/components/data-grid/index.ts +2 -0
  500. package/src/components/data-grid/models/data-grid-bulk-update-command.ts +38 -0
  501. package/src/components/data-grid/models/data-grid-matrix.ts +421 -0
  502. package/src/components/data-grid/models/data-grid-query-tool.ts +74 -0
  503. package/src/components/data-grid/models/data-grid-update-command.ts +33 -0
  504. package/src/components/data-grid/models/index.ts +5 -0
  505. package/src/components/data-grid/types.ts +173 -0
  506. package/src/components/data-grid/utils.ts +28 -0
  507. package/src/components/data-table/components/data-table-status-cell/data-table-status-cell.tsx +35 -0
  508. package/src/components/data-table/data-table.tsx +543 -0
  509. package/src/components/data-table/helpers/general/use-data-table-date-columns.tsx +61 -0
  510. package/src/components/data-table/helpers/general/use-data-table-date-filters.tsx +95 -0
  511. package/src/components/data-table/helpers/sales-channels/index.ts +4 -0
  512. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-columns.tsx +61 -0
  513. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-empty-state.tsx +22 -0
  514. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-filters.tsx +33 -0
  515. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-query.tsx +30 -0
  516. package/src/components/data-table/index.ts +1 -0
  517. package/src/components/filtering/filter-group/filter-group.tsx +58 -0
  518. package/src/components/filtering/filter-group/index.ts +1 -0
  519. package/src/components/filtering/order-by/index.ts +1 -0
  520. package/src/components/filtering/order-by/order-by.tsx +151 -0
  521. package/src/components/filtering/query/index.ts +1 -0
  522. package/src/components/filtering/query/query.tsx +57 -0
  523. package/src/components/forms/address-form/address-form.tsx +228 -0
  524. package/src/components/forms/address-form/index.ts +1 -0
  525. package/src/components/forms/email-form/email-form.tsx +42 -0
  526. package/src/components/forms/email-form/index.ts +1 -0
  527. package/src/components/forms/metadata-form/index.ts +1 -0
  528. package/src/components/forms/metadata-form/metadata-form.tsx +438 -0
  529. package/src/components/inputs/chip-input/chip-input.tsx +191 -0
  530. package/src/components/inputs/chip-input/index.ts +1 -0
  531. package/src/components/inputs/combobox/combobox.tsx +422 -0
  532. package/src/components/inputs/combobox/index.ts +1 -0
  533. package/src/components/inputs/country-select/country-select.tsx +53 -0
  534. package/src/components/inputs/country-select/index.ts +1 -0
  535. package/src/components/inputs/handle-input/handle-input.tsx +24 -0
  536. package/src/components/inputs/handle-input/index.ts +1 -0
  537. package/src/components/inputs/percentage-input/index.ts +1 -0
  538. package/src/components/inputs/percentage-input/percentage-input.tsx +105 -0
  539. package/src/components/inputs/province-select/index.ts +1 -0
  540. package/src/components/inputs/province-select/province-select.tsx +91 -0
  541. package/src/components/layout/main-layout/index.ts +1 -0
  542. package/src/components/layout/main-layout/main-layout.tsx +388 -0
  543. package/src/components/layout/nav-item/index.ts +1 -0
  544. package/src/components/layout/nav-item/nav-item.tsx +254 -0
  545. package/src/components/layout/notifications/index.ts +1 -0
  546. package/src/components/layout/notifications/notifications.tsx +232 -0
  547. package/src/components/layout/pages/index.ts +2 -0
  548. package/src/components/layout/pages/single-column-page/index.ts +1 -0
  549. package/src/components/layout/pages/single-column-page/single-column-page.tsx +63 -0
  550. package/src/components/layout/pages/two-column-page/index.ts +1 -0
  551. package/src/components/layout/pages/two-column-page/two-column-page.tsx +141 -0
  552. package/src/components/layout/pages/types.ts +15 -0
  553. package/src/components/layout/public-layout/index.ts +1 -0
  554. package/src/components/layout/public-layout/public-layout.tsx +5 -0
  555. package/src/components/layout/settings-layout/index.ts +1 -0
  556. package/src/components/layout/settings-layout/settings-layout.tsx +266 -0
  557. package/src/components/layout/shell/index.ts +1 -0
  558. package/src/components/layout/shell/shell.tsx +263 -0
  559. package/src/components/layout/user-menu/index.ts +1 -0
  560. package/src/components/layout/user-menu/user-menu.tsx +344 -0
  561. package/src/components/localization/localized-table-pagination/index.ts +1 -0
  562. package/src/components/localization/localized-table-pagination/localized-table-pagination.tsx +26 -0
  563. package/src/components/modals/hooks/use-state-aware-to.tsx +32 -0
  564. package/src/components/modals/index.ts +7 -0
  565. package/src/components/modals/route-drawer/index.ts +1 -0
  566. package/src/components/modals/route-drawer/route-drawer.tsx +82 -0
  567. package/src/components/modals/route-focus-modal/index.ts +1 -0
  568. package/src/components/modals/route-focus-modal/route-focus-modal.tsx +109 -0
  569. package/src/components/modals/route-modal-form/index.ts +1 -0
  570. package/src/components/modals/route-modal-form/route-modal-form.tsx +93 -0
  571. package/src/components/modals/route-modal-provider/index.ts +2 -0
  572. package/src/components/modals/route-modal-provider/route-modal-context.tsx +12 -0
  573. package/src/components/modals/route-modal-provider/route-provider.tsx +51 -0
  574. package/src/components/modals/route-modal-provider/use-route-modal.tsx +12 -0
  575. package/src/components/modals/stacked-drawer/index.ts +1 -0
  576. package/src/components/modals/stacked-drawer/stacked-drawer.tsx +85 -0
  577. package/src/components/modals/stacked-focus-modal/index.ts +1 -0
  578. package/src/components/modals/stacked-focus-modal/stacked-focus-modal.tsx +98 -0
  579. package/src/components/modals/stacked-modal-provider/index.ts +2 -0
  580. package/src/components/modals/stacked-modal-provider/stacked-modal-context.tsx +10 -0
  581. package/src/components/modals/stacked-modal-provider/stacked-modal-provider.tsx +54 -0
  582. package/src/components/modals/stacked-modal-provider/use-stacked-modal.ts +14 -0
  583. package/src/components/search/constants.ts +30 -0
  584. package/src/components/search/index.ts +1 -0
  585. package/src/components/search/search.tsx +576 -0
  586. package/src/components/search/types.ts +20 -0
  587. package/src/components/search/use-search-results.tsx +752 -0
  588. package/src/components/table/configurable-data-table/configurable-data-table.tsx +240 -0
  589. package/src/components/table/configurable-data-table/index.ts +3 -0
  590. package/src/components/table/configurable-data-table/save-view-dropdown.tsx +87 -0
  591. package/src/components/table/data-table/data-table-filter/context.tsx +19 -0
  592. package/src/components/table/data-table/data-table-filter/data-table-filter.tsx +296 -0
  593. package/src/components/table/data-table/data-table-filter/date-filter.tsx +328 -0
  594. package/src/components/table/data-table/data-table-filter/filter-chip.tsx +97 -0
  595. package/src/components/table/data-table/data-table-filter/index.ts +1 -0
  596. package/src/components/table/data-table/data-table-filter/number-filter.tsx +316 -0
  597. package/src/components/table/data-table/data-table-filter/select-filter.tsx +201 -0
  598. package/src/components/table/data-table/data-table-filter/string-filter.tsx +125 -0
  599. package/src/components/table/data-table/data-table-filter/types.ts +9 -0
  600. package/src/components/table/data-table/data-table-order-by/data-table-order-by.tsx +153 -0
  601. package/src/components/table/data-table/data-table-order-by/index.ts +1 -0
  602. package/src/components/table/data-table/data-table-query/data-table-query.tsx +39 -0
  603. package/src/components/table/data-table/data-table-query/index.ts +1 -0
  604. package/src/components/table/data-table/data-table-root/data-table-root.tsx +382 -0
  605. package/src/components/table/data-table/data-table-root/index.ts +1 -0
  606. package/src/components/table/data-table/data-table-search/data-table-search.tsx +61 -0
  607. package/src/components/table/data-table/data-table-search/index.ts +1 -0
  608. package/src/components/table/data-table/data-table.tsx +96 -0
  609. package/src/components/table/data-table/hooks.tsx +73 -0
  610. package/src/components/table/data-table/index.ts +2 -0
  611. package/src/components/table/save-view-dialog/index.ts +1 -0
  612. package/src/components/table/save-view-dialog/save-view-dialog.tsx +163 -0
  613. package/src/components/table/save-view-dropdown/index.ts +1 -0
  614. package/src/components/table/save-view-dropdown/save-view-dropdown.tsx +88 -0
  615. package/src/components/table/table-cells/common/code-cell/code-cell.tsx +27 -0
  616. package/src/components/table/table-cells/common/code-cell/index.ts +1 -0
  617. package/src/components/table/table-cells/common/created-at-cell/created-at-cell.tsx +44 -0
  618. package/src/components/table/table-cells/common/created-at-cell/index.ts +1 -0
  619. package/src/components/table/table-cells/common/date-cell/date-cell.tsx +44 -0
  620. package/src/components/table/table-cells/common/date-cell/index.ts +1 -0
  621. package/src/components/table/table-cells/common/email-cell/email-cell.tsx +28 -0
  622. package/src/components/table/table-cells/common/email-cell/index.ts +1 -0
  623. package/src/components/table/table-cells/common/money-amount-cell/index.ts +1 -0
  624. package/src/components/table/table-cells/common/money-amount-cell/money-amount-cell.tsx +38 -0
  625. package/src/components/table/table-cells/common/name-cell/index.ts +1 -0
  626. package/src/components/table/table-cells/common/name-cell/name-cell.tsx +31 -0
  627. package/src/components/table/table-cells/common/placeholder-cell/index.ts +1 -0
  628. package/src/components/table/table-cells/common/placeholder-cell/placeholder-cell.tsx +7 -0
  629. package/src/components/table/table-cells/common/status-cell/index.ts +1 -0
  630. package/src/components/table/table-cells/common/status-cell/status-cell.tsx +35 -0
  631. package/src/components/table/table-cells/common/text-cell/index.ts +1 -0
  632. package/src/components/table/table-cells/common/text-cell/text-cell.tsx +49 -0
  633. package/src/components/table/table-cells/customer/account-cell/account-cell.tsx +27 -0
  634. package/src/components/table/table-cells/customer/first-seen-cell/first-seen-cell.tsx +25 -0
  635. package/src/components/table/table-cells/customer/first-seen-cell/index.ts +1 -0
  636. package/src/components/table/table-cells/order/country-cell/country-cell.tsx +36 -0
  637. package/src/components/table/table-cells/order/country-cell/index.ts +1 -0
  638. package/src/components/table/table-cells/order/customer-cell/customer-cell.tsx +31 -0
  639. package/src/components/table/table-cells/order/customer-cell/index.ts +1 -0
  640. package/src/components/table/table-cells/order/display-id-cell/display-id-cell.tsx +24 -0
  641. package/src/components/table/table-cells/order/display-id-cell/index.ts +1 -0
  642. package/src/components/table/table-cells/order/fulfillment-status-cell/fulfillment-status-cell.tsx +35 -0
  643. package/src/components/table/table-cells/order/fulfillment-status-cell/index.ts +1 -0
  644. package/src/components/table/table-cells/order/payment-status-cell/index.ts +1 -0
  645. package/src/components/table/table-cells/order/payment-status-cell/payment-status-cell.tsx +26 -0
  646. package/src/components/table/table-cells/order/sales-channel-cell/index.ts +1 -0
  647. package/src/components/table/table-cells/order/sales-channel-cell/sales-channel-cell.tsx +30 -0
  648. package/src/components/table/table-cells/order/total-cell/index.ts +1 -0
  649. package/src/components/table/table-cells/order/total-cell/total-cell.tsx +29 -0
  650. package/src/components/table/table-cells/product/collection-cell/collection-cell.tsx +30 -0
  651. package/src/components/table/table-cells/product/collection-cell/index.ts +1 -0
  652. package/src/components/table/table-cells/product/product-cell/index.ts +1 -0
  653. package/src/components/table/table-cells/product/product-cell/product-cell.tsx +31 -0
  654. package/src/components/table/table-cells/product/product-status-cell/index.ts +1 -0
  655. package/src/components/table/table-cells/product/product-status-cell/product-status-cell.tsx +31 -0
  656. package/src/components/table/table-cells/product/sales-channels-cell/index.ts +1 -0
  657. package/src/components/table/table-cells/product/sales-channels-cell/sales-channels-cell.tsx +67 -0
  658. package/src/components/table/table-cells/product/variant-cell/index.ts +1 -0
  659. package/src/components/table/table-cells/product/variant-cell/variant-cell.tsx +34 -0
  660. package/src/components/table/table-cells/promotion/status-cell/index.ts +1 -0
  661. package/src/components/table/table-cells/promotion/status-cell/status-cell.tsx +13 -0
  662. package/src/components/table/table-cells/region/countries-cell/countries-cell.tsx +39 -0
  663. package/src/components/table/table-cells/region/countries-cell/index.ts +1 -0
  664. package/src/components/table/table-cells/region/fulfillment-providers-cell/fulfillment-providers-cell.tsx +49 -0
  665. package/src/components/table/table-cells/region/fulfillment-providers-cell/index.ts +1 -0
  666. package/src/components/table/table-cells/region/payment-providers-cell/index.ts +1 -0
  667. package/src/components/table/table-cells/region/payment-providers-cell/payment-providers-cell.tsx +36 -0
  668. package/src/components/table/table-cells/region/region-cell/index.ts +1 -0
  669. package/src/components/table/table-cells/region/region-cell/region-cell.tsx +23 -0
  670. package/src/components/table/table-cells/sales-channel/description-cell/description-cell.tsx +28 -0
  671. package/src/components/table/table-cells/sales-channel/description-cell/index.ts +1 -0
  672. package/src/components/table/table-cells/sales-channel/name-cell/index.ts +1 -0
  673. package/src/components/table/table-cells/sales-channel/name-cell/name-cell.tsx +28 -0
  674. package/src/components/table/table-cells/shipping-option/admin-only-cell/admin-only-cell.tsx +25 -0
  675. package/src/components/table/table-cells/shipping-option/admin-only-cell/index.ts +1 -0
  676. package/src/components/table/table-cells/shipping-option/is-return-cell/index.ts +1 -0
  677. package/src/components/table/table-cells/shipping-option/is-return-cell/is-return-cell.tsx +27 -0
  678. package/src/components/table/table-cells/shipping-option/price-type-cell/index.ts +1 -0
  679. package/src/components/table/table-cells/shipping-option/price-type-cell/price-type-cell.tsx +34 -0
  680. package/src/components/table/table-cells/shipping-option/shipping-option-cell/index.ts +1 -0
  681. package/src/components/table/table-cells/shipping-option/shipping-option-cell/shipping-option-cell.tsx +28 -0
  682. package/src/components/table/table-cells/shipping-option/shipping-price-cell/shipping-price-cell.tsx +31 -0
  683. package/src/components/table/table-cells/taxes/type-cell/index.ts +1 -0
  684. package/src/components/table/table-cells/taxes/type-cell/type-cell.tsx +33 -0
  685. package/src/components/table/view-selector/index.ts +2 -0
  686. package/src/components/table/view-selector/view-pills.tsx +265 -0
  687. package/src/components/table/view-selector/view-selector.tsx +253 -0
  688. package/src/components/utilities/error-boundary/error-boundary.tsx +75 -0
  689. package/src/components/utilities/error-boundary/index.ts +1 -0
  690. package/src/components/utilities/generic-forward-ref/generic-forward-ref.tsx +7 -0
  691. package/src/components/utilities/generic-forward-ref/index.ts +1 -0
  692. package/src/components/utilities/i18n/i18n.tsx +33 -0
  693. package/src/components/utilities/i18n/index.ts +1 -0
  694. package/src/components/utilities/keybound-form/index.ts +1 -0
  695. package/src/components/utilities/keybound-form/keybound-form.tsx +42 -0
  696. package/src/components/utilities/visually-hidden/index.ts +1 -0
  697. package/src/components/utilities/visually-hidden/visually-hidden.tsx +5 -0
  698. package/src/dashboard-app/__tests__/sort-menu-items-by-rank.spec.ts +169 -0
  699. package/src/dashboard-app/dashboard-app.tsx +499 -0
  700. package/src/dashboard-app/forms/form-extension-zone/form-extension-zone.tsx +116 -0
  701. package/src/dashboard-app/forms/form-extension-zone/index.ts +1 -0
  702. package/src/dashboard-app/forms/form-extension-zone/types.ts +1 -0
  703. package/src/dashboard-app/forms/form-extension-zone/utils.ts +66 -0
  704. package/src/dashboard-app/forms/hooks.tsx +86 -0
  705. package/src/dashboard-app/forms/index.ts +2 -0
  706. package/src/dashboard-app/index.ts +12 -0
  707. package/src/dashboard-app/links/utils.ts +20 -0
  708. package/src/dashboard-app/routes/get-route.map.tsx +1904 -0
  709. package/src/dashboard-app/routes/utils.ts +229 -0
  710. package/src/dashboard-app/types.ts +143 -0
  711. package/src/dashboard-app/utils/sort-menu-items-by-rank.ts +43 -0
  712. package/src/hooks/api/api-keys.tsx +179 -0
  713. package/src/hooks/api/auth.tsx +75 -0
  714. package/src/hooks/api/campaigns.tsx +138 -0
  715. package/src/hooks/api/categories.tsx +186 -0
  716. package/src/hooks/api/claims.tsx +593 -0
  717. package/src/hooks/api/cloud.tsx +41 -0
  718. package/src/hooks/api/collections.tsx +180 -0
  719. package/src/hooks/api/currencies.tsx +52 -0
  720. package/src/hooks/api/customer-groups.tsx +207 -0
  721. package/src/hooks/api/customers.tsx +263 -0
  722. package/src/hooks/api/exchanges.tsx +475 -0
  723. package/src/hooks/api/feature-flags.tsx +26 -0
  724. package/src/hooks/api/fulfillment-providers.tsx +59 -0
  725. package/src/hooks/api/fulfillment-sets.tsx +180 -0
  726. package/src/hooks/api/fulfillment.tsx +66 -0
  727. package/src/hooks/api/index.ts +41 -0
  728. package/src/hooks/api/inventory.tsx +274 -0
  729. package/src/hooks/api/invites.tsx +135 -0
  730. package/src/hooks/api/locales.tsx +52 -0
  731. package/src/hooks/api/notification.tsx +52 -0
  732. package/src/hooks/api/order-edits.tsx +242 -0
  733. package/src/hooks/api/orders.tsx +457 -0
  734. package/src/hooks/api/payment-collections.tsx +104 -0
  735. package/src/hooks/api/payments.tsx +116 -0
  736. package/src/hooks/api/plugins.tsx +28 -0
  737. package/src/hooks/api/price-lists.tsx +199 -0
  738. package/src/hooks/api/price-preferences.tsx +113 -0
  739. package/src/hooks/api/product-types.tsx +152 -0
  740. package/src/hooks/api/product-variants.tsx +69 -0
  741. package/src/hooks/api/products.tsx +508 -0
  742. package/src/hooks/api/promotions.tsx +286 -0
  743. package/src/hooks/api/refund-reasons.tsx +124 -0
  744. package/src/hooks/api/regions.tsx +131 -0
  745. package/src/hooks/api/reservations.tsx +149 -0
  746. package/src/hooks/api/return-reasons.tsx +132 -0
  747. package/src/hooks/api/returns.tsx +651 -0
  748. package/src/hooks/api/sales-channels.tsx +236 -0
  749. package/src/hooks/api/shipping-option-types.tsx +128 -0
  750. package/src/hooks/api/shipping-options.tsx +128 -0
  751. package/src/hooks/api/shipping-profiles.tsx +131 -0
  752. package/src/hooks/api/stock-locations.tsx +202 -0
  753. package/src/hooks/api/store.tsx +83 -0
  754. package/src/hooks/api/tags.tsx +160 -0
  755. package/src/hooks/api/tax-rates.tsx +127 -0
  756. package/src/hooks/api/tax-regions.tsx +124 -0
  757. package/src/hooks/api/translations.tsx +241 -0
  758. package/src/hooks/api/users.tsx +150 -0
  759. package/src/hooks/api/views.tsx +244 -0
  760. package/src/hooks/api/workflow-executions.tsx +52 -0
  761. package/src/hooks/table/columns/index.ts +12 -0
  762. package/src/hooks/table/columns/use-campaign-table-columns.tsx +73 -0
  763. package/src/hooks/table/columns/use-collection-table-columns.tsx +33 -0
  764. package/src/hooks/table/columns/use-column-state.ts +209 -0
  765. package/src/hooks/table/columns/use-configurable-table-columns.tsx +109 -0
  766. package/src/hooks/table/columns/use-customer-group-table-columns.tsx +33 -0
  767. package/src/hooks/table/columns/use-customer-table-columns.tsx +51 -0
  768. package/src/hooks/table/columns/use-fulfillment-provider-table-columns.tsx +25 -0
  769. package/src/hooks/table/columns/use-order-data-table-columns.tsx +234 -0
  770. package/src/hooks/table/columns/use-order-table-columns.tsx +162 -0
  771. package/src/hooks/table/columns/use-product-table-columns.tsx +59 -0
  772. package/src/hooks/table/columns/use-product-tag-table-columns.tsx +35 -0
  773. package/src/hooks/table/columns/use-product-type-table-columns.tsx +36 -0
  774. package/src/hooks/table/columns/use-promotion-table-columns.tsx +49 -0
  775. package/src/hooks/table/columns/use-refund-reason-table-columns.tsx +39 -0
  776. package/src/hooks/table/columns/use-region-table-columns.tsx +40 -0
  777. package/src/hooks/table/columns/use-return-reason-table-columns.tsx +32 -0
  778. package/src/hooks/table/columns/use-shipping-option-table-columns.tsx +89 -0
  779. package/src/hooks/table/columns/use-shipping-option-type-table-columns.tsx +44 -0
  780. package/src/hooks/table/columns/use-tax-rates-table-columns.tsx +55 -0
  781. package/src/hooks/table/filters/index.ts +12 -0
  782. package/src/hooks/table/filters/use-collection-table-filters.tsx +7 -0
  783. package/src/hooks/table/filters/use-customer-group-table-filters.tsx +21 -0
  784. package/src/hooks/table/filters/use-customer-table-filters.tsx +68 -0
  785. package/src/hooks/table/filters/use-date-table-filters.tsx +17 -0
  786. package/src/hooks/table/filters/use-order-table-filters.tsx +154 -0
  787. package/src/hooks/table/filters/use-product-table-filters.tsx +212 -0
  788. package/src/hooks/table/filters/use-product-tag-table-filters.tsx +7 -0
  789. package/src/hooks/table/filters/use-product-type-table-filters.tsx +7 -0
  790. package/src/hooks/table/filters/use-promotion-table-filters.tsx +13 -0
  791. package/src/hooks/table/filters/use-region-table-filters.tsx +19 -0
  792. package/src/hooks/table/filters/use-shipping-option-table-filters.tsx +30 -0
  793. package/src/hooks/table/filters/use-shipping-option-type-table-filters.tsx +5 -0
  794. package/src/hooks/table/filters/use-tax-rate-table-filters.tsx +19 -0
  795. package/src/hooks/table/query/index.ts +15 -0
  796. package/src/hooks/table/query/use-campaign-table-query.tsx +31 -0
  797. package/src/hooks/table/query/use-collection-table-query.tsx +33 -0
  798. package/src/hooks/table/query/use-customer-group-table-query.tsx +33 -0
  799. package/src/hooks/table/query/use-customer-table-query.tsx +44 -0
  800. package/src/hooks/table/query/use-fulfillment-providers-table-query.tsx +31 -0
  801. package/src/hooks/table/query/use-order-table-query.tsx +57 -0
  802. package/src/hooks/table/query/use-product-table-query.tsx +72 -0
  803. package/src/hooks/table/query/use-product-tag-table-query.tsx +32 -0
  804. package/src/hooks/table/query/use-product-type-table-query.tsx +32 -0
  805. package/src/hooks/table/query/use-product-variant-table-query.tsx +32 -0
  806. package/src/hooks/table/query/use-promotion-table-query.tsx +33 -0
  807. package/src/hooks/table/query/use-refund-reason-table-query.tsx +32 -0
  808. package/src/hooks/table/query/use-region-table-query.tsx +33 -0
  809. package/src/hooks/table/query/use-return-reason-table-query.tsx +32 -0
  810. package/src/hooks/table/query/use-shipping-option-table-query.tsx +61 -0
  811. package/src/hooks/table/query/use-shipping-option-type-table-query.tsx +32 -0
  812. package/src/hooks/table/query/use-tax-rate-table-query.tsx +33 -0
  813. package/src/hooks/table/query/use-tax-region-table-query.tsx +32 -0
  814. package/src/hooks/table/query/use-user-invite-table-query.tsx +32 -0
  815. package/src/hooks/table/use-table-configuration.tsx +287 -0
  816. package/src/hooks/use-combined-refs.tsx +19 -0
  817. package/src/hooks/use-combobox-data.tsx +123 -0
  818. package/src/hooks/use-command-history.tsx +67 -0
  819. package/src/hooks/use-data-table.tsx +132 -0
  820. package/src/hooks/use-date.tsx +48 -0
  821. package/src/hooks/use-debounced-search.tsx +29 -0
  822. package/src/hooks/use-document-direction.tsx +54 -0
  823. package/src/hooks/use-handle-table-scroll.tsx +24 -0
  824. package/src/hooks/use-infinite-list.tsx +92 -0
  825. package/src/hooks/use-media-query.tsx +14 -0
  826. package/src/hooks/use-query-params.tsx +24 -0
  827. package/src/hooks/use-view-configurations.tsx +102 -0
  828. package/src/i18n/config.ts +16 -0
  829. package/src/i18n/languages.ts +223 -0
  830. package/src/i18n/translations/$schema.json +12399 -0
  831. package/src/i18n/translations/__tests__/validate-translations.spec.ts +67 -0
  832. package/src/i18n/translations/ar.json +2956 -0
  833. package/src/i18n/translations/bg.json +2987 -0
  834. package/src/i18n/translations/bs.json +3016 -0
  835. package/src/i18n/translations/cs.json +3050 -0
  836. package/src/i18n/translations/de.json +2792 -0
  837. package/src/i18n/translations/el.json +2960 -0
  838. package/src/i18n/translations/en.json +3311 -0
  839. package/src/i18n/translations/es.json +3167 -0
  840. package/src/i18n/translations/fa.json +2932 -0
  841. package/src/i18n/translations/fr.json +2791 -0
  842. package/src/i18n/translations/he.json +3017 -0
  843. package/src/i18n/translations/hu.json +3005 -0
  844. package/src/i18n/translations/id.json +3020 -0
  845. package/src/i18n/translations/index.ts +126 -0
  846. package/src/i18n/translations/it.json +2805 -0
  847. package/src/i18n/translations/ja.json +2821 -0
  848. package/src/i18n/translations/ko.json +3026 -0
  849. package/src/i18n/translations/lt.json +3007 -0
  850. package/src/i18n/translations/mk.json +2925 -0
  851. package/src/i18n/translations/mn.json +2922 -0
  852. package/src/i18n/translations/nl.json +3005 -0
  853. package/src/i18n/translations/pl.json +3227 -0
  854. package/src/i18n/translations/ptBR.json +2789 -0
  855. package/src/i18n/translations/ptPT.json +3219 -0
  856. package/src/i18n/translations/ro.json +2935 -0
  857. package/src/i18n/translations/ru.json +2936 -0
  858. package/src/i18n/translations/th.json +2792 -0
  859. package/src/i18n/translations/tr.json +2961 -0
  860. package/src/i18n/translations/uk.json +2856 -0
  861. package/src/i18n/translations/vi.json +3051 -0
  862. package/src/i18n/translations/zhCN.json +3017 -0
  863. package/src/i18n/translations/zhTW.json +3249 -0
  864. package/src/i18n/types.ts +15 -0
  865. package/src/i18next.d.ts +7 -0
  866. package/src/index.css +48 -0
  867. package/src/index.ts +2 -0
  868. package/src/lib/addresses.ts +97 -0
  869. package/src/lib/cast-number.ts +6 -0
  870. package/src/lib/client/client.ts +18 -0
  871. package/src/lib/client/index.ts +1 -0
  872. package/src/lib/common.ts +45 -0
  873. package/src/lib/credit-line.ts +8 -0
  874. package/src/lib/data/countries.ts +1767 -0
  875. package/src/lib/data/country-states.ts +1311 -0
  876. package/src/lib/data/currencies.ts +752 -0
  877. package/src/lib/form-helpers.ts +69 -0
  878. package/src/lib/format-currency.ts +7 -0
  879. package/src/lib/format-provider.ts +18 -0
  880. package/src/lib/is-fetch-error.ts +5 -0
  881. package/src/lib/money-amount-helpers.ts +75 -0
  882. package/src/lib/number-helper.ts +19 -0
  883. package/src/lib/order-helpers.ts +74 -0
  884. package/src/lib/order-item.ts +5 -0
  885. package/src/lib/orders.ts +23 -0
  886. package/src/lib/payment.ts +23 -0
  887. package/src/lib/percentage-helpers.ts +28 -0
  888. package/src/lib/plugins.ts +7 -0
  889. package/src/lib/promotions.ts +51 -0
  890. package/src/lib/query-client.ts +13 -0
  891. package/src/lib/query-key-factory.ts +53 -0
  892. package/src/lib/rma.ts +17 -0
  893. package/src/lib/schemas.ts +36 -0
  894. package/src/lib/shipping-options.ts +62 -0
  895. package/src/lib/storefront.ts +2 -0
  896. package/src/lib/table/cell-renderers.tsx +332 -0
  897. package/src/lib/table/entity-adapters.tsx +138 -0
  898. package/src/lib/table/entity-defaults.ts +73 -0
  899. package/src/lib/table/field-utils.ts +75 -0
  900. package/src/lib/table/table-adapters.ts +94 -0
  901. package/src/lib/table-display-utils.tsx +372 -0
  902. package/src/lib/validation.ts +101 -0
  903. package/src/main.tsx +9 -0
  904. package/src/module.d.ts +41 -0
  905. package/src/providers/extension-provider/extension-context.tsx +8 -0
  906. package/src/providers/extension-provider/extension-provider.tsx +18 -0
  907. package/src/providers/extension-provider/index.ts +2 -0
  908. package/src/providers/extension-provider/use-extension.tsx +10 -0
  909. package/src/providers/feature-flag-provider/index.tsx +46 -0
  910. package/src/providers/i18n-provider/i18n-provider.tsx +25 -0
  911. package/src/providers/i18n-provider/index.ts +1 -0
  912. package/src/providers/index.ts +1 -0
  913. package/src/providers/keybind-provider/hooks.tsx +319 -0
  914. package/src/providers/keybind-provider/index.ts +3 -0
  915. package/src/providers/keybind-provider/keybind-context.tsx +4 -0
  916. package/src/providers/keybind-provider/keybind-provider.tsx +64 -0
  917. package/src/providers/keybind-provider/types.ts +28 -0
  918. package/src/providers/keybind-provider/utils.ts +92 -0
  919. package/src/providers/providers.tsx +34 -0
  920. package/src/providers/search-provider/index.ts +2 -0
  921. package/src/providers/search-provider/search-context.tsx +9 -0
  922. package/src/providers/search-provider/search-provider.tsx +50 -0
  923. package/src/providers/search-provider/use-search.tsx +10 -0
  924. package/src/providers/sidebar-provider/index.ts +2 -0
  925. package/src/providers/sidebar-provider/sidebar-context.tsx +9 -0
  926. package/src/providers/sidebar-provider/sidebar-provider.tsx +31 -0
  927. package/src/providers/sidebar-provider/use-sidebar.tsx +12 -0
  928. package/src/providers/theme-provider/index.ts +3 -0
  929. package/src/providers/theme-provider/theme-context.tsx +11 -0
  930. package/src/providers/theme-provider/theme-provider.tsx +84 -0
  931. package/src/providers/theme-provider/use-theme.tsx +10 -0
  932. package/src/routes/api-key-management/api-key-management-create/api-key-management-create.tsx +15 -0
  933. package/src/routes/api-key-management/api-key-management-create/components/api-key-create-form/api-key-create-form.tsx +205 -0
  934. package/src/routes/api-key-management/api-key-management-create/components/api-key-create-form/index.ts +1 -0
  935. package/src/routes/api-key-management/api-key-management-create/index.ts +1 -0
  936. package/src/routes/api-key-management/api-key-management-detail/api-key-management-detail.tsx +48 -0
  937. package/src/routes/api-key-management/api-key-management-detail/breadcrumb.tsx +24 -0
  938. package/src/routes/api-key-management/api-key-management-detail/components/api-key-general-section/api-key-general-section.tsx +249 -0
  939. package/src/routes/api-key-management/api-key-management-detail/components/api-key-general-section/index.ts +1 -0
  940. package/src/routes/api-key-management/api-key-management-detail/components/api-key-sales-channel-section/api-key-sales-channel-section.tsx +206 -0
  941. package/src/routes/api-key-management/api-key-management-detail/components/api-key-sales-channel-section/index.ts +1 -0
  942. package/src/routes/api-key-management/api-key-management-detail/index.ts +3 -0
  943. package/src/routes/api-key-management/api-key-management-detail/loader.ts +17 -0
  944. package/src/routes/api-key-management/api-key-management-edit/api-key-management-edit.tsx +34 -0
  945. package/src/routes/api-key-management/api-key-management-edit/components/edit-api-key-form/edit-api-key-form.tsx +87 -0
  946. package/src/routes/api-key-management/api-key-management-edit/components/edit-api-key-form/index.ts +1 -0
  947. package/src/routes/api-key-management/api-key-management-edit/index.ts +1 -0
  948. package/src/routes/api-key-management/api-key-management-list/api-key-management-list.tsx +25 -0
  949. package/src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/api-key-management-list-table.tsx +93 -0
  950. package/src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/api-key-row-actions.tsx +123 -0
  951. package/src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/index.ts +1 -0
  952. package/src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/use-api-key-management-table-columns.tsx +80 -0
  953. package/src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/use-api-key-management-table-filters.tsx +18 -0
  954. package/src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/use-api-key-management-table-query.tsx +34 -0
  955. package/src/routes/api-key-management/api-key-management-list/index.ts +1 -0
  956. package/src/routes/api-key-management/api-key-management-sales-channels/api-key-management-sales-channels.tsx +32 -0
  957. package/src/routes/api-key-management/api-key-management-sales-channels/components/api-key-sales-channels-form/api-key-sales-channels-form.tsx +202 -0
  958. package/src/routes/api-key-management/api-key-management-sales-channels/components/api-key-sales-channels-form/index.ts +1 -0
  959. package/src/routes/api-key-management/api-key-management-sales-channels/index.ts +1 -0
  960. package/src/routes/api-key-management/common/constants.ts +4 -0
  961. package/src/routes/api-key-management/common/utils.ts +62 -0
  962. package/src/routes/campaigns/add-campaign-promotions/add-campaign-promotions.tsx +19 -0
  963. package/src/routes/campaigns/add-campaign-promotions/components/add-campaign-promotions-form.tsx +260 -0
  964. package/src/routes/campaigns/add-campaign-promotions/components/index.ts +1 -0
  965. package/src/routes/campaigns/add-campaign-promotions/index.ts +1 -0
  966. package/src/routes/campaigns/campaign-budget-edit/campaign-budget-edit.tsx +29 -0
  967. package/src/routes/campaigns/campaign-budget-edit/components/edit-campaign-budget-form/edit-campaign-budget-form.tsx +138 -0
  968. package/src/routes/campaigns/campaign-budget-edit/components/edit-campaign-budget-form/index.ts +1 -0
  969. package/src/routes/campaigns/campaign-budget-edit/index.ts +1 -0
  970. package/src/routes/campaigns/campaign-configuration/campaign-configuration.tsx +33 -0
  971. package/src/routes/campaigns/campaign-configuration/components/campaign-configuration-form/campaign-configuration-form.tsx +134 -0
  972. package/src/routes/campaigns/campaign-configuration/components/campaign-configuration-form/index.ts +1 -0
  973. package/src/routes/campaigns/campaign-configuration/index.ts +1 -0
  974. package/src/routes/campaigns/campaign-create/campaign-create.tsx +10 -0
  975. package/src/routes/campaigns/campaign-create/components/create-campaign-form/create-campaign-form.tsx +113 -0
  976. package/src/routes/campaigns/campaign-create/components/create-campaign-form/index.ts +1 -0
  977. package/src/routes/campaigns/campaign-create/index.ts +1 -0
  978. package/src/routes/campaigns/campaign-detail/breadcrumb.tsx +29 -0
  979. package/src/routes/campaigns/campaign-detail/campaign-detail.tsx +69 -0
  980. package/src/routes/campaigns/campaign-detail/components/campaign-budget/campaign-budget.tsx +88 -0
  981. package/src/routes/campaigns/campaign-detail/components/campaign-budget/index.ts +1 -0
  982. package/src/routes/campaigns/campaign-detail/components/campaign-configuration-section/campaign-configuration-section.tsx +43 -0
  983. package/src/routes/campaigns/campaign-detail/components/campaign-configuration-section/index.ts +1 -0
  984. package/src/routes/campaigns/campaign-detail/components/campaign-general-section/campaign-general-section.tsx +137 -0
  985. package/src/routes/campaigns/campaign-detail/components/campaign-general-section/index.ts +1 -0
  986. package/src/routes/campaigns/campaign-detail/components/campaign-promotion-section/campaign-promotion-section.tsx +237 -0
  987. package/src/routes/campaigns/campaign-detail/components/campaign-promotion-section/index.ts +1 -0
  988. package/src/routes/campaigns/campaign-detail/components/campaign-spend/campaign-spend.tsx +61 -0
  989. package/src/routes/campaigns/campaign-detail/components/campaign-spend/index.ts +1 -0
  990. package/src/routes/campaigns/campaign-detail/constants.ts +1 -0
  991. package/src/routes/campaigns/campaign-detail/index.ts +3 -0
  992. package/src/routes/campaigns/campaign-detail/loader.ts +21 -0
  993. package/src/routes/campaigns/campaign-edit/campaign-edit.tsx +33 -0
  994. package/src/routes/campaigns/campaign-edit/components/edit-campaign-form/edit-campaign-form.tsx +194 -0
  995. package/src/routes/campaigns/campaign-edit/components/edit-campaign-form/index.ts +1 -0
  996. package/src/routes/campaigns/campaign-edit/index.ts +1 -0
  997. package/src/routes/campaigns/campaign-list/campaign-list.tsx +19 -0
  998. package/src/routes/campaigns/campaign-list/components/campaign-list-table.tsx +157 -0
  999. package/src/routes/campaigns/campaign-list/components/index.ts +1 -0
  1000. package/src/routes/campaigns/campaign-list/index.ts +1 -0
  1001. package/src/routes/campaigns/common/components/create-campaign-form-fields/create-campaign-form-fields.tsx +402 -0
  1002. package/src/routes/campaigns/common/components/create-campaign-form-fields/index.ts +1 -0
  1003. package/src/routes/campaigns/common/constants.ts +15 -0
  1004. package/src/routes/campaigns/common/utils/campaign-status.ts +31 -0
  1005. package/src/routes/categories/categories-metadata/categories-metadata.tsx +30 -0
  1006. package/src/routes/categories/categories-metadata/index.ts +1 -0
  1007. package/src/routes/categories/category-create/category-create.tsx +16 -0
  1008. package/src/routes/categories/category-create/components/create-category-form/create-category-details.tsx +144 -0
  1009. package/src/routes/categories/category-create/components/create-category-form/create-category-form.tsx +209 -0
  1010. package/src/routes/categories/category-create/components/create-category-form/create-category-nesting.tsx +114 -0
  1011. package/src/routes/categories/category-create/components/create-category-form/index.ts +1 -0
  1012. package/src/routes/categories/category-create/components/create-category-form/schema.ts +17 -0
  1013. package/src/routes/categories/category-create/index.ts +1 -0
  1014. package/src/routes/categories/category-detail/breadcrumb.tsx +29 -0
  1015. package/src/routes/categories/category-detail/category-detail.tsx +65 -0
  1016. package/src/routes/categories/category-detail/components/category-general-section/category-general-section.tsx +93 -0
  1017. package/src/routes/categories/category-detail/components/category-general-section/index.ts +1 -0
  1018. package/src/routes/categories/category-detail/components/category-organize-section/category-organize-section.tsx +216 -0
  1019. package/src/routes/categories/category-detail/components/category-organize-section/index.ts +1 -0
  1020. package/src/routes/categories/category-detail/components/category-product-section/category-product-section.tsx +204 -0
  1021. package/src/routes/categories/category-detail/components/category-product-section/index.ts +1 -0
  1022. package/src/routes/categories/category-detail/index.ts +3 -0
  1023. package/src/routes/categories/category-detail/loader.ts +17 -0
  1024. package/src/routes/categories/category-edit/category-edit.tsx +36 -0
  1025. package/src/routes/categories/category-edit/components/edit-category-form/edit-category-form.tsx +204 -0
  1026. package/src/routes/categories/category-edit/components/edit-category-form/index.ts +1 -0
  1027. package/src/routes/categories/category-edit/index.ts +1 -0
  1028. package/src/routes/categories/category-list/category-list.tsx +19 -0
  1029. package/src/routes/categories/category-list/components/category-list-table/category-list-table.tsx +169 -0
  1030. package/src/routes/categories/category-list/components/category-list-table/index.ts +1 -0
  1031. package/src/routes/categories/category-list/components/category-list-table/use-category-table-columns.tsx +116 -0
  1032. package/src/routes/categories/category-list/components/category-list-table/use-category-table-query.tsx +23 -0
  1033. package/src/routes/categories/category-list/index.ts +1 -0
  1034. package/src/routes/categories/category-organize/category-organize.tsx +10 -0
  1035. package/src/routes/categories/category-organize/components/organize-category-form/index.ts +1 -0
  1036. package/src/routes/categories/category-organize/components/organize-category-form/organize-category-form.tsx +131 -0
  1037. package/src/routes/categories/category-organize/index.ts +1 -0
  1038. package/src/routes/categories/category-products/category-products.tsx +30 -0
  1039. package/src/routes/categories/category-products/components/edit-category-products-form/edit-category-products-form.tsx +245 -0
  1040. package/src/routes/categories/category-products/components/edit-category-products-form/index.ts +1 -0
  1041. package/src/routes/categories/category-products/index.ts +1 -0
  1042. package/src/routes/categories/common/components/category-tree/category-tree.tsx +55 -0
  1043. package/src/routes/categories/common/components/category-tree/index.ts +1 -0
  1044. package/src/routes/categories/common/hooks/use-delete-product-category-action.tsx +49 -0
  1045. package/src/routes/categories/common/types.ts +7 -0
  1046. package/src/routes/categories/common/utils.ts +157 -0
  1047. package/src/routes/collections/collection-add-products/collection-add-products.tsx +22 -0
  1048. package/src/routes/collections/collection-add-products/components/add-products-to-collection-form/add-products-to-collection-form.tsx +259 -0
  1049. package/src/routes/collections/collection-add-products/components/add-products-to-collection-form/index.ts +1 -0
  1050. package/src/routes/collections/collection-add-products/index.ts +1 -0
  1051. package/src/routes/collections/collection-create/collection-create.tsx +10 -0
  1052. package/src/routes/collections/collection-create/components/create-collection-form/create-collection-form.tsx +120 -0
  1053. package/src/routes/collections/collection-create/components/create-collection-form/index.ts +1 -0
  1054. package/src/routes/collections/collection-create/index.ts +1 -0
  1055. package/src/routes/collections/collection-detail/breadcrumb.tsx +23 -0
  1056. package/src/routes/collections/collection-detail/collection-detail.tsx +45 -0
  1057. package/src/routes/collections/collection-detail/components/collection-general-section/collection-general-section.tsx +91 -0
  1058. package/src/routes/collections/collection-detail/components/collection-general-section/index.ts +1 -0
  1059. package/src/routes/collections/collection-detail/components/collection-product-section/collection-product-section.tsx +272 -0
  1060. package/src/routes/collections/collection-detail/components/collection-product-section/index.ts +1 -0
  1061. package/src/routes/collections/collection-detail/index.ts +3 -0
  1062. package/src/routes/collections/collection-detail/loader.ts +17 -0
  1063. package/src/routes/collections/collection-edit/collection-edit.tsx +27 -0
  1064. package/src/routes/collections/collection-edit/components/edit-collection-form/edit-collection-form.tsx +110 -0
  1065. package/src/routes/collections/collection-edit/components/edit-collection-form/index.ts +1 -0
  1066. package/src/routes/collections/collection-edit/index.ts +1 -0
  1067. package/src/routes/collections/collection-list/collection-list.tsx +18 -0
  1068. package/src/routes/collections/collection-list/components/collection-list-table/collection-list-table.tsx +99 -0
  1069. package/src/routes/collections/collection-list/components/collection-list-table/collection-row-actions.tsx +78 -0
  1070. package/src/routes/collections/collection-list/components/collection-list-table/index.ts +1 -0
  1071. package/src/routes/collections/collection-list/index.ts +1 -0
  1072. package/src/routes/collections/collection-metadata/collection-metadata.tsx +26 -0
  1073. package/src/routes/collections/collection-metadata/index.ts +1 -0
  1074. package/src/routes/customer-groups/customer-group-add-customers/components/add-customers-form/add-customers-form.tsx +245 -0
  1075. package/src/routes/customer-groups/customer-group-add-customers/components/add-customers-form/index.ts +1 -0
  1076. package/src/routes/customer-groups/customer-group-add-customers/customer-group-add-customers.tsx +13 -0
  1077. package/src/routes/customer-groups/customer-group-add-customers/index.ts +1 -0
  1078. package/src/routes/customer-groups/customer-group-create/components/create-customer-group-form/create-customer-group-form.tsx +110 -0
  1079. package/src/routes/customer-groups/customer-group-create/components/create-customer-group-form/index.ts +1 -0
  1080. package/src/routes/customer-groups/customer-group-create/customer-group-create.tsx +10 -0
  1081. package/src/routes/customer-groups/customer-group-create/index.ts +1 -0
  1082. package/src/routes/customer-groups/customer-group-detail/breadcrumb.tsx +31 -0
  1083. package/src/routes/customer-groups/customer-group-detail/components/customer-group-customer-section/customer-group-customer-section.tsx +243 -0
  1084. package/src/routes/customer-groups/customer-group-detail/components/customer-group-customer-section/index.ts +1 -0
  1085. package/src/routes/customer-groups/customer-group-detail/components/customer-group-general-section/customer-group-general-section.tsx +90 -0
  1086. package/src/routes/customer-groups/customer-group-detail/components/customer-group-general-section/index.ts +1 -0
  1087. package/src/routes/customer-groups/customer-group-detail/constants.ts +1 -0
  1088. package/src/routes/customer-groups/customer-group-detail/customer-group-detail.tsx +51 -0
  1089. package/src/routes/customer-groups/customer-group-detail/index.ts +3 -0
  1090. package/src/routes/customer-groups/customer-group-detail/loader.ts +20 -0
  1091. package/src/routes/customer-groups/customer-group-edit/components/edit-customer-group-form/edit-customer-group-form.tsx +90 -0
  1092. package/src/routes/customer-groups/customer-group-edit/components/edit-customer-group-form/index.ts +1 -0
  1093. package/src/routes/customer-groups/customer-group-edit/customer-group-edit.tsx +28 -0
  1094. package/src/routes/customer-groups/customer-group-edit/index.ts +1 -0
  1095. package/src/routes/customer-groups/customer-group-list/components/customer-group-list-table/customer-group-list-table.tsx +223 -0
  1096. package/src/routes/customer-groups/customer-group-list/components/customer-group-list-table/index.ts +1 -0
  1097. package/src/routes/customer-groups/customer-group-list/customer-group-list.tsx +18 -0
  1098. package/src/routes/customer-groups/customer-group-list/index.ts +1 -0
  1099. package/src/routes/customer-groups/customer-group-metadata/customer-metadata.tsx +26 -0
  1100. package/src/routes/customer-groups/customer-group-metadata/index.ts +1 -0
  1101. package/src/routes/customers/customer-create/components/create-customer-form/create-customer-form.tsx +179 -0
  1102. package/src/routes/customers/customer-create/components/create-customer-form/index.ts +1 -0
  1103. package/src/routes/customers/customer-create/customer-create.tsx +10 -0
  1104. package/src/routes/customers/customer-create/index.ts +1 -0
  1105. package/src/routes/customers/customer-create-address/components/create-customer-address-form/create-customer-address-form.tsx +282 -0
  1106. package/src/routes/customers/customer-create-address/components/create-customer-address-form/index.ts +1 -0
  1107. package/src/routes/customers/customer-create-address/customer-create-address.tsx +10 -0
  1108. package/src/routes/customers/customer-create-address/index.ts +1 -0
  1109. package/src/routes/customers/customer-detail/breadcrumb.tsx +29 -0
  1110. package/src/routes/customers/customer-detail/components/customer-address-section/customer-address-section.tsx +104 -0
  1111. package/src/routes/customers/customer-detail/components/customer-address-section/index.ts +1 -0
  1112. package/src/routes/customers/customer-detail/components/customer-general-section/customer-general-section.tsx +127 -0
  1113. package/src/routes/customers/customer-detail/components/customer-general-section/index.ts +1 -0
  1114. package/src/routes/customers/customer-detail/components/customer-group-section/customer-group-section.tsx +269 -0
  1115. package/src/routes/customers/customer-detail/components/customer-group-section/index.ts +1 -0
  1116. package/src/routes/customers/customer-detail/components/customer-order-section/customer-order-section.tsx +130 -0
  1117. package/src/routes/customers/customer-detail/components/customer-order-section/index.ts +1 -0
  1118. package/src/routes/customers/customer-detail/customer-detail.tsx +58 -0
  1119. package/src/routes/customers/customer-detail/index.ts +3 -0
  1120. package/src/routes/customers/customer-detail/loader.ts +19 -0
  1121. package/src/routes/customers/customer-edit/components/edit-customer-form/edit-customer-form.tsx +178 -0
  1122. package/src/routes/customers/customer-edit/components/edit-customer-form/index.ts +1 -0
  1123. package/src/routes/customers/customer-edit/customer-edit.tsx +26 -0
  1124. package/src/routes/customers/customer-edit/index.ts +1 -0
  1125. package/src/routes/customers/customer-list/components/customer-list-table/customer-list-table.tsx +124 -0
  1126. package/src/routes/customers/customer-list/components/customer-list-table/index.ts +1 -0
  1127. package/src/routes/customers/customer-list/customer-list.tsx +18 -0
  1128. package/src/routes/customers/customer-list/index.ts +1 -0
  1129. package/src/routes/customers/customer-metadata/customer-metadata.tsx +23 -0
  1130. package/src/routes/customers/customer-metadata/index.ts +1 -0
  1131. package/src/routes/customers/customers-add-customer-group/components/add-customers-form/add-customer-groups-form.tsx +257 -0
  1132. package/src/routes/customers/customers-add-customer-group/components/add-customers-form/index.ts +1 -0
  1133. package/src/routes/customers/customers-add-customer-group/customer-add-customer-groups.tsx +13 -0
  1134. package/src/routes/customers/customers-add-customer-group/index.ts +1 -0
  1135. package/src/routes/home/home.tsx +12 -0
  1136. package/src/routes/home/index.ts +1 -0
  1137. package/src/routes/inventory/common/constants.ts +1 -0
  1138. package/src/routes/inventory/inventory-create/components/inventory-create-form/index.ts +1 -0
  1139. package/src/routes/inventory/inventory-create/components/inventory-create-form/inventory-availability-form.tsx +78 -0
  1140. package/src/routes/inventory/inventory-create/components/inventory-create-form/inventory-create-form.tsx +517 -0
  1141. package/src/routes/inventory/inventory-create/components/inventory-create-form/schema.ts +23 -0
  1142. package/src/routes/inventory/inventory-create/index.ts +1 -0
  1143. package/src/routes/inventory/inventory-create/inventory-create.tsx +21 -0
  1144. package/src/routes/inventory/inventory-detail/breadcrumb.tsx +31 -0
  1145. package/src/routes/inventory/inventory-detail/components/adjust-inventory/adjust-inventory-drawer.tsx +55 -0
  1146. package/src/routes/inventory/inventory-detail/components/adjust-inventory/components/adjust-inventory-form.tsx +178 -0
  1147. package/src/routes/inventory/inventory-detail/components/adjust-inventory/index.ts +1 -0
  1148. package/src/routes/inventory/inventory-detail/components/edit-inventory-item/components/edit-item-form.tsx +105 -0
  1149. package/src/routes/inventory/inventory-detail/components/edit-inventory-item/edit-item-drawer.tsx +33 -0
  1150. package/src/routes/inventory/inventory-detail/components/edit-inventory-item/index.ts +1 -0
  1151. package/src/routes/inventory/inventory-detail/components/edit-inventory-item-attributes/components/edit-item-attributes-form.tsx +270 -0
  1152. package/src/routes/inventory/inventory-detail/components/edit-inventory-item-attributes/edit-item-attributes-drawer.tsx +33 -0
  1153. package/src/routes/inventory/inventory-detail/components/edit-inventory-item-attributes/index.ts +1 -0
  1154. package/src/routes/inventory/inventory-detail/components/inventory-item-attributes/attributes-section.tsx +50 -0
  1155. package/src/routes/inventory/inventory-detail/components/inventory-item-general-section.tsx +65 -0
  1156. package/src/routes/inventory/inventory-detail/components/inventory-item-location-levels.tsx +26 -0
  1157. package/src/routes/inventory/inventory-detail/components/inventory-item-reservations.tsx +28 -0
  1158. package/src/routes/inventory/inventory-detail/components/inventory-item-variants/variants-section.tsx +72 -0
  1159. package/src/routes/inventory/inventory-detail/components/location-levels-table/location-list-table.tsx +49 -0
  1160. package/src/routes/inventory/inventory-detail/components/location-levels-table/use-location-list-table-columns.tsx +170 -0
  1161. package/src/routes/inventory/inventory-detail/components/location-levels-table/use-location-list-table-query.tsx +32 -0
  1162. package/src/routes/inventory/inventory-detail/components/manage-locations/components/location-item.tsx +51 -0
  1163. package/src/routes/inventory/inventory-detail/components/manage-locations/components/location-search-input.tsx +34 -0
  1164. package/src/routes/inventory/inventory-detail/components/manage-locations/components/manage-locations-form.tsx +183 -0
  1165. package/src/routes/inventory/inventory-detail/components/manage-locations/index.ts +1 -0
  1166. package/src/routes/inventory/inventory-detail/components/manage-locations/manage-locations-drawer.tsx +40 -0
  1167. package/src/routes/inventory/inventory-detail/components/reservations-table/reservation-actions.tsx +64 -0
  1168. package/src/routes/inventory/inventory-detail/components/reservations-table/reservation-list-table.tsx +70 -0
  1169. package/src/routes/inventory/inventory-detail/components/reservations-table/use-reservation-list-table-columns.tsx +93 -0
  1170. package/src/routes/inventory/inventory-detail/components/reservations-table/use-reservation-list-table-query.tsx +35 -0
  1171. package/src/routes/inventory/inventory-detail/constants.ts +2 -0
  1172. package/src/routes/inventory/inventory-detail/index.ts +3 -0
  1173. package/src/routes/inventory/inventory-detail/inventory-detail.tsx +80 -0
  1174. package/src/routes/inventory/inventory-detail/loader.ts +21 -0
  1175. package/src/routes/inventory/inventory-list/components/inventory-actions.tsx +53 -0
  1176. package/src/routes/inventory/inventory-list/components/inventory-list-table.tsx +105 -0
  1177. package/src/routes/inventory/inventory-list/components/use-inventory-table-columns.tsx +125 -0
  1178. package/src/routes/inventory/inventory-list/components/use-inventory-table-filters.tsx +82 -0
  1179. package/src/routes/inventory/inventory-list/components/use-inventory-table-query.tsx +70 -0
  1180. package/src/routes/inventory/inventory-list/index.ts +1 -0
  1181. package/src/routes/inventory/inventory-list/inventory-list.tsx +18 -0
  1182. package/src/routes/inventory/inventory-metadata/index.ts +1 -0
  1183. package/src/routes/inventory/inventory-metadata/inventory-metadata.tsx +27 -0
  1184. package/src/routes/inventory/inventory-stock/components/inventory-stock-form/index.ts +1 -0
  1185. package/src/routes/inventory/inventory-stock/components/inventory-stock-form/inventory-stock-form.tsx +164 -0
  1186. package/src/routes/inventory/inventory-stock/hooks/use-inventory-stock-columns.tsx +76 -0
  1187. package/src/routes/inventory/inventory-stock/index.ts +1 -0
  1188. package/src/routes/inventory/inventory-stock/inventory-stock.tsx +58 -0
  1189. package/src/routes/inventory/inventory-stock/schema.ts +22 -0
  1190. package/src/routes/invite/index.ts +1 -0
  1191. package/src/routes/invite/invite.tsx +416 -0
  1192. package/src/routes/locations/common/components/conditional-price-form/conditional-price-form.tsx +713 -0
  1193. package/src/routes/locations/common/components/conditional-price-form/index.ts +1 -0
  1194. package/src/routes/locations/common/components/geo-zone-form/geo-zone-form.tsx +327 -0
  1195. package/src/routes/locations/common/components/geo-zone-form/index.ts +1 -0
  1196. package/src/routes/locations/common/components/shipping-option-price-cell/index.ts +1 -0
  1197. package/src/routes/locations/common/components/shipping-option-price-cell/shipping-option-price-cell.tsx +261 -0
  1198. package/src/routes/locations/common/components/shipping-option-price-provider/index.ts +2 -0
  1199. package/src/routes/locations/common/components/shipping-option-price-provider/shipping-option-price-context.tsx +10 -0
  1200. package/src/routes/locations/common/components/shipping-option-price-provider/shipping-option-price-provider.tsx +23 -0
  1201. package/src/routes/locations/common/components/shipping-option-price-provider/use-shipping-option-price.tsx +14 -0
  1202. package/src/routes/locations/common/constants.ts +16 -0
  1203. package/src/routes/locations/common/hooks/use-shipping-option-price-columns.tsx +174 -0
  1204. package/src/routes/locations/common/schema.ts +192 -0
  1205. package/src/routes/locations/common/types.ts +12 -0
  1206. package/src/routes/locations/common/utils/get-custom-shipping-option-price-field-info.ts +19 -0
  1207. package/src/routes/locations/common/utils/price-rule-helpers.ts +41 -0
  1208. package/src/routes/locations/location-create/components/create-location-form/create-location-form.tsx +248 -0
  1209. package/src/routes/locations/location-create/components/create-location-form/index.ts +1 -0
  1210. package/src/routes/locations/location-create/index.ts +1 -0
  1211. package/src/routes/locations/location-create/location-create.tsx +10 -0
  1212. package/src/routes/locations/location-detail/breadcrumb.tsx +31 -0
  1213. package/src/routes/locations/location-detail/components/location-fulfillment-providers-section/index.ts +1 -0
  1214. package/src/routes/locations/location-detail/components/location-fulfillment-providers-section/location-fulfillment-providers-section.tsx +81 -0
  1215. package/src/routes/locations/location-detail/components/location-general-section/index.ts +1 -0
  1216. package/src/routes/locations/location-detail/components/location-general-section/location-general-section.tsx +661 -0
  1217. package/src/routes/locations/location-detail/components/location-sales-channels-section/index.ts +1 -0
  1218. package/src/routes/locations/location-detail/components/location-sales-channels-section/locations-sales-channels-section.tsx +76 -0
  1219. package/src/routes/locations/location-detail/constants.ts +2 -0
  1220. package/src/routes/locations/location-detail/index.ts +3 -0
  1221. package/src/routes/locations/location-detail/loader.ts +23 -0
  1222. package/src/routes/locations/location-detail/location-detail.tsx +64 -0
  1223. package/src/routes/locations/location-edit/components/edit-location-form/edit-location-form.tsx +234 -0
  1224. package/src/routes/locations/location-edit/components/edit-location-form/index.ts +1 -0
  1225. package/src/routes/locations/location-edit/index.ts +1 -0
  1226. package/src/routes/locations/location-edit/location-edit.tsx +33 -0
  1227. package/src/routes/locations/location-fulfillment-providers/components/edit-fulfillment-providers-form/edit-fulfillment-providers-form.tsx +207 -0
  1228. package/src/routes/locations/location-fulfillment-providers/components/edit-fulfillment-providers-form/index.ts +1 -0
  1229. package/src/routes/locations/location-fulfillment-providers/index.ts +1 -0
  1230. package/src/routes/locations/location-fulfillment-providers/location-fulfillment-providers.tsx +27 -0
  1231. package/src/routes/locations/location-list/components/location-list-item/index.ts +1 -0
  1232. package/src/routes/locations/location-list/components/location-list-item/location-list-item.tsx +186 -0
  1233. package/src/routes/locations/location-list/constants.ts +3 -0
  1234. package/src/routes/locations/location-list/index.ts +1 -0
  1235. package/src/routes/locations/location-list/location-list.tsx +128 -0
  1236. package/src/routes/locations/location-list/use-location-list-table-columns.tsx +185 -0
  1237. package/src/routes/locations/location-list/use-location-list-table-query.tsx +22 -0
  1238. package/src/routes/locations/location-sales-channels/components/edit-sales-channels-form/edit-sales-channels-form.tsx +177 -0
  1239. package/src/routes/locations/location-sales-channels/components/edit-sales-channels-form/index.ts +1 -0
  1240. package/src/routes/locations/location-sales-channels/index.ts +1 -0
  1241. package/src/routes/locations/location-sales-channels/location-sales-channels.tsx +27 -0
  1242. package/src/routes/locations/location-service-zone-create/components/create-service-zone-form/create-service-zone-form.tsx +146 -0
  1243. package/src/routes/locations/location-service-zone-create/components/create-service-zone-form/index.ts +1 -0
  1244. package/src/routes/locations/location-service-zone-create/index.ts +1 -0
  1245. package/src/routes/locations/location-service-zone-create/location-service-zone-create.tsx +47 -0
  1246. package/src/routes/locations/location-service-zone-edit/components/edit-region-form/edit-service-zone-form.tsx +105 -0
  1247. package/src/routes/locations/location-service-zone-edit/components/edit-region-form/index.ts +1 -0
  1248. package/src/routes/locations/location-service-zone-edit/index.ts +1 -0
  1249. package/src/routes/locations/location-service-zone-edit/location-service-zone-edit.tsx +47 -0
  1250. package/src/routes/locations/location-service-zone-manage-areas/components/edit-region-areas-form/edit-service-zone-areas-form.tsx +120 -0
  1251. package/src/routes/locations/location-service-zone-manage-areas/components/edit-region-areas-form/index.ts +1 -0
  1252. package/src/routes/locations/location-service-zone-manage-areas/index.ts +1 -0
  1253. package/src/routes/locations/location-service-zone-manage-areas/location-service-zone-manage-areas.tsx +41 -0
  1254. package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/create-shipping-option-details-form.tsx +297 -0
  1255. package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/create-shipping-options-form.tsx +359 -0
  1256. package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/create-shipping-options-prices-form.tsx +145 -0
  1257. package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/index.ts +1 -0
  1258. package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/schema.ts +44 -0
  1259. package/src/routes/locations/location-service-zone-shipping-option-create/constants.ts +2 -0
  1260. package/src/routes/locations/location-service-zone-shipping-option-create/index.ts +1 -0
  1261. package/src/routes/locations/location-service-zone-shipping-option-create/location-service-zone-shipping-option-create.tsx +55 -0
  1262. package/src/routes/locations/location-service-zone-shipping-option-edit/components/edit-region-form/edit-shipping-option-form.tsx +314 -0
  1263. package/src/routes/locations/location-service-zone-shipping-option-edit/components/edit-region-form/index.ts +1 -0
  1264. package/src/routes/locations/location-service-zone-shipping-option-edit/index.ts +1 -0
  1265. package/src/routes/locations/location-service-zone-shipping-option-edit/location-service-zone-shipping-option-edit.tsx +59 -0
  1266. package/src/routes/locations/location-service-zone-shipping-option-pricing/components/create-shipping-options-form/edit-shipping-options-pricing-form.tsx +384 -0
  1267. package/src/routes/locations/location-service-zone-shipping-option-pricing/components/create-shipping-options-form/index.ts +1 -0
  1268. package/src/routes/locations/location-service-zone-shipping-option-pricing/index.ts +1 -0
  1269. package/src/routes/locations/location-service-zone-shipping-option-pricing/location-service-zone-shipping-option-pricing.tsx +36 -0
  1270. package/src/routes/login/components/cloud-auth-login.tsx +166 -0
  1271. package/src/routes/login/index.ts +1 -0
  1272. package/src/routes/login/login.tsx +175 -0
  1273. package/src/routes/no-match/index.ts +1 -0
  1274. package/src/routes/no-match/no-match.tsx +36 -0
  1275. package/src/routes/orders/common/placeholders.tsx +48 -0
  1276. package/src/routes/orders/order-allocate-items/components/order-create-fulfillment-form/constants.ts +6 -0
  1277. package/src/routes/orders/order-allocate-items/components/order-create-fulfillment-form/index.ts +1 -0
  1278. package/src/routes/orders/order-allocate-items/components/order-create-fulfillment-form/order-allocate-items-form.tsx +349 -0
  1279. package/src/routes/orders/order-allocate-items/components/order-create-fulfillment-form/order-allocate-items-item.tsx +346 -0
  1280. package/src/routes/orders/order-allocate-items/components/order-create-fulfillment-form/utils.ts +28 -0
  1281. package/src/routes/orders/order-allocate-items/index.ts +1 -0
  1282. package/src/routes/orders/order-allocate-items/order-allocate-items.tsx +26 -0
  1283. package/src/routes/orders/order-balance-settlement/components/order-balance-settlement-form/index.ts +1 -0
  1284. package/src/routes/orders/order-balance-settlement/components/order-balance-settlement-form/order-balance-settlement-form.tsx +396 -0
  1285. package/src/routes/orders/order-balance-settlement/index.ts +1 -0
  1286. package/src/routes/orders/order-create-claim/claim-create.tsx +84 -0
  1287. package/src/routes/orders/order-create-claim/components/add-claim-items-table/add-claim-items-table.tsx +283 -0
  1288. package/src/routes/orders/order-create-claim/components/add-claim-items-table/index.ts +1 -0
  1289. package/src/routes/orders/order-create-claim/components/add-claim-items-table/use-claim-item-table-columns.tsx +103 -0
  1290. package/src/routes/orders/order-create-claim/components/add-claim-items-table/use-claim-item-table-filters.tsx +32 -0
  1291. package/src/routes/orders/order-create-claim/components/add-claim-items-table/use-claim-item-table-query.tsx +61 -0
  1292. package/src/routes/orders/order-create-claim/components/add-claim-outbound-items-table/add-claim-outbound-items-table.tsx +94 -0
  1293. package/src/routes/orders/order-create-claim/components/add-claim-outbound-items-table/index.ts +1 -0
  1294. package/src/routes/orders/order-create-claim/components/add-claim-outbound-items-table/use-claim-outbound-item-table-columns.tsx +68 -0
  1295. package/src/routes/orders/order-create-claim/components/add-claim-outbound-items-table/use-claim-outbound-item-table-filters.tsx +22 -0
  1296. package/src/routes/orders/order-create-claim/components/add-claim-outbound-items-table/use-claim-outbound-item-table-query.tsx +40 -0
  1297. package/src/routes/orders/order-create-claim/components/claim-create-form/claim-create-form.tsx +1092 -0
  1298. package/src/routes/orders/order-create-claim/components/claim-create-form/claim-inbound-item.tsx +244 -0
  1299. package/src/routes/orders/order-create-claim/components/claim-create-form/claim-outbound-item.tsx +121 -0
  1300. package/src/routes/orders/order-create-claim/components/claim-create-form/claim-outbound-section.tsx +442 -0
  1301. package/src/routes/orders/order-create-claim/components/claim-create-form/index.ts +1 -0
  1302. package/src/routes/orders/order-create-claim/components/claim-create-form/item-placeholder.tsx +11 -0
  1303. package/src/routes/orders/order-create-claim/components/claim-create-form/schema.ts +24 -0
  1304. package/src/routes/orders/order-create-claim/index.ts +1 -0
  1305. package/src/routes/orders/order-create-edit/components/add-order-edit-items-table/add-order-edit-items-table.tsx +87 -0
  1306. package/src/routes/orders/order-create-edit/components/add-order-edit-items-table/index.ts +1 -0
  1307. package/src/routes/orders/order-create-edit/components/add-order-edit-items-table/use-order-edit-item-table-columns.tsx +68 -0
  1308. package/src/routes/orders/order-create-edit/components/add-order-edit-items-table/use-order-edit-item-table-filters.tsx +22 -0
  1309. package/src/routes/orders/order-create-edit/components/add-order-edit-items-table/use-order-edit-item-table-query.tsx +26 -0
  1310. package/src/routes/orders/order-create-edit/components/order-edit-create-form/index.ts +1 -0
  1311. package/src/routes/orders/order-create-edit/components/order-edit-create-form/order-edit-create-form.tsx +231 -0
  1312. package/src/routes/orders/order-create-edit/components/order-edit-create-form/order-edit-item.tsx +257 -0
  1313. package/src/routes/orders/order-create-edit/components/order-edit-create-form/order-edit-items-section.tsx +145 -0
  1314. package/src/routes/orders/order-create-edit/components/order-edit-create-form/schema.ts +8 -0
  1315. package/src/routes/orders/order-create-edit/index.ts +1 -0
  1316. package/src/routes/orders/order-create-edit/order-edit-create.tsx +65 -0
  1317. package/src/routes/orders/order-create-exchange/components/add-exchange-inbound-items-table/add-exchange-inbound-items-table.tsx +193 -0
  1318. package/src/routes/orders/order-create-exchange/components/add-exchange-inbound-items-table/index.ts +1 -0
  1319. package/src/routes/orders/order-create-exchange/components/add-exchange-inbound-items-table/use-exchange-item-table-columns.tsx +103 -0
  1320. package/src/routes/orders/order-create-exchange/components/add-exchange-inbound-items-table/use-exchange-item-table-filters.tsx +22 -0
  1321. package/src/routes/orders/order-create-exchange/components/add-exchange-inbound-items-table/use-exchange-item-table-query.tsx +26 -0
  1322. package/src/routes/orders/order-create-exchange/components/add-exchange-outbound-items-table/add-exchange-outbound-items-table.tsx +94 -0
  1323. package/src/routes/orders/order-create-exchange/components/add-exchange-outbound-items-table/index.ts +1 -0
  1324. package/src/routes/orders/order-create-exchange/components/add-exchange-outbound-items-table/use-exchange-outbound-item-table-columns.tsx +68 -0
  1325. package/src/routes/orders/order-create-exchange/components/add-exchange-outbound-items-table/use-exchange-outbound-item-table-filters.tsx +22 -0
  1326. package/src/routes/orders/order-create-exchange/components/add-exchange-outbound-items-table/use-exchange-outbound-item-table-query.tsx +26 -0
  1327. package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-create-form.tsx +652 -0
  1328. package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-inbound-item.tsx +269 -0
  1329. package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-inbound-section.tsx +546 -0
  1330. package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-outbound-item.tsx +140 -0
  1331. package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-outbound-section.tsx +450 -0
  1332. package/src/routes/orders/order-create-exchange/components/exchange-create-form/index.ts +1 -0
  1333. package/src/routes/orders/order-create-exchange/components/exchange-create-form/schema.ts +25 -0
  1334. package/src/routes/orders/order-create-exchange/exchange-create.tsx +84 -0
  1335. package/src/routes/orders/order-create-exchange/index.ts +1 -0
  1336. package/src/routes/orders/order-create-fulfillment/components/order-create-fulfillment-form/constants.ts +8 -0
  1337. package/src/routes/orders/order-create-fulfillment/components/order-create-fulfillment-form/index.ts +1 -0
  1338. package/src/routes/orders/order-create-fulfillment/components/order-create-fulfillment-form/order-create-fulfillment-form.tsx +437 -0
  1339. package/src/routes/orders/order-create-fulfillment/components/order-create-fulfillment-form/order-create-fulfillment-item.tsx +250 -0
  1340. package/src/routes/orders/order-create-fulfillment/index.ts +1 -0
  1341. package/src/routes/orders/order-create-fulfillment/order-create-fulfillments.tsx +33 -0
  1342. package/src/routes/orders/order-create-refund/components/create-refund-form/create-refund-form.tsx +306 -0
  1343. package/src/routes/orders/order-create-refund/components/create-refund-form/index.ts +1 -0
  1344. package/src/routes/orders/order-create-refund/index.ts +1 -0
  1345. package/src/routes/orders/order-create-refund/order-create-refund.tsx +31 -0
  1346. package/src/routes/orders/order-create-return/components/add-return-items-table/add-return-items-table.tsx +284 -0
  1347. package/src/routes/orders/order-create-return/components/add-return-items-table/index.ts +1 -0
  1348. package/src/routes/orders/order-create-return/components/add-return-items-table/use-return-item-table-columns.tsx +103 -0
  1349. package/src/routes/orders/order-create-return/components/add-return-items-table/use-return-item-table-filters.tsx +32 -0
  1350. package/src/routes/orders/order-create-return/components/add-return-items-table/use-return-item-table-query.tsx +61 -0
  1351. package/src/routes/orders/order-create-return/components/return-create-form/index.ts +1 -0
  1352. package/src/routes/orders/order-create-return/components/return-create-form/return-create-form.tsx +785 -0
  1353. package/src/routes/orders/order-create-return/components/return-create-form/return-item.tsx +246 -0
  1354. package/src/routes/orders/order-create-return/components/return-create-form/schema.ts +19 -0
  1355. package/src/routes/orders/order-create-return/index.ts +1 -0
  1356. package/src/routes/orders/order-create-return/return-create.tsx +80 -0
  1357. package/src/routes/orders/order-create-shipment/components/order-create-shipment-form/constants.ts +13 -0
  1358. package/src/routes/orders/order-create-shipment/components/order-create-shipment-form/index.ts +1 -0
  1359. package/src/routes/orders/order-create-shipment/components/order-create-shipment-form/order-create-shipment-form.tsx +234 -0
  1360. package/src/routes/orders/order-create-shipment/index.ts +1 -0
  1361. package/src/routes/orders/order-create-shipment/order-create-shipment.tsx +30 -0
  1362. package/src/routes/orders/order-detail/breadcrumb.tsx +27 -0
  1363. package/src/routes/orders/order-detail/components/active-order-claim-section/active-order-claim-section.tsx +79 -0
  1364. package/src/routes/orders/order-detail/components/active-order-claim-section/index.ts +1 -0
  1365. package/src/routes/orders/order-detail/components/active-order-exchange-section/active-order-exchange-section.tsx +83 -0
  1366. package/src/routes/orders/order-detail/components/active-order-exchange-section/index.ts +1 -0
  1367. package/src/routes/orders/order-detail/components/active-order-return-section/active-order-return-section.tsx +82 -0
  1368. package/src/routes/orders/order-detail/components/active-order-return-section/index.ts +1 -0
  1369. package/src/routes/orders/order-detail/components/copy-payment-link/copy-payment-link.tsx +80 -0
  1370. package/src/routes/orders/order-detail/components/copy-payment-link/index.ts +1 -0
  1371. package/src/routes/orders/order-detail/components/order-active-edit-section/index.ts +1 -0
  1372. package/src/routes/orders/order-detail/components/order-active-edit-section/order-active-edit-section.tsx +199 -0
  1373. package/src/routes/orders/order-detail/components/order-activity-section/activity-items.tsx +125 -0
  1374. package/src/routes/orders/order-detail/components/order-activity-section/change-details-tooltip.tsx +74 -0
  1375. package/src/routes/orders/order-detail/components/order-activity-section/index.ts +1 -0
  1376. package/src/routes/orders/order-detail/components/order-activity-section/order-activity-section.tsx +25 -0
  1377. package/src/routes/orders/order-detail/components/order-activity-section/order-note-form.tsx +112 -0
  1378. package/src/routes/orders/order-detail/components/order-activity-section/order-timeline.tsx +1121 -0
  1379. package/src/routes/orders/order-detail/components/order-customer-section/index.ts +1 -0
  1380. package/src/routes/orders/order-detail/components/order-customer-section/order-customer-section.tsx +68 -0
  1381. package/src/routes/orders/order-detail/components/order-fulfillment-section/index.ts +1 -0
  1382. package/src/routes/orders/order-detail/components/order-fulfillment-section/order-fulfillment-section.tsx +489 -0
  1383. package/src/routes/orders/order-detail/components/order-general-section/index.ts +1 -0
  1384. package/src/routes/orders/order-detail/components/order-general-section/order-general-section.tsx +136 -0
  1385. package/src/routes/orders/order-detail/components/order-payment-section/index.ts +1 -0
  1386. package/src/routes/orders/order-detail/components/order-payment-section/order-payment-section.tsx +465 -0
  1387. package/src/routes/orders/order-detail/components/order-summary-section/index.ts +1 -0
  1388. package/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx +1270 -0
  1389. package/src/routes/orders/order-detail/components/order-summary-section/return-info-popover.tsx +90 -0
  1390. package/src/routes/orders/order-detail/components/order-summary-section/shipping-info-popover.tsx +48 -0
  1391. package/src/routes/orders/order-detail/constants.ts +64 -0
  1392. package/src/routes/orders/order-detail/index.ts +3 -0
  1393. package/src/routes/orders/order-detail/loader.ts +21 -0
  1394. package/src/routes/orders/order-detail/order-detail.tsx +96 -0
  1395. package/src/routes/orders/order-edit-billing-address/components/edit-order-billing-address-form/edit-order-billing-address-form.tsx +250 -0
  1396. package/src/routes/orders/order-edit-billing-address/components/edit-order-billing-address-form/index.ts +1 -0
  1397. package/src/routes/orders/order-edit-billing-address/index.ts +1 -0
  1398. package/src/routes/orders/order-edit-billing-address/order-edit-billing-address.tsx +31 -0
  1399. package/src/routes/orders/order-edit-email/components/edit-order-email-form/edit-order-email-form.tsx +95 -0
  1400. package/src/routes/orders/order-edit-email/components/edit-order-email-form/index.ts +1 -0
  1401. package/src/routes/orders/order-edit-email/index.ts +1 -0
  1402. package/src/routes/orders/order-edit-email/order-edit-email.tsx +31 -0
  1403. package/src/routes/orders/order-edit-shipping-address/components/edit-order-shipping-address-form/edit-order-shipping-address-form.tsx +247 -0
  1404. package/src/routes/orders/order-edit-shipping-address/components/edit-order-shipping-address-form/index.ts +1 -0
  1405. package/src/routes/orders/order-edit-shipping-address/index.ts +1 -0
  1406. package/src/routes/orders/order-edit-shipping-address/order-edit-shipping-address.tsx +31 -0
  1407. package/src/routes/orders/order-export/components/export-filters.tsx +22 -0
  1408. package/src/routes/orders/order-export/index.ts +1 -0
  1409. package/src/routes/orders/order-export/order-export.tsx +66 -0
  1410. package/src/routes/orders/order-list/components/order-list-table/components/save-view-dropdown.tsx +81 -0
  1411. package/src/routes/orders/order-list/components/order-list-table/configurable-order-list-table.tsx +24 -0
  1412. package/src/routes/orders/order-list/components/order-list-table/constants.ts +14 -0
  1413. package/src/routes/orders/order-list/components/order-list-table/hooks/use-order-data-table-columns.tsx +153 -0
  1414. package/src/routes/orders/order-list/components/order-list-table/index.ts +1 -0
  1415. package/src/routes/orders/order-list/components/order-list-table/order-list-table.tsx +89 -0
  1416. package/src/routes/orders/order-list/components/order-list-table/order-table-adapter.tsx +68 -0
  1417. package/src/routes/orders/order-list/components/order-list-table/use-order-table-filters.tsx +72 -0
  1418. package/src/routes/orders/order-list/const.ts +18 -0
  1419. package/src/routes/orders/order-list/index.ts +1 -0
  1420. package/src/routes/orders/order-list/order-list.tsx +20 -0
  1421. package/src/routes/orders/order-metadata/index.ts +1 -0
  1422. package/src/routes/orders/order-metadata/order-metadata.tsx +26 -0
  1423. package/src/routes/orders/order-receive-return/components/order-receive-return-form/constants.ts +12 -0
  1424. package/src/routes/orders/order-receive-return/components/order-receive-return-form/dismissed-quantity.tsx +167 -0
  1425. package/src/routes/orders/order-receive-return/components/order-receive-return-form/index.ts +1 -0
  1426. package/src/routes/orders/order-receive-return/components/order-receive-return-form/order-receive-return-form.tsx +386 -0
  1427. package/src/routes/orders/order-receive-return/index.ts +1 -0
  1428. package/src/routes/orders/order-receive-return/order-receive-return.tsx +96 -0
  1429. package/src/routes/orders/order-request-transfer/components/create-order-transfer-form/create-order-transfer-form.tsx +152 -0
  1430. package/src/routes/orders/order-request-transfer/components/create-order-transfer-form/index.ts +1 -0
  1431. package/src/routes/orders/order-request-transfer/components/create-order-transfer-form/transfer-header.tsx +299 -0
  1432. package/src/routes/orders/order-request-transfer/index.ts +1 -0
  1433. package/src/routes/orders/order-request-transfer/order-request-transfer.tsx +34 -0
  1434. package/src/routes/price-lists/common/components/price-list-customer-group-rule-form/index.ts +1 -0
  1435. package/src/routes/price-lists/common/components/price-list-customer-group-rule-form/price-list-customer-group-rule-form.tsx +194 -0
  1436. package/src/routes/price-lists/common/constants.ts +20 -0
  1437. package/src/routes/price-lists/common/hooks/use-delete-price-list-action.tsx +50 -0
  1438. package/src/routes/price-lists/common/hooks/use-price-list-currency-data.tsx +79 -0
  1439. package/src/routes/price-lists/common/hooks/use-price-list-grid-columns.tsx +91 -0
  1440. package/src/routes/price-lists/common/schemas.ts +96 -0
  1441. package/src/routes/price-lists/common/utils.ts +123 -0
  1442. package/src/routes/price-lists/price-list-configuration/components/price-list-configuration-form/index.ts +1 -0
  1443. package/src/routes/price-lists/price-list-configuration/components/price-list-configuration-form/price-list-configuration-form.tsx +311 -0
  1444. package/src/routes/price-lists/price-list-configuration/index.ts +1 -0
  1445. package/src/routes/price-lists/price-list-configuration/price-list-configuration.tsx +68 -0
  1446. package/src/routes/price-lists/price-list-create/components/price-list-create-form/index.ts +1 -0
  1447. package/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-create-form.tsx +364 -0
  1448. package/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-details-form.tsx +331 -0
  1449. package/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-prices-form.tsx +96 -0
  1450. package/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-products-form.tsx +187 -0
  1451. package/src/routes/price-lists/price-list-create/components/price-list-create-form/schema.ts +59 -0
  1452. package/src/routes/price-lists/price-list-create/index.ts +1 -0
  1453. package/src/routes/price-lists/price-list-create/price-list-create.tsx +20 -0
  1454. package/src/routes/price-lists/price-list-detail/breadcrumb.tsx +23 -0
  1455. package/src/routes/price-lists/price-list-detail/components/price-list-configuration-section/index.ts +1 -0
  1456. package/src/routes/price-lists/price-list-detail/components/price-list-configuration-section/price-list-configuration-section.tsx +96 -0
  1457. package/src/routes/price-lists/price-list-detail/components/price-list-general-section/index.ts +1 -0
  1458. package/src/routes/price-lists/price-list-detail/components/price-list-general-section/price-list-general-section.tsx +94 -0
  1459. package/src/routes/price-lists/price-list-detail/components/price-list-product-section/index.ts +1 -0
  1460. package/src/routes/price-lists/price-list-detail/components/price-list-product-section/price-list-product-section.tsx +285 -0
  1461. package/src/routes/price-lists/price-list-detail/index.ts +3 -0
  1462. package/src/routes/price-lists/price-list-detail/loader.ts +16 -0
  1463. package/src/routes/price-lists/price-list-detail/price-list-detail.tsx +48 -0
  1464. package/src/routes/price-lists/price-list-edit/components/price-list-edit-form/edit-price-list-form.tsx +193 -0
  1465. package/src/routes/price-lists/price-list-edit/components/price-list-edit-form/index.ts +1 -0
  1466. package/src/routes/price-lists/price-list-edit/index.ts +1 -0
  1467. package/src/routes/price-lists/price-list-edit/price-list-edit.tsx +28 -0
  1468. package/src/routes/price-lists/price-list-list/components/price-list-list-table/index.ts +1 -0
  1469. package/src/routes/price-lists/price-list-list/components/price-list-list-table/price-count-cell.tsx +19 -0
  1470. package/src/routes/price-lists/price-list-list/components/price-list-list-table/price-list-list-table-actions.tsx +42 -0
  1471. package/src/routes/price-lists/price-list-list/components/price-list-list-table/price-list-list-table.tsx +76 -0
  1472. package/src/routes/price-lists/price-list-list/components/price-list-list-table/use-pricing-table-columns.tsx +45 -0
  1473. package/src/routes/price-lists/price-list-list/components/price-list-list-table/use-pricing-table-filters.tsx +7 -0
  1474. package/src/routes/price-lists/price-list-list/components/price-list-list-table/use-pricing-table-query.tsx +25 -0
  1475. package/src/routes/price-lists/price-list-list/index.ts +1 -0
  1476. package/src/routes/price-lists/price-list-list/price-list-list.tsx +18 -0
  1477. package/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/index.ts +1 -0
  1478. package/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/price-list-prices-add-form.tsx +305 -0
  1479. package/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/price-list-prices-add-prices-form.tsx +97 -0
  1480. package/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/price-list-prices-add-product-ids-form.tsx +231 -0
  1481. package/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/schema.ts +27 -0
  1482. package/src/routes/price-lists/price-list-prices-add/index.ts +1 -0
  1483. package/src/routes/price-lists/price-list-prices-add/price-list-prices-add.tsx +35 -0
  1484. package/src/routes/price-lists/price-list-prices-edit/components/price-list-prices-edit-form/index.ts +1 -0
  1485. package/src/routes/price-lists/price-list-prices-edit/components/price-list-prices-edit-form/price-list-prices-edit-form.tsx +313 -0
  1486. package/src/routes/price-lists/price-list-prices-edit/index.ts +1 -0
  1487. package/src/routes/price-lists/price-list-prices-edit/price-list-prices-edit.tsx +65 -0
  1488. package/src/routes/product-tags/common/hooks/use-delete-product-tag-action.tsx +52 -0
  1489. package/src/routes/product-tags/product-tag-create/components/product-tag-create-form/index.ts +1 -0
  1490. package/src/routes/product-tags/product-tag-create/components/product-tag-create-form/product-tag-create-form.tsx +100 -0
  1491. package/src/routes/product-tags/product-tag-create/index.ts +1 -0
  1492. package/src/routes/product-tags/product-tag-create/product-tag-create.tsx +10 -0
  1493. package/src/routes/product-tags/product-tag-detail/breadcrumb.tsx +23 -0
  1494. package/src/routes/product-tags/product-tag-detail/components/product-tag-general-section/index.ts +1 -0
  1495. package/src/routes/product-tags/product-tag-detail/components/product-tag-general-section/product-tag-general-section.tsx +63 -0
  1496. package/src/routes/product-tags/product-tag-detail/components/product-tag-product-section/index.ts +1 -0
  1497. package/src/routes/product-tags/product-tag-detail/components/product-tag-product-section/product-tag-product-section.tsx +74 -0
  1498. package/src/routes/product-tags/product-tag-detail/index.ts +3 -0
  1499. package/src/routes/product-tags/product-tag-detail/loader.ts +17 -0
  1500. package/src/routes/product-tags/product-tag-detail/product-tag-detail.tsx +50 -0
  1501. package/src/routes/product-tags/product-tag-edit/components/product-tag-edit-form/index.ts +1 -0
  1502. package/src/routes/product-tags/product-tag-edit/components/product-tag-edit-form/product-tag-edit-form.tsx +88 -0
  1503. package/src/routes/product-tags/product-tag-edit/index.ts +1 -0
  1504. package/src/routes/product-tags/product-tag-edit/product-tag-edit.tsx +33 -0
  1505. package/src/routes/product-tags/product-tag-list/components/product-tag-list-table/index.ts +1 -0
  1506. package/src/routes/product-tags/product-tag-list/components/product-tag-list-table/product-tag-list-table.tsx +148 -0
  1507. package/src/routes/product-tags/product-tag-list/index.ts +2 -0
  1508. package/src/routes/product-tags/product-tag-list/loader.ts +34 -0
  1509. package/src/routes/product-tags/product-tag-list/product-tag-list.tsx +21 -0
  1510. package/src/routes/product-tags/product-tag-metadata/index.ts +1 -0
  1511. package/src/routes/product-tags/product-tag-metadata/product-tag-metadata.tsx +26 -0
  1512. package/src/routes/product-types/common/hooks/use-delete-product-type-action.tsx +38 -0
  1513. package/src/routes/product-types/product-type-create/components/create-product-type-form/create-product-type-form.tsx +100 -0
  1514. package/src/routes/product-types/product-type-create/components/create-product-type-form/index.ts +1 -0
  1515. package/src/routes/product-types/product-type-create/index.ts +1 -0
  1516. package/src/routes/product-types/product-type-create/product-type-create.tsx +10 -0
  1517. package/src/routes/product-types/product-type-detail/breadcrumb.tsx +24 -0
  1518. package/src/routes/product-types/product-type-detail/components/product-type-general-section/index.ts +1 -0
  1519. package/src/routes/product-types/product-type-detail/components/product-type-general-section/product-type-general-section.tsx +63 -0
  1520. package/src/routes/product-types/product-type-detail/components/product-type-product-section/index.ts +1 -0
  1521. package/src/routes/product-types/product-type-detail/components/product-type-product-section/product-type-product-section.tsx +70 -0
  1522. package/src/routes/product-types/product-type-detail/index.ts +3 -0
  1523. package/src/routes/product-types/product-type-detail/loader.ts +17 -0
  1524. package/src/routes/product-types/product-type-detail/product-type-detail.tsx +49 -0
  1525. package/src/routes/product-types/product-type-edit/components/edit-product-type-form/edit-product-type-form.tsx +94 -0
  1526. package/src/routes/product-types/product-type-edit/components/edit-product-type-form/index.ts +1 -0
  1527. package/src/routes/product-types/product-type-edit/index.ts +1 -0
  1528. package/src/routes/product-types/product-type-edit/product-type-edit.tsx +28 -0
  1529. package/src/routes/product-types/product-type-list/components/product-type-list-table/index.ts +1 -0
  1530. package/src/routes/product-types/product-type-list/components/product-type-list-table/product-table-row-actions.tsx +59 -0
  1531. package/src/routes/product-types/product-type-list/components/product-type-list-table/product-type-list-table.tsx +98 -0
  1532. package/src/routes/product-types/product-type-list/index.ts +1 -0
  1533. package/src/routes/product-types/product-type-list/product-type-list.tsx +18 -0
  1534. package/src/routes/product-types/product-type-metadata/index.ts +1 -0
  1535. package/src/routes/product-types/product-type-metadata/product-type-metadata.tsx +26 -0
  1536. package/src/routes/product-variants/product-variant-detail/breadcrumb.tsx +31 -0
  1537. package/src/routes/product-variants/product-variant-detail/components/variant-general-section/index.ts +1 -0
  1538. package/src/routes/product-variants/product-variant-detail/components/variant-general-section/variant-general-section.tsx +112 -0
  1539. package/src/routes/product-variants/product-variant-detail/components/variant-inventory-section/index.ts +1 -0
  1540. package/src/routes/product-variants/product-variant-detail/components/variant-inventory-section/inventory-actions.tsx +26 -0
  1541. package/src/routes/product-variants/product-variant-detail/components/variant-inventory-section/use-inventory-table-columns.tsx +104 -0
  1542. package/src/routes/product-variants/product-variant-detail/components/variant-inventory-section/variant-inventory-section.tsx +94 -0
  1543. package/src/routes/product-variants/product-variant-detail/components/variant-media-section/index.ts +1 -0
  1544. package/src/routes/product-variants/product-variant-detail/components/variant-media-section/variant-media-section.tsx +77 -0
  1545. package/src/routes/product-variants/product-variant-detail/components/variant-prices-section/index.ts +1 -0
  1546. package/src/routes/product-variants/product-variant-detail/components/variant-prices-section/variant-prices-section.tsx +82 -0
  1547. package/src/routes/product-variants/product-variant-detail/constants.ts +2 -0
  1548. package/src/routes/product-variants/product-variant-detail/index.ts +3 -0
  1549. package/src/routes/product-variants/product-variant-detail/loader.ts +25 -0
  1550. package/src/routes/product-variants/product-variant-detail/product-variant-detail.tsx +85 -0
  1551. package/src/routes/product-variants/product-variant-edit/components/product-edit-variant-form/index.ts +1 -0
  1552. package/src/routes/product-variants/product-variant-edit/components/product-edit-variant-form/product-edit-variant-form.tsx +447 -0
  1553. package/src/routes/product-variants/product-variant-edit/index.ts +2 -0
  1554. package/src/routes/product-variants/product-variant-edit/loader.ts +33 -0
  1555. package/src/routes/product-variants/product-variant-edit/product-variant-edit.tsx +62 -0
  1556. package/src/routes/product-variants/product-variant-manage-inventory-items/components/manage-variant-inventory-items-form/index.ts +1 -0
  1557. package/src/routes/product-variants/product-variant-manage-inventory-items/components/manage-variant-inventory-items-form/manage-variant-inventory-items-form.tsx +376 -0
  1558. package/src/routes/product-variants/product-variant-manage-inventory-items/index.ts +1 -0
  1559. package/src/routes/product-variants/product-variant-manage-inventory-items/product-variant-manage-inventory-items.tsx +31 -0
  1560. package/src/routes/product-variants/product-variant-media/components/edit-product-variant-media-form/edit-product-variant-media-form.tsx +434 -0
  1561. package/src/routes/product-variants/product-variant-media/components/edit-product-variant-media-form/index.ts +1 -0
  1562. package/src/routes/product-variants/product-variant-media/index.ts +1 -0
  1563. package/src/routes/product-variants/product-variant-media/product-variant-media.tsx +38 -0
  1564. package/src/routes/product-variants/product-variant-metadata/index.ts +1 -0
  1565. package/src/routes/product-variants/product-variant-metadata/product-variant-metadata.tsx +30 -0
  1566. package/src/routes/products/common/components/category-combobox/category-combobox.tsx +499 -0
  1567. package/src/routes/products/common/components/category-combobox/index.ts +1 -0
  1568. package/src/routes/products/common/components/upload-media-form-item/index.ts +1 -0
  1569. package/src/routes/products/common/components/upload-media-form-item/upload-media-form-item.tsx +134 -0
  1570. package/src/routes/products/common/constants.ts +1 -0
  1571. package/src/routes/products/common/variant-pricing-form.tsx +99 -0
  1572. package/src/routes/products/product-attributes/components/product-attributes-form/index.ts +1 -0
  1573. package/src/routes/products/product-attributes/components/product-attributes-form/product-attributes-form.tsx +277 -0
  1574. package/src/routes/products/product-attributes/index.ts +1 -0
  1575. package/src/routes/products/product-attributes/product-attributes.tsx +33 -0
  1576. package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-general-section/index.ts +1 -0
  1577. package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-general-section/product-create-general-section.tsx +91 -0
  1578. package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-media-section/index.ts +1 -0
  1579. package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-media-section/product-create-details-media-section.tsx +338 -0
  1580. package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/index.ts +1 -0
  1581. package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx +528 -0
  1582. package/src/routes/products/product-create/components/product-create-details-form/index.ts +1 -0
  1583. package/src/routes/products/product-create/components/product-create-details-form/product-create-details-form.tsx +44 -0
  1584. package/src/routes/products/product-create/components/product-create-form/index.ts +1 -0
  1585. package/src/routes/products/product-create/components/product-create-form/product-create-form.tsx +404 -0
  1586. package/src/routes/products/product-create/components/product-create-inventory-kit-form/components/product-create-inventory-kit-section/index.ts +1 -0
  1587. package/src/routes/products/product-create/components/product-create-inventory-kit-form/components/product-create-inventory-kit-section/product-create-inventory-kit-section.tsx +248 -0
  1588. package/src/routes/products/product-create/components/product-create-inventory-kit-form/index.ts +1 -0
  1589. package/src/routes/products/product-create/components/product-create-inventory-kit-form/product-create-inventory-kit-form.tsx +20 -0
  1590. package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-attribute-section/index.ts +1 -0
  1591. package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-attribute-section/product-create-details-attribute-section.tsx +155 -0
  1592. package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-section/index.ts +1 -0
  1593. package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-section/product-create-details-organize-section.tsx +248 -0
  1594. package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/index.ts +1 -0
  1595. package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/product-create-sales-channel-drawer.tsx +160 -0
  1596. package/src/routes/products/product-create/components/product-create-organize-form/constants.ts +1 -0
  1597. package/src/routes/products/product-create/components/product-create-organize-form/index.ts +1 -0
  1598. package/src/routes/products/product-create/components/product-create-organize-form/product-create-organize-form.tsx +33 -0
  1599. package/src/routes/products/product-create/components/product-create-variants-form/index.ts +1 -0
  1600. package/src/routes/products/product-create/components/product-create-variants-form/product-create-variants-form.tsx +204 -0
  1601. package/src/routes/products/product-create/constants.ts +163 -0
  1602. package/src/routes/products/product-create/index.ts +1 -0
  1603. package/src/routes/products/product-create/product-create.tsx +90 -0
  1604. package/src/routes/products/product-create/types.ts +6 -0
  1605. package/src/routes/products/product-create/utils.ts +118 -0
  1606. package/src/routes/products/product-create-option/components/create-product-option-form/create-product-option-form.tsx +122 -0
  1607. package/src/routes/products/product-create-option/components/create-product-option-form/index.ts +1 -0
  1608. package/src/routes/products/product-create-option/index.ts +1 -0
  1609. package/src/routes/products/product-create-option/product-create-option.tsx +30 -0
  1610. package/src/routes/products/product-create-variant/components/create-product-variant-form/constants.ts +44 -0
  1611. package/src/routes/products/product-create-variant/components/create-product-variant-form/create-product-variant-form.tsx +387 -0
  1612. package/src/routes/products/product-create-variant/components/create-product-variant-form/details-tab.tsx +193 -0
  1613. package/src/routes/products/product-create-variant/components/create-product-variant-form/index.ts +1 -0
  1614. package/src/routes/products/product-create-variant/components/create-product-variant-form/inventory-kit-tab.tsx +188 -0
  1615. package/src/routes/products/product-create-variant/components/create-product-variant-form/pricing-tab.tsx +100 -0
  1616. package/src/routes/products/product-create-variant/index.ts +1 -0
  1617. package/src/routes/products/product-create-variant/product-create-variant.tsx +23 -0
  1618. package/src/routes/products/product-detail/breadcrumb.tsx +30 -0
  1619. package/src/routes/products/product-detail/components/product-attribute-section/index.ts +1 -0
  1620. package/src/routes/products/product-detail/components/product-attribute-section/product-attribute-section.tsx +53 -0
  1621. package/src/routes/products/product-detail/components/product-general-section/index.ts +1 -0
  1622. package/src/routes/products/product-detail/components/product-general-section/product-general-section.tsx +130 -0
  1623. package/src/routes/products/product-detail/components/product-media-section/index.ts +1 -0
  1624. package/src/routes/products/product-detail/components/product-media-section/product-media-section.tsx +220 -0
  1625. package/src/routes/products/product-detail/components/product-option-section/index.ts +1 -0
  1626. package/src/routes/products/product-detail/components/product-option-section/product-option-section.tsx +113 -0
  1627. package/src/routes/products/product-detail/components/product-organization-section/index.ts +1 -0
  1628. package/src/routes/products/product-detail/components/product-organization-section/product-organization-section.tsx +107 -0
  1629. package/src/routes/products/product-detail/components/product-sales-channel-section/index.ts +1 -0
  1630. package/src/routes/products/product-detail/components/product-sales-channel-section/product-sales-channel-section.tsx +106 -0
  1631. package/src/routes/products/product-detail/components/product-shipping-profile-section/index.ts +1 -0
  1632. package/src/routes/products/product-detail/components/product-shipping-profile-section/product-shipping-profile-section.tsx +51 -0
  1633. package/src/routes/products/product-detail/components/product-variant-section/index.ts +1 -0
  1634. package/src/routes/products/product-detail/components/product-variant-section/product-variant-section.tsx +468 -0
  1635. package/src/routes/products/product-detail/constants.ts +6 -0
  1636. package/src/routes/products/product-detail/index.ts +3 -0
  1637. package/src/routes/products/product-detail/loader.ts +24 -0
  1638. package/src/routes/products/product-detail/product-detail.tsx +81 -0
  1639. package/src/routes/products/product-edit/components/edit-product-form/edit-product-form.tsx +246 -0
  1640. package/src/routes/products/product-edit/components/edit-product-form/index.ts +1 -0
  1641. package/src/routes/products/product-edit/index.ts +1 -0
  1642. package/src/routes/products/product-edit/product-edit.tsx +36 -0
  1643. package/src/routes/products/product-edit-option/components/edit-product-option-form/edit-product-option-form.tsx +123 -0
  1644. package/src/routes/products/product-edit-option/components/edit-product-option-form/index.ts +1 -0
  1645. package/src/routes/products/product-edit-option/index.ts +1 -0
  1646. package/src/routes/products/product-edit-option/product-edit-option.tsx +35 -0
  1647. package/src/routes/products/product-export/components/export-filters.tsx +22 -0
  1648. package/src/routes/products/product-export/index.ts +1 -0
  1649. package/src/routes/products/product-export/product-export.tsx +67 -0
  1650. package/src/routes/products/product-image-variants-edit/components/variants-table-form/index.ts +1 -0
  1651. package/src/routes/products/product-image-variants-edit/components/variants-table-form/variants-table-form.tsx +264 -0
  1652. package/src/routes/products/product-image-variants-edit/index.ts +1 -0
  1653. package/src/routes/products/product-image-variants-edit/product-image-variants-edit.tsx +65 -0
  1654. package/src/routes/products/product-import/components/import-summary.tsx +50 -0
  1655. package/src/routes/products/product-import/components/upload-import.tsx +61 -0
  1656. package/src/routes/products/product-import/helpers/import-template.ts +12 -0
  1657. package/src/routes/products/product-import/index.ts +1 -0
  1658. package/src/routes/products/product-import/product-import.tsx +143 -0
  1659. package/src/routes/products/product-list/components/product-list-table/configurable-product-list-table.tsx +26 -0
  1660. package/src/routes/products/product-list/components/product-list-table/index.ts +1 -0
  1661. package/src/routes/products/product-list/components/product-list-table/product-list-table.tsx +203 -0
  1662. package/src/routes/products/product-list/components/product-list-table/product-table-adapter.tsx +51 -0
  1663. package/src/routes/products/product-list/components/product-list-table/use-product-table-filters.tsx +104 -0
  1664. package/src/routes/products/product-list/index.ts +2 -0
  1665. package/src/routes/products/product-list/loader.ts +28 -0
  1666. package/src/routes/products/product-list/product-list.tsx +18 -0
  1667. package/src/routes/products/product-media/components/edit-product-media-form/edit-product-media-form.tsx +457 -0
  1668. package/src/routes/products/product-media/components/edit-product-media-form/index.ts +1 -0
  1669. package/src/routes/products/product-media/components/product-media-gallery/index.ts +1 -0
  1670. package/src/routes/products/product-media/components/product-media-gallery/product-media-gallery.tsx +327 -0
  1671. package/src/routes/products/product-media/components/product-media-view/index.ts +1 -0
  1672. package/src/routes/products/product-media/components/product-media-view/product-media-view-context.tsx +9 -0
  1673. package/src/routes/products/product-media/components/product-media-view/product-media-view.tsx +54 -0
  1674. package/src/routes/products/product-media/components/product-media-view/use-product-media-view.tsx +14 -0
  1675. package/src/routes/products/product-media/index.ts +1 -0
  1676. package/src/routes/products/product-media/product-media.tsx +33 -0
  1677. package/src/routes/products/product-metadata/index.ts +1 -0
  1678. package/src/routes/products/product-metadata/product-metadata.tsx +28 -0
  1679. package/src/routes/products/product-organization/components/product-organization-form/index.ts +1 -0
  1680. package/src/routes/products/product-organization/components/product-organization-form/product-organization-form.tsx +218 -0
  1681. package/src/routes/products/product-organization/index.ts +1 -0
  1682. package/src/routes/products/product-organization/product-organization.tsx +32 -0
  1683. package/src/routes/products/product-prices/index.ts +1 -0
  1684. package/src/routes/products/product-prices/pricing-edit.tsx +149 -0
  1685. package/src/routes/products/product-prices/product-prices.tsx +26 -0
  1686. package/src/routes/products/product-sales-channels/components/edit-sales-channels-form/edit-sales-channels-form.tsx +155 -0
  1687. package/src/routes/products/product-sales-channels/components/edit-sales-channels-form/index.ts +1 -0
  1688. package/src/routes/products/product-sales-channels/index.ts +1 -0
  1689. package/src/routes/products/product-sales-channels/product-sales-channels.tsx +23 -0
  1690. package/src/routes/products/product-shipping-profile/components/product-organization-form/index.ts +1 -0
  1691. package/src/routes/products/product-shipping-profile/components/product-organization-form/product-shipping-profile-form.tsx +133 -0
  1692. package/src/routes/products/product-shipping-profile/index.ts +1 -0
  1693. package/src/routes/products/product-shipping-profile/product-shipping-profile.tsx +35 -0
  1694. package/src/routes/products/product-stock/components/product-stock-form/index.ts +1 -0
  1695. package/src/routes/products/product-stock/components/product-stock-form/product-stock-form.tsx +220 -0
  1696. package/src/routes/products/product-stock/hooks/use-product-stock-columns.tsx +227 -0
  1697. package/src/routes/products/product-stock/index.ts +2 -0
  1698. package/src/routes/products/product-stock/loader.ts +55 -0
  1699. package/src/routes/products/product-stock/product-stock.tsx +106 -0
  1700. package/src/routes/products/product-stock/schema.ts +33 -0
  1701. package/src/routes/products/product-stock/utils.ts +53 -0
  1702. package/src/routes/profile/profile-detail/components/profile-general-section/index.ts +1 -0
  1703. package/src/routes/profile/profile-detail/components/profile-general-section/profile-general-section.tsx +76 -0
  1704. package/src/routes/profile/profile-detail/index.ts +1 -0
  1705. package/src/routes/profile/profile-detail/profile-detail.tsx +30 -0
  1706. package/src/routes/profile/profile-edit/components/edit-profile-form/edit-profile-form.tsx +205 -0
  1707. package/src/routes/profile/profile-edit/index.ts +1 -0
  1708. package/src/routes/profile/profile-edit/profile-edit.tsx +26 -0
  1709. package/src/routes/promotions/common/edit-rules/components/edit-rules-form/edit-rules-form.tsx +76 -0
  1710. package/src/routes/promotions/common/edit-rules/components/edit-rules-form/form-schema.ts +32 -0
  1711. package/src/routes/promotions/common/edit-rules/components/edit-rules-form/index.ts +1 -0
  1712. package/src/routes/promotions/common/edit-rules/components/edit-rules-form/utils.ts +17 -0
  1713. package/src/routes/promotions/common/edit-rules/components/edit-rules-wrapper/edit-rules-wrapper.tsx +123 -0
  1714. package/src/routes/promotions/common/edit-rules/components/edit-rules-wrapper/index.ts +1 -0
  1715. package/src/routes/promotions/common/edit-rules/components/edit-rules-wrapper/utils.ts +9 -0
  1716. package/src/routes/promotions/common/edit-rules/components/rule-value-form-field/index.ts +1 -0
  1717. package/src/routes/promotions/common/edit-rules/components/rule-value-form-field/rule-value-form-field.tsx +168 -0
  1718. package/src/routes/promotions/common/edit-rules/components/rules-form-field/constants.ts +11 -0
  1719. package/src/routes/promotions/common/edit-rules/components/rules-form-field/index.ts +1 -0
  1720. package/src/routes/promotions/common/edit-rules/components/rules-form-field/rules-form-field.tsx +450 -0
  1721. package/src/routes/promotions/common/edit-rules/edit-rules.tsx +63 -0
  1722. package/src/routes/promotions/common/edit-rules/index.ts +1 -0
  1723. package/src/routes/promotions/promotion-add-campaign/components/add-campaign-promotion-form/add-campaign-promotion-form.tsx +244 -0
  1724. package/src/routes/promotions/promotion-add-campaign/components/add-campaign-promotion-form/campaign-details.tsx +145 -0
  1725. package/src/routes/promotions/promotion-add-campaign/components/add-campaign-promotion-form/index.ts +1 -0
  1726. package/src/routes/promotions/promotion-add-campaign/index.ts +1 -0
  1727. package/src/routes/promotions/promotion-add-campaign/promotion-add-campaign.tsx +29 -0
  1728. package/src/routes/promotions/promotion-create/components/create-promotion-form/constants.ts +11 -0
  1729. package/src/routes/promotions/promotion-create/components/create-promotion-form/create-promotion-form.tsx +1086 -0
  1730. package/src/routes/promotions/promotion-create/components/create-promotion-form/form-schema.ts +62 -0
  1731. package/src/routes/promotions/promotion-create/components/create-promotion-form/index.ts +1 -0
  1732. package/src/routes/promotions/promotion-create/components/create-promotion-form/templates.ts +140 -0
  1733. package/src/routes/promotions/promotion-create/index.ts +1 -0
  1734. package/src/routes/promotions/promotion-create/promotion-create.tsx +10 -0
  1735. package/src/routes/promotions/promotion-detail/breadcrumb.tsx +22 -0
  1736. package/src/routes/promotions/promotion-detail/components/campaign-section/campaign-section.tsx +92 -0
  1737. package/src/routes/promotions/promotion-detail/components/campaign-section/index.ts +1 -0
  1738. package/src/routes/promotions/promotion-detail/components/promotion-conditions-section/index.ts +1 -0
  1739. package/src/routes/promotions/promotion-detail/components/promotion-conditions-section/promotion-conditions-section.tsx +105 -0
  1740. package/src/routes/promotions/promotion-detail/components/promotion-general-section/index.ts +1 -0
  1741. package/src/routes/promotions/promotion-detail/components/promotion-general-section/promotion-general-section.tsx +215 -0
  1742. package/src/routes/promotions/promotion-detail/index.ts +3 -0
  1743. package/src/routes/promotions/promotion-detail/loader.ts +16 -0
  1744. package/src/routes/promotions/promotion-detail/promotion-detail.tsx +72 -0
  1745. package/src/routes/promotions/promotion-edit-details/components/edit-promotion-form/edit-promotion-details-form.tsx +455 -0
  1746. package/src/routes/promotions/promotion-edit-details/components/edit-promotion-form/index.ts +1 -0
  1747. package/src/routes/promotions/promotion-edit-details/index.ts +1 -0
  1748. package/src/routes/promotions/promotion-edit-details/promotion-edit-details.tsx +30 -0
  1749. package/src/routes/promotions/promotion-list/components/promotion-list-table/index.ts +1 -0
  1750. package/src/routes/promotions/promotion-list/components/promotion-list-table/promotion-list-table.tsx +158 -0
  1751. package/src/routes/promotions/promotion-list/index.ts +2 -0
  1752. package/src/routes/promotions/promotion-list/loader.ts +27 -0
  1753. package/src/routes/promotions/promotion-list/promotions-list.tsx +18 -0
  1754. package/src/routes/refund-reasons/refund-reason-create/components/refund-reason-create-form/index.ts +1 -0
  1755. package/src/routes/refund-reasons/refund-reason-create/components/refund-reason-create-form/refund-reason-create-form.tsx +177 -0
  1756. package/src/routes/refund-reasons/refund-reason-create/index.ts +1 -0
  1757. package/src/routes/refund-reasons/refund-reason-create/refund-reason-create.tsx +10 -0
  1758. package/src/routes/refund-reasons/refund-reason-edit/components/refund-reason-edit-form/index.ts +1 -0
  1759. package/src/routes/refund-reasons/refund-reason-edit/components/refund-reason-edit-form/refund-reason-edit-form.tsx +141 -0
  1760. package/src/routes/refund-reasons/refund-reason-edit/index.ts +1 -0
  1761. package/src/routes/refund-reasons/refund-reason-edit/refund-reason-edit.tsx +33 -0
  1762. package/src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/index.ts +1 -0
  1763. package/src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/refund-reason-list-table.tsx +138 -0
  1764. package/src/routes/refund-reasons/refund-reason-list/index.ts +2 -0
  1765. package/src/routes/refund-reasons/refund-reason-list/loader.ts +16 -0
  1766. package/src/routes/refund-reasons/refund-reason-list/refund-reason-list.tsx +21 -0
  1767. package/src/routes/regions/common/constants.ts +4 -0
  1768. package/src/routes/regions/common/hooks/use-countries.tsx +68 -0
  1769. package/src/routes/regions/common/hooks/use-country-table-columns.tsx +25 -0
  1770. package/src/routes/regions/common/hooks/use-country-table-query.tsx +25 -0
  1771. package/src/routes/regions/region-add-countries/components/add-countries-form/add-countries-form.tsx +208 -0
  1772. package/src/routes/regions/region-add-countries/components/add-countries-form/index.ts +1 -0
  1773. package/src/routes/regions/region-add-countries/index.ts +1 -0
  1774. package/src/routes/regions/region-add-countries/region-add-countries.tsx +27 -0
  1775. package/src/routes/regions/region-create/components/create-region-form/create-region-form.tsx +523 -0
  1776. package/src/routes/regions/region-create/components/create-region-form/index.ts +1 -0
  1777. package/src/routes/regions/region-create/index.ts +1 -0
  1778. package/src/routes/regions/region-create/region-create.tsx +22 -0
  1779. package/src/routes/regions/region-detail/breadcrumb.tsx +27 -0
  1780. package/src/routes/regions/region-detail/components/region-country-section/index.ts +1 -0
  1781. package/src/routes/regions/region-detail/components/region-country-section/region-country-section.tsx +255 -0
  1782. package/src/routes/regions/region-detail/components/region-general-section/index.ts +1 -0
  1783. package/src/routes/regions/region-detail/components/region-general-section/region-general-section.tsx +138 -0
  1784. package/src/routes/regions/region-detail/constants.ts +2 -0
  1785. package/src/routes/regions/region-detail/index.ts +3 -0
  1786. package/src/routes/regions/region-detail/loader.ts +25 -0
  1787. package/src/routes/regions/region-detail/region-detail.tsx +77 -0
  1788. package/src/routes/regions/region-edit/components/edit-region-form/edit-region-form.tsx +251 -0
  1789. package/src/routes/regions/region-edit/components/edit-region-form/index.ts +1 -0
  1790. package/src/routes/regions/region-edit/index.ts +1 -0
  1791. package/src/routes/regions/region-edit/region-edit.tsx +78 -0
  1792. package/src/routes/regions/region-list/components/region-list-table/index.ts +1 -0
  1793. package/src/routes/regions/region-list/components/region-list-table/region-list-table.tsx +178 -0
  1794. package/src/routes/regions/region-list/index.ts +1 -0
  1795. package/src/routes/regions/region-list/region-list.tsx +18 -0
  1796. package/src/routes/regions/region-metadata/index.ts +1 -0
  1797. package/src/routes/regions/region-metadata/region-metadata.tsx +27 -0
  1798. package/src/routes/reservations/reservation-create/components/reservation-create-from/index.ts +1 -0
  1799. package/src/routes/reservations/reservation-create/components/reservation-create-from/reservation-create-from.tsx +311 -0
  1800. package/src/routes/reservations/reservation-create/index.ts +2 -0
  1801. package/src/routes/reservations/reservation-create/reservation-create.tsx +16 -0
  1802. package/src/routes/reservations/reservation-detail/breadcrumb.tsx +29 -0
  1803. package/src/routes/reservations/reservation-detail/components/edit-reservation/components/edit-reservation-form.tsx +215 -0
  1804. package/src/routes/reservations/reservation-detail/components/edit-reservation/components/index.tsx +1 -0
  1805. package/src/routes/reservations/reservation-detail/components/edit-reservation/edit-reservation-modal.tsx +53 -0
  1806. package/src/routes/reservations/reservation-detail/components/edit-reservation/index.ts +1 -0
  1807. package/src/routes/reservations/reservation-detail/components/reservation-general-section/index.ts +1 -0
  1808. package/src/routes/reservations/reservation-detail/components/reservation-general-section/reservation-general-section.tsx +90 -0
  1809. package/src/routes/reservations/reservation-detail/index.ts +3 -0
  1810. package/src/routes/reservations/reservation-detail/loader.ts +16 -0
  1811. package/src/routes/reservations/reservation-detail/reservation-detail.tsx +73 -0
  1812. package/src/routes/reservations/reservation-list/components/reservation-list-table/index.ts +1 -0
  1813. package/src/routes/reservations/reservation-list/components/reservation-list-table/reservation-actions.tsx +57 -0
  1814. package/src/routes/reservations/reservation-list/components/reservation-list-table/reservation-list-table.tsx +67 -0
  1815. package/src/routes/reservations/reservation-list/components/reservation-list-table/use-reservation-table-columns.tsx +107 -0
  1816. package/src/routes/reservations/reservation-list/components/reservation-list-table/use-reservation-table-filters.tsx +35 -0
  1817. package/src/routes/reservations/reservation-list/components/reservation-list-table/use-reservation-table-query.tsx +32 -0
  1818. package/src/routes/reservations/reservation-list/constants.ts +1 -0
  1819. package/src/routes/reservations/reservation-list/index.ts +1 -0
  1820. package/src/routes/reservations/reservation-list/reservation-list.tsx +18 -0
  1821. package/src/routes/reservations/reservation-metadata/index.ts +1 -0
  1822. package/src/routes/reservations/reservation-metadata/reservation-metadata.tsx +30 -0
  1823. package/src/routes/reset-password/index.ts +2 -0
  1824. package/src/routes/reset-password/reset-password.tsx +341 -0
  1825. package/src/routes/return-reasons/common/hooks/use-delete-return-reason-action.tsx +40 -0
  1826. package/src/routes/return-reasons/return-reason-create/components/return-reason-create-form/index.ts +1 -0
  1827. package/src/routes/return-reasons/return-reason-create/components/return-reason-create-form/return-reason-create-form.tsx +157 -0
  1828. package/src/routes/return-reasons/return-reason-create/index.ts +1 -0
  1829. package/src/routes/return-reasons/return-reason-create/return-reason-create.tsx +10 -0
  1830. package/src/routes/return-reasons/return-reason-edit/components/return-reason-edit-form/index.ts +1 -0
  1831. package/src/routes/return-reasons/return-reason-edit/components/return-reason-edit-form/return-reason-edit-form.tsx +141 -0
  1832. package/src/routes/return-reasons/return-reason-edit/index.ts +1 -0
  1833. package/src/routes/return-reasons/return-reason-edit/return-reason-edit.tsx +33 -0
  1834. package/src/routes/return-reasons/return-reason-list/components/return-reason-list-table/index.ts +1 -0
  1835. package/src/routes/return-reasons/return-reason-list/components/return-reason-list-table/return-reason-list-table.tsx +128 -0
  1836. package/src/routes/return-reasons/return-reason-list/index.ts +2 -0
  1837. package/src/routes/return-reasons/return-reason-list/loader.ts +21 -0
  1838. package/src/routes/return-reasons/return-reason-list/return-reason-list.tsx +21 -0
  1839. package/src/routes/sales-channels/sales-channel-add-products/components/add-products-to-sales-channel-form.tsx +240 -0
  1840. package/src/routes/sales-channels/sales-channel-add-products/components/index.ts +1 -0
  1841. package/src/routes/sales-channels/sales-channel-add-products/index.ts +1 -0
  1842. package/src/routes/sales-channels/sales-channel-add-products/sales-channel-add-products.tsx +26 -0
  1843. package/src/routes/sales-channels/sales-channel-create/components/create-sales-channel-form/create-sales-channel-form.tsx +154 -0
  1844. package/src/routes/sales-channels/sales-channel-create/components/create-sales-channel-form/index.ts +1 -0
  1845. package/src/routes/sales-channels/sales-channel-create/index.ts +1 -0
  1846. package/src/routes/sales-channels/sales-channel-create/sales-channel-create.tsx +10 -0
  1847. package/src/routes/sales-channels/sales-channel-detail/breadcrumb.tsx +23 -0
  1848. package/src/routes/sales-channels/sales-channel-detail/components/sales-channel-general-section/index.ts +1 -0
  1849. package/src/routes/sales-channels/sales-channel-detail/components/sales-channel-general-section/sales-channel-general-section.tsx +99 -0
  1850. package/src/routes/sales-channels/sales-channel-detail/components/sales-channel-product-section/index.ts +1 -0
  1851. package/src/routes/sales-channels/sales-channel-detail/components/sales-channel-product-section/sales-channel-product-section.tsx +255 -0
  1852. package/src/routes/sales-channels/sales-channel-detail/index.ts +3 -0
  1853. package/src/routes/sales-channels/sales-channel-detail/loader.ts +17 -0
  1854. package/src/routes/sales-channels/sales-channel-detail/sales-channel-detail.tsx +41 -0
  1855. package/src/routes/sales-channels/sales-channel-edit/components/edit-sales-channel-form/edit-sales-channel-form.tsx +136 -0
  1856. package/src/routes/sales-channels/sales-channel-edit/components/edit-sales-channel-form/index.ts +1 -0
  1857. package/src/routes/sales-channels/sales-channel-edit/index.ts +1 -0
  1858. package/src/routes/sales-channels/sales-channel-edit/sales-channel-edit.tsx +36 -0
  1859. package/src/routes/sales-channels/sales-channel-list/components/index.ts +1 -0
  1860. package/src/routes/sales-channels/sales-channel-list/components/sales-channel-list-table.tsx +158 -0
  1861. package/src/routes/sales-channels/sales-channel-list/index.ts +1 -0
  1862. package/src/routes/sales-channels/sales-channel-list/sales-channel-list.tsx +20 -0
  1863. package/src/routes/sales-channels/sales-channel-metadata/index.ts +1 -0
  1864. package/src/routes/sales-channels/sales-channel-metadata/sales-channel-metadata.tsx +32 -0
  1865. package/src/routes/settings/index.ts +1 -0
  1866. package/src/routes/settings/settings.tsx +15 -0
  1867. package/src/routes/shipping-option-types/common/hooks/use-delete-shipping-option-type-action.tsx +43 -0
  1868. package/src/routes/shipping-option-types/shipping-option-type-create/components/create-shipping-option-type-form/create-shipping-option-type-form.tsx +168 -0
  1869. package/src/routes/shipping-option-types/shipping-option-type-create/components/create-shipping-option-type-form/index.ts +1 -0
  1870. package/src/routes/shipping-option-types/shipping-option-type-create/index.ts +1 -0
  1871. package/src/routes/shipping-option-types/shipping-option-type-create/shipping-option-type-create.tsx +10 -0
  1872. package/src/routes/shipping-option-types/shipping-option-type-detail/breadcrumb.tsx +24 -0
  1873. package/src/routes/shipping-option-types/shipping-option-type-detail/components/shipping-option-type-general-section/index.ts +1 -0
  1874. package/src/routes/shipping-option-types/shipping-option-type-detail/components/shipping-option-type-general-section/shipping-option-type-general-section.tsx +66 -0
  1875. package/src/routes/shipping-option-types/shipping-option-type-detail/index.ts +3 -0
  1876. package/src/routes/shipping-option-types/shipping-option-type-detail/loader.ts +19 -0
  1877. package/src/routes/shipping-option-types/shipping-option-type-detail/shipping-option-type-detail.tsx +46 -0
  1878. package/src/routes/shipping-option-types/shipping-option-type-edit/components/edit-shipping-option-type-form/edit-shipping-option-type-form.tsx +145 -0
  1879. package/src/routes/shipping-option-types/shipping-option-type-edit/components/edit-shipping-option-type-form/index.ts +1 -0
  1880. package/src/routes/shipping-option-types/shipping-option-type-edit/index.ts +1 -0
  1881. package/src/routes/shipping-option-types/shipping-option-type-edit/shipping-option-type-edit.tsx +31 -0
  1882. package/src/routes/shipping-option-types/shipping-option-type-list/components/shipping-option-type-list-table/index.ts +1 -0
  1883. package/src/routes/shipping-option-types/shipping-option-type-list/components/shipping-option-type-list-table/shipping-option-type-list-table.tsx +99 -0
  1884. package/src/routes/shipping-option-types/shipping-option-type-list/components/shipping-option-type-list-table/shipping-option-type-table-row-actions.tsx +44 -0
  1885. package/src/routes/shipping-option-types/shipping-option-type-list/index.ts +1 -0
  1886. package/src/routes/shipping-option-types/shipping-option-type-list/shipping-option-type-list.tsx +18 -0
  1887. package/src/routes/shipping-profiles/shipping-profile-create/components/create-shipping-profile-form/create-shipping-profile-form.tsx +129 -0
  1888. package/src/routes/shipping-profiles/shipping-profile-create/components/create-shipping-profile-form/index.ts +1 -0
  1889. package/src/routes/shipping-profiles/shipping-profile-create/index.ts +1 -0
  1890. package/src/routes/shipping-profiles/shipping-profile-create/shipping-profile-create.tsx +10 -0
  1891. package/src/routes/shipping-profiles/shipping-profile-detail/breadcrumb.tsx +27 -0
  1892. package/src/routes/shipping-profiles/shipping-profile-detail/components/shipping-profile-general-section/index.ts +1 -0
  1893. package/src/routes/shipping-profiles/shipping-profile-detail/components/shipping-profile-general-section/shipping-profile-general-section.tsx +76 -0
  1894. package/src/routes/shipping-profiles/shipping-profile-detail/index.ts +3 -0
  1895. package/src/routes/shipping-profiles/shipping-profile-detail/loader.ts +17 -0
  1896. package/src/routes/shipping-profiles/shipping-profile-detail/shipping-profile-detail.tsx +47 -0
  1897. package/src/routes/shipping-profiles/shipping-profile-metadata/index.ts +1 -0
  1898. package/src/routes/shipping-profiles/shipping-profile-metadata/shipping-profile-metadata.tsx +31 -0
  1899. package/src/routes/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-table/index.ts +1 -0
  1900. package/src/routes/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-table/shipping-options-row-actions.tsx +64 -0
  1901. package/src/routes/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-table/shipping-profile-list-table.tsx +78 -0
  1902. package/src/routes/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-table/use-shipping-profile-table-columns.tsx +31 -0
  1903. package/src/routes/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-table/use-shipping-profile-table-filters.tsx +33 -0
  1904. package/src/routes/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-table/use-shipping-profile-table-query.tsx +30 -0
  1905. package/src/routes/shipping-profiles/shipping-profiles-list/index.ts +1 -0
  1906. package/src/routes/shipping-profiles/shipping-profiles-list/shipping-profile-list.tsx +18 -0
  1907. package/src/routes/store/common/hooks/use-currencies-table-columns.tsx +29 -0
  1908. package/src/routes/store/common/hooks/use-currencies-table-query.tsx +21 -0
  1909. package/src/routes/store/common/hooks/use-locales-table-columns.tsx +29 -0
  1910. package/src/routes/store/common/hooks/use-locales-table-query.tsx +21 -0
  1911. package/src/routes/store/store-add-currencies/components/add-currencies-form/add-currencies-form.tsx +308 -0
  1912. package/src/routes/store/store-add-currencies/index.ts +1 -0
  1913. package/src/routes/store/store-add-currencies/store-add-currencies.tsx +42 -0
  1914. package/src/routes/store/store-add-locales/components/add-locales-form/add-locales-form.tsx +231 -0
  1915. package/src/routes/store/store-add-locales/index.ts +1 -0
  1916. package/src/routes/store/store-add-locales/store-add-locales.tsx +29 -0
  1917. package/src/routes/store/store-detail/components/store-currency-section/index.ts +1 -0
  1918. package/src/routes/store/store-detail/components/store-currency-section/store-currency-section.tsx +387 -0
  1919. package/src/routes/store/store-detail/components/store-general-section/index.ts +1 -0
  1920. package/src/routes/store/store-detail/components/store-general-section/store-general-section.tsx +142 -0
  1921. package/src/routes/store/store-detail/components/store-locale-section/index.ts +1 -0
  1922. package/src/routes/store/store-detail/components/store-locale-section/store-locale-section.tsx +282 -0
  1923. package/src/routes/store/store-detail/index.ts +2 -0
  1924. package/src/routes/store/store-detail/loader.ts +18 -0
  1925. package/src/routes/store/store-detail/store-detail.tsx +48 -0
  1926. package/src/routes/store/store-edit/components/edit-store-form/edit-store-form.tsx +232 -0
  1927. package/src/routes/store/store-edit/index.ts +1 -0
  1928. package/src/routes/store/store-edit/store-edit.tsx +25 -0
  1929. package/src/routes/store/store-metadata/index.ts +1 -0
  1930. package/src/routes/store/store-metadata/store-metadata.tsx +24 -0
  1931. package/src/routes/tax-regions/common/components/target-form/index.ts +1 -0
  1932. package/src/routes/tax-regions/common/components/target-form/target-form.tsx +970 -0
  1933. package/src/routes/tax-regions/common/components/target-item/index.ts +1 -0
  1934. package/src/routes/tax-regions/common/components/target-item/target-item.tsx +43 -0
  1935. package/src/routes/tax-regions/common/components/tax-override-card/index.ts +1 -0
  1936. package/src/routes/tax-regions/common/components/tax-override-card/tax-override-card.tsx +404 -0
  1937. package/src/routes/tax-regions/common/components/tax-override-table/index.ts +1 -0
  1938. package/src/routes/tax-regions/common/components/tax-override-table/tax-override-table.tsx +119 -0
  1939. package/src/routes/tax-regions/common/components/tax-rate-line/index.ts +1 -0
  1940. package/src/routes/tax-regions/common/components/tax-rate-line/tax-rate-line.tsx +82 -0
  1941. package/src/routes/tax-regions/common/components/tax-region-card/index.ts +1 -0
  1942. package/src/routes/tax-regions/common/components/tax-region-card/tax-region-card.tsx +218 -0
  1943. package/src/routes/tax-regions/common/components/tax-region-table/index.ts +1 -0
  1944. package/src/routes/tax-regions/common/components/tax-region-table/tax-region-table.tsx +122 -0
  1945. package/src/routes/tax-regions/common/constants.ts +8 -0
  1946. package/src/routes/tax-regions/common/hooks/use-tax-override-table.tsx +92 -0
  1947. package/src/routes/tax-regions/common/hooks/use-tax-region-table.tsx +92 -0
  1948. package/src/routes/tax-regions/common/hooks.ts +79 -0
  1949. package/src/routes/tax-regions/common/schemas.ts +16 -0
  1950. package/src/routes/tax-regions/common/utils.ts +12 -0
  1951. package/src/routes/tax-regions/tax-region-create/components/tax-region-create-form/index.ts +1 -0
  1952. package/src/routes/tax-regions/tax-region-create/components/tax-region-create-form/tax-region-create-form.tsx +276 -0
  1953. package/src/routes/tax-regions/tax-region-create/index.ts +3 -0
  1954. package/src/routes/tax-regions/tax-region-create/tax-region-create.tsx +10 -0
  1955. package/src/routes/tax-regions/tax-region-detail/breadcrumb.tsx +29 -0
  1956. package/src/routes/tax-regions/tax-region-detail/components/index.ts +2 -0
  1957. package/src/routes/tax-regions/tax-region-detail/components/tax-region-detail-section/index.ts +1 -0
  1958. package/src/routes/tax-regions/tax-region-detail/components/tax-region-detail-section/tax-region-detail-section.tsx +41 -0
  1959. package/src/routes/tax-regions/tax-region-detail/components/tax-region-override-section/index.ts +1 -0
  1960. package/src/routes/tax-regions/tax-region-detail/components/tax-region-override-section/tax-region-override-section.tsx +66 -0
  1961. package/src/routes/tax-regions/tax-region-detail/components/tax-region-province-section/index.ts +1 -0
  1962. package/src/routes/tax-regions/tax-region-detail/components/tax-region-province-section/tax-region-province-section.tsx +72 -0
  1963. package/src/routes/tax-regions/tax-region-detail/components/tax-region-sublevel-alert/index.ts +1 -0
  1964. package/src/routes/tax-regions/tax-region-detail/components/tax-region-sublevel-alert/tax-region-sublevel-alert.tsx +62 -0
  1965. package/src/routes/tax-regions/tax-region-detail/index.ts +5 -0
  1966. package/src/routes/tax-regions/tax-region-detail/loader.ts +16 -0
  1967. package/src/routes/tax-regions/tax-region-detail/tax-region-detail.tsx +65 -0
  1968. package/src/routes/tax-regions/tax-region-detail/tax-region-provider-section/index.ts +1 -0
  1969. package/src/routes/tax-regions/tax-region-detail/tax-region-provider-section/tax-region-provider-section.tsx +28 -0
  1970. package/src/routes/tax-regions/tax-region-edit/components/tax-region-edit/index.ts +1 -0
  1971. package/src/routes/tax-regions/tax-region-edit/components/tax-region-edit/tax-region-edit-form.tsx +109 -0
  1972. package/src/routes/tax-regions/tax-region-edit/index.ts +1 -0
  1973. package/src/routes/tax-regions/tax-region-edit/tax-region-edit.tsx +33 -0
  1974. package/src/routes/tax-regions/tax-region-list/components/tax-region-list-view/index.ts +1 -0
  1975. package/src/routes/tax-regions/tax-region-list/components/tax-region-list-view/tax-region-list-view.tsx +58 -0
  1976. package/src/routes/tax-regions/tax-region-list/index.ts +1 -0
  1977. package/src/routes/tax-regions/tax-region-list/tax-region-list.tsx +19 -0
  1978. package/src/routes/tax-regions/tax-region-metadata/index.ts +1 -0
  1979. package/src/routes/tax-regions/tax-region-metadata/tax-region-metadata.tsx +31 -0
  1980. package/src/routes/tax-regions/tax-region-province-create/components/tax-region-province-create-form/index.ts +1 -0
  1981. package/src/routes/tax-regions/tax-region-province-create/components/tax-region-province-create-form/tax-region-province-create-form.tsx +249 -0
  1982. package/src/routes/tax-regions/tax-region-province-create/index.ts +3 -0
  1983. package/src/routes/tax-regions/tax-region-province-create/tax-region-province-create.tsx +22 -0
  1984. package/src/routes/tax-regions/tax-region-province-detail/breadcrumb.tsx +32 -0
  1985. package/src/routes/tax-regions/tax-region-province-detail/components/index.ts +2 -0
  1986. package/src/routes/tax-regions/tax-region-province-detail/components/tax-region-province-detail-section/index.ts +1 -0
  1987. package/src/routes/tax-regions/tax-region-province-detail/components/tax-region-province-detail-section/tax-region-detail-section.tsx +42 -0
  1988. package/src/routes/tax-regions/tax-region-province-detail/components/tax-region-province-override-section/index.ts +1 -0
  1989. package/src/routes/tax-regions/tax-region-province-detail/components/tax-region-province-override-section/tax-region-province-override-section.tsx +65 -0
  1990. package/src/routes/tax-regions/tax-region-province-detail/index.ts +5 -0
  1991. package/src/routes/tax-regions/tax-region-province-detail/loader.ts +16 -0
  1992. package/src/routes/tax-regions/tax-region-province-detail/tax-region-detail.tsx +49 -0
  1993. package/src/routes/tax-regions/tax-region-tax-override-create/components/tax-region-override-create-form/index.ts +1 -0
  1994. package/src/routes/tax-regions/tax-region-tax-override-create/components/tax-region-override-create-form/tax-region-tax-override-create.tsx +675 -0
  1995. package/src/routes/tax-regions/tax-region-tax-override-create/index.ts +1 -0
  1996. package/src/routes/tax-regions/tax-region-tax-override-create/tax-region-tax-override-create.tsx +24 -0
  1997. package/src/routes/tax-regions/tax-region-tax-override-edit/components/tax-region-tax-override-edit-form/index.ts +1 -0
  1998. package/src/routes/tax-regions/tax-region-tax-override-edit/components/tax-region-tax-override-edit-form/tax-region-tax-override-edit-form.tsx +652 -0
  1999. package/src/routes/tax-regions/tax-region-tax-override-edit/index.ts +1 -0
  2000. package/src/routes/tax-regions/tax-region-tax-override-edit/tax-region-tax-override-edit.tsx +211 -0
  2001. package/src/routes/tax-regions/tax-region-tax-override-edit/types.ts +11 -0
  2002. package/src/routes/tax-regions/tax-region-tax-rate-create/components/tax-region-tax-rate-create-form/index.ts +1 -0
  2003. package/src/routes/tax-regions/tax-region-tax-rate-create/components/tax-region-tax-rate-create-form/tax-region-tax-rate-create-form.tsx +180 -0
  2004. package/src/routes/tax-regions/tax-region-tax-rate-create/index.ts +1 -0
  2005. package/src/routes/tax-regions/tax-region-tax-rate-create/tax-region-tax-rate-create.tsx +29 -0
  2006. package/src/routes/tax-regions/tax-region-tax-rate-edit/components/tax-region-tax-rate-edit-form/index.ts +1 -0
  2007. package/src/routes/tax-regions/tax-region-tax-rate-edit/components/tax-region-tax-rate-edit-form/tax-region-tax-rate-edit-form.tsx +159 -0
  2008. package/src/routes/tax-regions/tax-region-tax-rate-edit/index.ts +1 -0
  2009. package/src/routes/tax-regions/tax-region-tax-rate-edit/tax-region-edit.tsx +38 -0
  2010. package/src/routes/translations/add-locales/add-locales.tsx +29 -0
  2011. package/src/routes/translations/add-locales/index.tsx +1 -0
  2012. package/src/routes/translations/settings/components/batch-translation-settings-form/batch-translation-settings-form.tsx +246 -0
  2013. package/src/routes/translations/settings/components/entity-selector-tree/entity-selector-tree.tsx +288 -0
  2014. package/src/routes/translations/settings/components/selector-tree-filter/selector-tree-filter.tsx +88 -0
  2015. package/src/routes/translations/settings/index.tsx +2 -0
  2016. package/src/routes/translations/settings/settings.tsx +35 -0
  2017. package/src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx +85 -0
  2018. package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +48 -0
  2019. package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +285 -0
  2020. package/src/routes/translations/translation-list/index.tsx +1 -0
  2021. package/src/routes/translations/translation-list/translation-list.tsx +188 -0
  2022. package/src/routes/translations/translations-edit/components/translations-edit-form/index.ts +1 -0
  2023. package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +747 -0
  2024. package/src/routes/translations/translations-edit/index.ts +1 -0
  2025. package/src/routes/translations/translations-edit/translations-edit.tsx +85 -0
  2026. package/src/routes/users/user-detail/breadcrumb.tsx +24 -0
  2027. package/src/routes/users/user-detail/components/user-general-section/index.ts +1 -0
  2028. package/src/routes/users/user-detail/components/user-general-section/user-general-section.tsx +86 -0
  2029. package/src/routes/users/user-detail/index.ts +3 -0
  2030. package/src/routes/users/user-detail/loader.ts +17 -0
  2031. package/src/routes/users/user-detail/user-detail.tsx +47 -0
  2032. package/src/routes/users/user-edit/components/edit-user-form/edit-user-form.tsx +97 -0
  2033. package/src/routes/users/user-edit/components/edit-user-form/index.ts +1 -0
  2034. package/src/routes/users/user-edit/index.ts +1 -0
  2035. package/src/routes/users/user-edit/user-edit.tsx +25 -0
  2036. package/src/routes/users/user-invite/components/invite-user-form/invite-user-form.tsx +345 -0
  2037. package/src/routes/users/user-invite/index.ts +1 -0
  2038. package/src/routes/users/user-invite/user-invite.tsx +10 -0
  2039. package/src/routes/users/user-list/components/user-list-table/index.ts +1 -0
  2040. package/src/routes/users/user-list/components/user-list-table/user-list-table.tsx +131 -0
  2041. package/src/routes/users/user-list/index.ts +1 -0
  2042. package/src/routes/users/user-list/user-list.tsx +18 -0
  2043. package/src/routes/users/user-metadata/index.ts +1 -0
  2044. package/src/routes/users/user-metadata/user-metadata.tsx +27 -0
  2045. package/src/routes/workflow-executions/constants.ts +38 -0
  2046. package/src/routes/workflow-executions/types.ts +28 -0
  2047. package/src/routes/workflow-executions/utils.ts +103 -0
  2048. package/src/routes/workflow-executions/workflow-execution-detail/breadcrumb.tsx +26 -0
  2049. package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-general-section/index.ts +1 -0
  2050. package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-general-section/workflow-execution-general-section.tsx +120 -0
  2051. package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-history-section/index.ts +1 -0
  2052. package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-history-section/workflow-execution-history-section.tsx +334 -0
  2053. package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-payload-section/index.ts +1 -0
  2054. package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-payload-section/workflow-execution-payload-section.tsx +24 -0
  2055. package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-timeline-section/index.ts +1 -0
  2056. package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-timeline-section/workflow-execution-timeline-section.tsx +446 -0
  2057. package/src/routes/workflow-executions/workflow-execution-detail/index.ts +3 -0
  2058. package/src/routes/workflow-executions/workflow-execution-detail/loader.ts +19 -0
  2059. package/src/routes/workflow-executions/workflow-execution-detail/workflow-detail.tsx +43 -0
  2060. package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/index.ts +1 -0
  2061. package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-columns.tsx +72 -0
  2062. package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-query.tsx +25 -0
  2063. package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-list-table.tsx +69 -0
  2064. package/src/routes/workflow-executions/workflow-execution-list/index.ts +1 -0
  2065. package/src/routes/workflow-executions/workflow-execution-list/workflow-execution-list.tsx +20 -0
  2066. package/src/utils/column-utils.ts +71 -0
  2067. package/src/vite-env.d.ts +20 -0
@@ -0,0 +1,4112 @@
1
+ import {
2
+ currencies
3
+ } from "./chunk-DK4WIVY6.mjs";
4
+ import {
5
+ Skeleton
6
+ } from "./chunk-LPEUYMRK.mjs";
7
+ import {
8
+ ConditionalTooltip
9
+ } from "./chunk-OC7BQLYI.mjs";
10
+ import {
11
+ useDocumentDirection
12
+ } from "./chunk-S4DMV3ZT.mjs";
13
+ import {
14
+ __publicField
15
+ } from "./chunk-QZ7TP4HQ.mjs";
16
+
17
+ // src/components/data-grid/components/data-grid-skeleton.tsx
18
+ import { jsx, jsxs } from "react/jsx-runtime";
19
+ var DataGridSkeleton = ({
20
+ columns,
21
+ rows: rowCount = 10
22
+ }) => {
23
+ const rows = Array.from({ length: rowCount }, (_, i) => i);
24
+ const colCount = columns.length;
25
+ return /* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-subtle size-full", children: [
26
+ /* @__PURE__ */ jsx("div", { className: "bg-ui-bg-base border-b p-4", children: /* @__PURE__ */ jsx("div", { className: "bg-ui-button-neutral h-7 w-[116px] animate-pulse rounded-md" }) }),
27
+ /* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-subtle size-full overflow-auto", children: [
28
+ /* @__PURE__ */ jsx(
29
+ "div",
30
+ {
31
+ className: "grid",
32
+ style: {
33
+ gridTemplateColumns: `repeat(${colCount}, 1fr)`
34
+ },
35
+ children: columns.map((_col, i) => {
36
+ return /* @__PURE__ */ jsx(
37
+ "div",
38
+ {
39
+ className: "bg-ui-bg-base flex h-10 w-[200px] items-center border-b border-r px-4 py-2.5 last:border-r-0",
40
+ children: /* @__PURE__ */ jsx(Skeleton, { className: "h-[14px] w-[164px]" })
41
+ },
42
+ i
43
+ );
44
+ })
45
+ }
46
+ ),
47
+ /* @__PURE__ */ jsx("div", { children: rows.map((_, j) => /* @__PURE__ */ jsx(
48
+ "div",
49
+ {
50
+ className: "grid",
51
+ style: { gridTemplateColumns: `repeat(${colCount}, 1fr)` },
52
+ children: columns.map((_col, k) => {
53
+ return /* @__PURE__ */ jsx(
54
+ "div",
55
+ {
56
+ className: "bg-ui-bg-base flex h-10 w-[200px] items-center border-b border-r px-4 py-2.5 last:border-r-0",
57
+ children: /* @__PURE__ */ jsx(Skeleton, { className: "h-[14px] w-[164px]" })
58
+ },
59
+ k
60
+ );
61
+ })
62
+ },
63
+ j
64
+ )) })
65
+ ] })
66
+ ] });
67
+ };
68
+
69
+ // src/components/data-grid/components/data-grid-boolean-cell.tsx
70
+ import { Checkbox } from "@medusajs/ui";
71
+ import { Controller } from "react-hook-form";
72
+
73
+ // src/hooks/use-combined-refs.tsx
74
+ function setRef(ref, value) {
75
+ if (typeof ref === "function") {
76
+ ref(value);
77
+ } else if (ref && "current" in ref) {
78
+ ;
79
+ ref.current = value;
80
+ }
81
+ }
82
+ var useCombinedRefs = (...refs) => {
83
+ return (value) => {
84
+ refs.forEach((ref) => setRef(ref, value));
85
+ };
86
+ };
87
+
88
+ // src/components/data-grid/hooks/use-data-grid-cell.tsx
89
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
90
+
91
+ // src/components/data-grid/context/data-grid-context.tsx
92
+ import { createContext } from "react";
93
+ var DataGridContext = createContext(
94
+ null
95
+ );
96
+
97
+ // src/components/data-grid/context/use-data-grid-context.tsx
98
+ import { useContext } from "react";
99
+ var useDataGridContext = () => {
100
+ const context = useContext(DataGridContext);
101
+ if (!context) {
102
+ throw new Error(
103
+ "useDataGridContext must be used within a DataGridContextProvider"
104
+ );
105
+ }
106
+ return context;
107
+ };
108
+
109
+ // src/components/data-grid/utils.ts
110
+ function generateCellId(coords) {
111
+ return `${coords.row}:${coords.col}`;
112
+ }
113
+ function isCellMatch(cell, coords) {
114
+ if (!coords) {
115
+ return false;
116
+ }
117
+ return cell.row === coords.row && cell.col === coords.col;
118
+ }
119
+ var SPECIAL_FOCUS_KEYS = [".", ","];
120
+ function isSpecialFocusKey(event) {
121
+ return SPECIAL_FOCUS_KEYS.includes(event.key) && event.ctrlKey && event.altKey;
122
+ }
123
+
124
+ // src/components/data-grid/hooks/use-data-grid-cell.tsx
125
+ var textCharacterRegex = /^.$/u;
126
+ var numberCharacterRegex = /^[0-9]$/u;
127
+ var useDataGridCell = ({
128
+ context
129
+ }) => {
130
+ const {
131
+ register,
132
+ control,
133
+ anchor,
134
+ setIsEditing,
135
+ setSingleRange,
136
+ setIsSelecting,
137
+ setRangeEnd,
138
+ getWrapperFocusHandler,
139
+ getWrapperMouseOverHandler,
140
+ getInputChangeHandler,
141
+ getIsCellSelected,
142
+ getIsCellDragSelected,
143
+ getCellMetadata
144
+ } = useDataGridContext();
145
+ const { rowIndex, columnIndex } = context;
146
+ const coords = useMemo(
147
+ () => ({ row: rowIndex, col: columnIndex }),
148
+ [rowIndex, columnIndex]
149
+ );
150
+ const { id, field, type, innerAttributes, inputAttributes } = useMemo(() => {
151
+ return getCellMetadata(coords);
152
+ }, [coords, getCellMetadata]);
153
+ const [showOverlay, setShowOverlay] = useState(true);
154
+ const containerRef = useRef(null);
155
+ const inputRef = useRef(null);
156
+ const handleOverlayMouseDown = useCallback(
157
+ (e) => {
158
+ e.preventDefault();
159
+ e.stopPropagation();
160
+ if (e.detail === 2) {
161
+ if (inputRef.current) {
162
+ setShowOverlay(false);
163
+ inputRef.current.focus();
164
+ return;
165
+ }
166
+ }
167
+ if (e.shiftKey) {
168
+ if (coords.col === anchor?.col) {
169
+ setRangeEnd(coords);
170
+ return;
171
+ }
172
+ }
173
+ if (containerRef.current) {
174
+ setSingleRange(coords);
175
+ setIsSelecting(true);
176
+ containerRef.current.focus();
177
+ }
178
+ },
179
+ [coords, anchor, setRangeEnd, setSingleRange, setIsSelecting]
180
+ );
181
+ const handleBooleanInnerMouseDown = useCallback(
182
+ (e) => {
183
+ e.preventDefault();
184
+ e.stopPropagation();
185
+ if (e.detail === 2) {
186
+ inputRef.current?.focus();
187
+ return;
188
+ }
189
+ if (e.shiftKey) {
190
+ setRangeEnd(coords);
191
+ return;
192
+ }
193
+ if (containerRef.current) {
194
+ setSingleRange(coords);
195
+ setIsSelecting(true);
196
+ containerRef.current.focus();
197
+ }
198
+ },
199
+ [setIsSelecting, setSingleRange, setRangeEnd, coords]
200
+ );
201
+ const handleInputBlur = useCallback(() => {
202
+ setShowOverlay(true);
203
+ setIsEditing(false);
204
+ }, [setIsEditing]);
205
+ const handleInputFocus = useCallback(() => {
206
+ setShowOverlay(false);
207
+ setIsEditing(true);
208
+ }, [setIsEditing]);
209
+ const validateKeyStroke = useCallback(
210
+ (key) => {
211
+ switch (type) {
212
+ case "togglable-number":
213
+ case "number":
214
+ return numberCharacterRegex.test(key);
215
+ case "text":
216
+ case "multiline-text":
217
+ return textCharacterRegex.test(key);
218
+ default:
219
+ return false;
220
+ }
221
+ },
222
+ [type]
223
+ );
224
+ const handleContainerKeyDown = useCallback(
225
+ (e) => {
226
+ if (!inputRef.current || !validateKeyStroke(e.key) || !showOverlay) {
227
+ return;
228
+ }
229
+ if (e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey)) {
230
+ return;
231
+ }
232
+ if (e.key.toLowerCase() === "c" && (e.ctrlKey || e.metaKey)) {
233
+ return;
234
+ }
235
+ if (e.key.toLowerCase() === "v" && (e.ctrlKey || e.metaKey)) {
236
+ return;
237
+ }
238
+ if (e.key === "Enter") {
239
+ return;
240
+ }
241
+ if (isSpecialFocusKey(e.nativeEvent)) {
242
+ return;
243
+ }
244
+ inputRef.current.focus();
245
+ setShowOverlay(false);
246
+ if (inputRef.current instanceof HTMLInputElement) {
247
+ inputRef.current.value = "";
248
+ const nativeInputValueSetter = Object.getOwnPropertyDescriptor(
249
+ window.HTMLInputElement.prototype,
250
+ "value"
251
+ )?.set;
252
+ nativeInputValueSetter?.call(inputRef.current, e.key);
253
+ const event = new Event("input", { bubbles: true });
254
+ inputRef.current.dispatchEvent(event);
255
+ } else if (inputRef.current instanceof HTMLTextAreaElement) {
256
+ inputRef.current.value = "";
257
+ const nativeTextAreaValueSetter = Object.getOwnPropertyDescriptor(
258
+ window.HTMLTextAreaElement.prototype,
259
+ "value"
260
+ )?.set;
261
+ nativeTextAreaValueSetter?.call(inputRef.current, e.key);
262
+ const event = new Event("input", { bubbles: true });
263
+ inputRef.current.dispatchEvent(event);
264
+ }
265
+ e.stopPropagation();
266
+ e.preventDefault();
267
+ },
268
+ [showOverlay, validateKeyStroke]
269
+ );
270
+ const isAnchor = useMemo(() => {
271
+ return anchor ? isCellMatch(coords, anchor) : false;
272
+ }, [anchor, coords]);
273
+ const fieldWithoutOverlay = useMemo(() => {
274
+ return type === "boolean";
275
+ }, [type]);
276
+ useEffect(() => {
277
+ if (isAnchor && !containerRef.current?.contains(document.activeElement)) {
278
+ containerRef.current?.focus({ preventScroll: true });
279
+ }
280
+ }, [isAnchor]);
281
+ const renderProps = {
282
+ container: {
283
+ field,
284
+ isAnchor,
285
+ isSelected: getIsCellSelected(coords),
286
+ isDragSelected: getIsCellDragSelected(coords),
287
+ showOverlay: fieldWithoutOverlay ? false : showOverlay,
288
+ innerProps: {
289
+ ref: containerRef,
290
+ onMouseOver: getWrapperMouseOverHandler(coords),
291
+ onMouseDown: type === "boolean" ? handleBooleanInnerMouseDown : void 0,
292
+ onKeyDown: handleContainerKeyDown,
293
+ onFocus: getWrapperFocusHandler(coords),
294
+ ...innerAttributes
295
+ },
296
+ overlayProps: {
297
+ onMouseDown: handleOverlayMouseDown
298
+ }
299
+ },
300
+ input: {
301
+ ref: inputRef,
302
+ onBlur: handleInputBlur,
303
+ onFocus: handleInputFocus,
304
+ onChange: getInputChangeHandler(field),
305
+ ...inputAttributes
306
+ }
307
+ };
308
+ return {
309
+ id,
310
+ field,
311
+ register,
312
+ control,
313
+ renderProps
314
+ };
315
+ };
316
+
317
+ // src/components/data-grid/hooks/use-data-grid-cell-error.tsx
318
+ import { useMemo as useMemo2 } from "react";
319
+ import { get } from "react-hook-form";
320
+ var useDataGridCellError = ({
321
+ context
322
+ }) => {
323
+ const { errors, getCellErrorMetadata, navigateToField } = useDataGridContext();
324
+ const { rowIndex, columnIndex } = context;
325
+ const { accessor, field } = useMemo2(() => {
326
+ return getCellErrorMetadata({ row: rowIndex, col: columnIndex });
327
+ }, [rowIndex, columnIndex, getCellErrorMetadata]);
328
+ const rowErrorsObject = accessor && columnIndex === 0 ? get(errors, accessor) : void 0;
329
+ const rowErrors = [];
330
+ function collectErrors(errorObject, baseAccessor) {
331
+ if (!errorObject) {
332
+ return;
333
+ }
334
+ if (isFieldError(errorObject)) {
335
+ const message = errorObject.message;
336
+ const to = () => navigateToField(baseAccessor);
337
+ if (message) {
338
+ rowErrors.push({ message, to });
339
+ }
340
+ } else {
341
+ Object.keys(errorObject).forEach((key) => {
342
+ const nestedError = errorObject[key];
343
+ const fieldAccessor = `${baseAccessor}.${key}`;
344
+ if (nestedError && typeof nestedError === "object") {
345
+ collectErrors(nestedError, fieldAccessor);
346
+ }
347
+ });
348
+ }
349
+ }
350
+ if (rowErrorsObject && accessor) {
351
+ collectErrors(rowErrorsObject, accessor);
352
+ }
353
+ const cellError = field ? get(errors, field) : void 0;
354
+ return {
355
+ errors,
356
+ rowErrors,
357
+ cellError
358
+ };
359
+ };
360
+ function isFieldError(errors) {
361
+ return typeof errors === "object" && "message" in errors && "type" in errors;
362
+ }
363
+
364
+ // src/components/data-grid/hooks/use-data-grid-cell-handlers.tsx
365
+ import { useCallback as useCallback2 } from "react";
366
+
367
+ // src/components/data-grid/models/data-grid-bulk-update-command.ts
368
+ var DataGridBulkUpdateCommand = class {
369
+ constructor({ fields, prev, next, setter }) {
370
+ __publicField(this, "_fields");
371
+ __publicField(this, "_prev");
372
+ __publicField(this, "_next");
373
+ __publicField(this, "_setter");
374
+ this._fields = fields;
375
+ this._prev = prev;
376
+ this._next = next;
377
+ this._setter = setter;
378
+ }
379
+ execute(redo = false) {
380
+ this._setter(this._fields, this._next, redo);
381
+ }
382
+ undo() {
383
+ this._setter(this._fields, this._prev, true);
384
+ }
385
+ redo() {
386
+ this.execute(true);
387
+ }
388
+ };
389
+
390
+ // src/components/data-grid/models/data-grid-matrix.ts
391
+ var DataGridMatrix = class {
392
+ constructor(data, columns, multiColumnSelection = false) {
393
+ __publicField(this, "multiColumnSelection");
394
+ __publicField(this, "cells");
395
+ __publicField(this, "rowAccessors", []);
396
+ __publicField(this, "columnAccessors", []);
397
+ this.multiColumnSelection = multiColumnSelection;
398
+ this.cells = this._populateCells(data, columns);
399
+ this.rowAccessors = this._computeRowAccessors();
400
+ this.columnAccessors = this._computeColumnAccessors();
401
+ }
402
+ _computeRowAccessors() {
403
+ return this.cells.map((_, rowIndex) => this.getRowAccessor(rowIndex));
404
+ }
405
+ _computeColumnAccessors() {
406
+ if (this.cells.length === 0) {
407
+ return [];
408
+ }
409
+ return this.cells[0].map((_, colIndex) => this.getColumnAccessor(colIndex));
410
+ }
411
+ getFirstNavigableCell() {
412
+ for (let row = 0; row < this.cells.length; row++) {
413
+ for (let col = 0; col < this.cells[0].length; col++) {
414
+ if (this.cells[row][col] !== null) {
415
+ return { row, col };
416
+ }
417
+ }
418
+ }
419
+ return null;
420
+ }
421
+ getFieldsInRow(row) {
422
+ const keys = [];
423
+ if (row < 0 || row >= this.cells.length) {
424
+ return keys;
425
+ }
426
+ this.cells[row].forEach((cell) => {
427
+ if (cell !== null) {
428
+ keys.push(cell.field);
429
+ }
430
+ });
431
+ return keys;
432
+ }
433
+ getFieldsInSelection(start, end) {
434
+ const keys = [];
435
+ if (!start || !end) {
436
+ return keys;
437
+ }
438
+ if (!this.multiColumnSelection && start.col !== end.col) {
439
+ throw new Error(
440
+ "Selection must be in the same column when multiColumnSelection is disabled"
441
+ );
442
+ }
443
+ const startRow = Math.min(start.row, end.row);
444
+ const endRow = Math.max(start.row, end.row);
445
+ const startCol = this.multiColumnSelection ? Math.min(start.col, end.col) : start.col;
446
+ const endCol = this.multiColumnSelection ? Math.max(start.col, end.col) : start.col;
447
+ for (let row = startRow; row <= endRow; row++) {
448
+ for (let col = startCol; col <= endCol; col++) {
449
+ if (this._isValidPosition(row, col) && this.cells[row][col] !== null) {
450
+ keys.push(this.cells[row][col]?.field);
451
+ }
452
+ }
453
+ }
454
+ return keys;
455
+ }
456
+ getCellField(cell) {
457
+ if (this._isValidPosition(cell.row, cell.col)) {
458
+ return this.cells[cell.row][cell.col]?.field || null;
459
+ }
460
+ return null;
461
+ }
462
+ getCellType(cell) {
463
+ if (this._isValidPosition(cell.row, cell.col)) {
464
+ return this.cells[cell.row][cell.col]?.type || null;
465
+ }
466
+ return null;
467
+ }
468
+ getIsCellSelected(cell, start, end) {
469
+ if (!cell || !start || !end) {
470
+ return false;
471
+ }
472
+ if (!this.multiColumnSelection && start.col !== end.col) {
473
+ throw new Error(
474
+ "Selection must be in the same column when multiColumnSelection is disabled"
475
+ );
476
+ }
477
+ const startRow = Math.min(start.row, end.row);
478
+ const endRow = Math.max(start.row, end.row);
479
+ const startCol = this.multiColumnSelection ? Math.min(start.col, end.col) : start.col;
480
+ const endCol = this.multiColumnSelection ? Math.max(start.col, end.col) : start.col;
481
+ return cell.row >= startRow && cell.row <= endRow && cell.col >= startCol && cell.col <= endCol;
482
+ }
483
+ toggleColumn(col, enabled) {
484
+ if (col < 0 || col >= this.cells[0].length) {
485
+ return;
486
+ }
487
+ this.cells.forEach((row, index) => {
488
+ const cell = row[col];
489
+ if (cell) {
490
+ this.cells[index][col] = {
491
+ ...cell,
492
+ enabled
493
+ };
494
+ }
495
+ });
496
+ }
497
+ toggleRow(row, enabled) {
498
+ if (row < 0 || row >= this.cells.length) {
499
+ return;
500
+ }
501
+ this.cells[row].forEach((cell, index) => {
502
+ if (cell) {
503
+ this.cells[row][index] = {
504
+ ...cell,
505
+ enabled
506
+ };
507
+ }
508
+ });
509
+ }
510
+ getCoordinatesByField(field) {
511
+ if (this.rowAccessors.length === 1) {
512
+ const col = this.columnAccessors.indexOf(field);
513
+ if (col === -1) {
514
+ return null;
515
+ }
516
+ return { row: 0, col };
517
+ }
518
+ for (let row = 0; row < this.rowAccessors.length; row++) {
519
+ const rowAccessor = this.rowAccessors[row];
520
+ if (rowAccessor === null) {
521
+ continue;
522
+ }
523
+ if (!field.startsWith(rowAccessor)) {
524
+ continue;
525
+ }
526
+ for (let column = 0; column < this.columnAccessors.length; column++) {
527
+ const columnAccessor = this.columnAccessors[column];
528
+ if (columnAccessor === null) {
529
+ continue;
530
+ }
531
+ const fullFieldPath = `${rowAccessor}.${columnAccessor}`;
532
+ if (fullFieldPath === field) {
533
+ return { row, col: column };
534
+ }
535
+ }
536
+ }
537
+ return null;
538
+ }
539
+ getRowAccessor(row) {
540
+ if (row < 0 || row >= this.cells.length) {
541
+ return null;
542
+ }
543
+ const cells = this.cells[row];
544
+ const nonNullFields = cells.filter((cell) => cell !== null).map((cell) => cell.field.split("."));
545
+ if (nonNullFields.length === 0) {
546
+ return null;
547
+ }
548
+ let commonParts = nonNullFields[0];
549
+ for (const segments of nonNullFields) {
550
+ commonParts = commonParts.filter(
551
+ (part, index) => segments[index] === part
552
+ );
553
+ if (commonParts.length === 0) {
554
+ break;
555
+ }
556
+ }
557
+ const accessor = commonParts.join(".");
558
+ if (!accessor) {
559
+ return null;
560
+ }
561
+ return accessor;
562
+ }
563
+ getColumnAccessor(column) {
564
+ if (column < 0 || column >= this.cells[0].length) {
565
+ return null;
566
+ }
567
+ const uniqueParts = this.cells.map((row, rowIndex) => {
568
+ const cell = row[column];
569
+ if (!cell) {
570
+ return null;
571
+ }
572
+ const rowAccessor = this.getRowAccessor(rowIndex);
573
+ if (rowAccessor && cell.field.startsWith(rowAccessor + ".")) {
574
+ return cell.field.slice(rowAccessor.length + 1);
575
+ }
576
+ return null;
577
+ }).filter((part) => part !== null);
578
+ if (uniqueParts.length === 0) {
579
+ return null;
580
+ }
581
+ const firstPart = uniqueParts[0];
582
+ const isConsistent = uniqueParts.every((part) => part === firstPart);
583
+ return isConsistent ? firstPart : null;
584
+ }
585
+ getValidMovement(row, col, direction, metaKey = false) {
586
+ const [dRow, dCol] = this._getDirectionDeltas(direction);
587
+ if (metaKey) {
588
+ return this._getLastValidCellInDirection(row, col, dRow, dCol);
589
+ } else {
590
+ let newRow = row + dRow;
591
+ let newCol = col + dCol;
592
+ while (this._isValidPosition(newRow, newCol)) {
593
+ if (this.cells[newRow][newCol] !== null && this.cells[newRow][newCol]?.enabled !== false) {
594
+ return { row: newRow, col: newCol };
595
+ }
596
+ newRow += dRow;
597
+ newCol += dCol;
598
+ }
599
+ return { row, col };
600
+ }
601
+ }
602
+ _isValidPosition(row, col, cells) {
603
+ if (!cells) {
604
+ cells = this.cells;
605
+ }
606
+ return row >= 0 && row < cells.length && col >= 0 && col < cells[0].length;
607
+ }
608
+ _getDirectionDeltas(direction) {
609
+ switch (direction) {
610
+ case "ArrowUp":
611
+ return [-1, 0];
612
+ case "ArrowDown":
613
+ return [1, 0];
614
+ case "ArrowLeft":
615
+ return [0, -1];
616
+ case "ArrowRight":
617
+ return [0, 1];
618
+ default:
619
+ return [0, 0];
620
+ }
621
+ }
622
+ _getLastValidCellInDirection(row, col, dRow, dCol) {
623
+ let newRow = row;
624
+ let newCol = col;
625
+ let lastValidRow = row;
626
+ let lastValidCol = col;
627
+ while (this._isValidPosition(newRow + dRow, newCol + dCol)) {
628
+ newRow += dRow;
629
+ newCol += dCol;
630
+ if (this.cells[newRow][newCol] !== null) {
631
+ lastValidRow = newRow;
632
+ lastValidCol = newCol;
633
+ }
634
+ }
635
+ return {
636
+ row: lastValidRow,
637
+ col: lastValidCol
638
+ };
639
+ }
640
+ _populateCells(rows, columns) {
641
+ const cells = Array.from(
642
+ { length: rows.length },
643
+ () => Array(columns.length).fill(null)
644
+ );
645
+ rows.forEach((row, rowIndex) => {
646
+ columns.forEach((column, colIndex) => {
647
+ if (!this._isValidPosition(rowIndex, colIndex, cells)) {
648
+ return;
649
+ }
650
+ const {
651
+ name: _,
652
+ field,
653
+ type,
654
+ ...rest
655
+ } = column.meta;
656
+ const context = {
657
+ row,
658
+ column: {
659
+ ...column,
660
+ meta: rest
661
+ }
662
+ };
663
+ const fieldValue = field ? field(context) : null;
664
+ if (!fieldValue || !type) {
665
+ return;
666
+ }
667
+ cells[rowIndex][colIndex] = {
668
+ field: fieldValue,
669
+ type,
670
+ enabled: true
671
+ };
672
+ });
673
+ });
674
+ return cells;
675
+ }
676
+ };
677
+
678
+ // src/components/data-grid/models/data-grid-query-tool.ts
679
+ var DataGridQueryTool = class {
680
+ constructor(container) {
681
+ __publicField(this, "container");
682
+ this.container = container;
683
+ }
684
+ getInput(cell) {
685
+ const id = this._getCellId(cell);
686
+ const input = this.container?.querySelector(`[data-cell-id="${id}"]`);
687
+ if (!input) {
688
+ return null;
689
+ }
690
+ return input;
691
+ }
692
+ getInputByField(field) {
693
+ const input = this.container?.querySelector(`[data-field="${field}"]`);
694
+ if (!input) {
695
+ return null;
696
+ }
697
+ return input;
698
+ }
699
+ getCoordinatesByField(field) {
700
+ const cell = this.container?.querySelector(
701
+ `[data-field="${field}"][data-cell-id]`
702
+ );
703
+ if (!cell) {
704
+ return null;
705
+ }
706
+ const cellId = cell.getAttribute("data-cell-id");
707
+ if (!cellId) {
708
+ return null;
709
+ }
710
+ const [row, col] = cellId.split(":").map((n) => parseInt(n, 10));
711
+ if (isNaN(row) || isNaN(col)) {
712
+ return null;
713
+ }
714
+ return { row, col };
715
+ }
716
+ getContainer(cell) {
717
+ const id = this._getCellId(cell);
718
+ const container = this.container?.querySelector(
719
+ `[data-container-id="${id}"]`
720
+ );
721
+ if (!container) {
722
+ return null;
723
+ }
724
+ return container;
725
+ }
726
+ _getCellId(cell) {
727
+ return generateCellId(cell);
728
+ }
729
+ };
730
+
731
+ // src/components/data-grid/models/data-grid-update-command.ts
732
+ var DataGridUpdateCommand = class {
733
+ constructor({ prev, next, setter }) {
734
+ __publicField(this, "_prev");
735
+ __publicField(this, "_next");
736
+ __publicField(this, "_setter");
737
+ this._prev = prev;
738
+ this._next = next;
739
+ this._setter = setter;
740
+ }
741
+ execute() {
742
+ this._setter(this._next);
743
+ }
744
+ undo() {
745
+ this._setter(this._prev);
746
+ }
747
+ redo() {
748
+ this.execute();
749
+ }
750
+ };
751
+
752
+ // src/components/data-grid/hooks/use-data-grid-cell-handlers.tsx
753
+ var useDataGridCellHandlers = ({
754
+ matrix,
755
+ anchor,
756
+ rangeEnd,
757
+ setRangeEnd,
758
+ isDragging,
759
+ setIsDragging,
760
+ isSelecting,
761
+ setIsSelecting,
762
+ setSingleRange,
763
+ dragEnd,
764
+ setDragEnd,
765
+ setValue: setValue2,
766
+ execute,
767
+ multiColumnSelection
768
+ }) => {
769
+ const getWrapperFocusHandler = useCallback2(
770
+ (coords) => {
771
+ return (_e) => {
772
+ setSingleRange(coords);
773
+ };
774
+ },
775
+ [setSingleRange]
776
+ );
777
+ const getOverlayMouseDownHandler = useCallback2(
778
+ (coords) => {
779
+ return (e) => {
780
+ e.stopPropagation();
781
+ e.preventDefault();
782
+ if (e.shiftKey) {
783
+ setRangeEnd(coords);
784
+ return;
785
+ }
786
+ setIsSelecting(true);
787
+ setSingleRange(coords);
788
+ };
789
+ },
790
+ [setIsSelecting, setRangeEnd, setSingleRange]
791
+ );
792
+ const getWrapperMouseOverHandler = useCallback2(
793
+ (coords) => {
794
+ if (!isDragging && !isSelecting) {
795
+ return;
796
+ }
797
+ return (_e) => {
798
+ if (anchor?.col !== coords.col && !multiColumnSelection) {
799
+ return;
800
+ }
801
+ if (isSelecting) {
802
+ setRangeEnd(coords);
803
+ } else {
804
+ setDragEnd(coords);
805
+ }
806
+ };
807
+ },
808
+ [
809
+ anchor?.col,
810
+ isDragging,
811
+ isSelecting,
812
+ setDragEnd,
813
+ setRangeEnd,
814
+ multiColumnSelection
815
+ ]
816
+ );
817
+ const getInputChangeHandler = useCallback2(
818
+ // Using `any` here as the generic type of Path<TFieldValues> will
819
+ // not be inferred correctly.
820
+ (field) => {
821
+ return (next, prev) => {
822
+ const command = new DataGridUpdateCommand({
823
+ next,
824
+ prev,
825
+ setter: (value) => {
826
+ setValue2(field, value, {
827
+ shouldDirty: true,
828
+ shouldTouch: true
829
+ });
830
+ }
831
+ });
832
+ execute(command);
833
+ };
834
+ },
835
+ [setValue2, execute]
836
+ );
837
+ const onDragToFillStart = useCallback2(
838
+ (_e) => {
839
+ setIsDragging(true);
840
+ },
841
+ [setIsDragging]
842
+ );
843
+ const getIsCellSelected = useCallback2(
844
+ (cell) => {
845
+ if (!cell || !anchor || !rangeEnd) {
846
+ return false;
847
+ }
848
+ return matrix.getIsCellSelected(cell, anchor, rangeEnd);
849
+ },
850
+ [anchor, rangeEnd, matrix]
851
+ );
852
+ const getIsCellDragSelected = useCallback2(
853
+ (cell) => {
854
+ if (!cell || !anchor || !dragEnd) {
855
+ return false;
856
+ }
857
+ return matrix.getIsCellSelected(cell, anchor, dragEnd);
858
+ },
859
+ [anchor, dragEnd, matrix]
860
+ );
861
+ return {
862
+ getWrapperFocusHandler,
863
+ getOverlayMouseDownHandler,
864
+ getWrapperMouseOverHandler,
865
+ getInputChangeHandler,
866
+ getIsCellSelected,
867
+ getIsCellDragSelected,
868
+ onDragToFillStart
869
+ };
870
+ };
871
+
872
+ // src/components/data-grid/hooks/use-data-grid-cell-metadata.tsx
873
+ import { useCallback as useCallback3 } from "react";
874
+ var useDataGridCellMetadata = ({
875
+ matrix
876
+ }) => {
877
+ const getCellMetadata = useCallback3(
878
+ (coords) => {
879
+ const { row, col } = coords;
880
+ const id = generateCellId(coords);
881
+ const field = matrix.getCellField(coords);
882
+ const type = matrix.getCellType(coords);
883
+ if (!field || !type) {
884
+ throw new Error(`'field' or 'type' is null for cell ${id}`);
885
+ }
886
+ const inputAttributes = {
887
+ "data-row": row,
888
+ "data-col": col,
889
+ "data-cell-id": id,
890
+ "data-field": field
891
+ };
892
+ const innerAttributes = {
893
+ "data-container-id": id
894
+ };
895
+ return {
896
+ id,
897
+ field,
898
+ type,
899
+ inputAttributes,
900
+ innerAttributes
901
+ };
902
+ },
903
+ [matrix]
904
+ );
905
+ const getCellErrorMetadata = useCallback3(
906
+ (coords) => {
907
+ const accessor = matrix.getRowAccessor(coords.row);
908
+ const field = matrix.getCellField(coords);
909
+ return {
910
+ accessor,
911
+ field
912
+ };
913
+ },
914
+ [matrix]
915
+ );
916
+ return {
917
+ getCellMetadata,
918
+ getCellErrorMetadata
919
+ };
920
+ };
921
+
922
+ // src/components/data-grid/hooks/use-data-grid-cell-snapshot.tsx
923
+ import { useCallback as useCallback4, useState as useState2 } from "react";
924
+ var useDataGridCellSnapshot = ({
925
+ matrix,
926
+ form
927
+ }) => {
928
+ const [snapshot, setSnapshot] = useState2(null);
929
+ const { getValues, setValue: setValue2 } = form;
930
+ const createSnapshot = useCallback4(
931
+ (cell) => {
932
+ if (!cell) {
933
+ return null;
934
+ }
935
+ const field = matrix.getCellField(cell);
936
+ if (!field) {
937
+ return null;
938
+ }
939
+ const value = getValues(field);
940
+ setSnapshot((curr) => {
941
+ if (curr?.field === field) {
942
+ return curr;
943
+ }
944
+ return { field, value };
945
+ });
946
+ },
947
+ [getValues, matrix]
948
+ );
949
+ const restoreSnapshot = useCallback4(() => {
950
+ if (!snapshot) {
951
+ return;
952
+ }
953
+ const { field, value } = snapshot;
954
+ requestAnimationFrame(() => {
955
+ setValue2(field, value);
956
+ });
957
+ }, [setValue2, snapshot]);
958
+ return {
959
+ createSnapshot,
960
+ restoreSnapshot
961
+ };
962
+ };
963
+
964
+ // src/components/data-grid/hooks/use-data-grid-clipboard-events.tsx
965
+ import { useCallback as useCallback5 } from "react";
966
+ var useDataGridClipboardEvents = ({
967
+ matrix,
968
+ anchor,
969
+ rangeEnd,
970
+ isEditing,
971
+ getSelectionValues,
972
+ setSelectionValues,
973
+ execute
974
+ }) => {
975
+ const handleCopyEvent = useCallback5(
976
+ (e) => {
977
+ if (isEditing || !anchor || !rangeEnd) {
978
+ return;
979
+ }
980
+ e.preventDefault();
981
+ const fields = matrix.getFieldsInSelection(anchor, rangeEnd);
982
+ const values = getSelectionValues(fields);
983
+ const text = values.map((value) => {
984
+ if (typeof value === "object" && value !== null) {
985
+ return JSON.stringify(value);
986
+ }
987
+ return `${value}` ?? "";
988
+ }).join(" ");
989
+ e.clipboardData?.setData("text/plain", text);
990
+ },
991
+ [isEditing, anchor, rangeEnd, matrix, getSelectionValues]
992
+ );
993
+ const handlePasteEvent = useCallback5(
994
+ (e) => {
995
+ if (isEditing || !anchor || !rangeEnd) {
996
+ return;
997
+ }
998
+ e.preventDefault();
999
+ const text = e.clipboardData?.getData("text/plain");
1000
+ if (!text) {
1001
+ return;
1002
+ }
1003
+ const next = text.split(" ");
1004
+ const fields = matrix.getFieldsInSelection(anchor, rangeEnd);
1005
+ const prev = getSelectionValues(fields);
1006
+ const command = new DataGridBulkUpdateCommand({
1007
+ fields,
1008
+ next,
1009
+ prev,
1010
+ setter: setSelectionValues
1011
+ });
1012
+ execute(command);
1013
+ },
1014
+ [
1015
+ isEditing,
1016
+ anchor,
1017
+ rangeEnd,
1018
+ matrix,
1019
+ getSelectionValues,
1020
+ setSelectionValues,
1021
+ execute
1022
+ ]
1023
+ );
1024
+ return {
1025
+ handleCopyEvent,
1026
+ handlePasteEvent
1027
+ };
1028
+ };
1029
+
1030
+ // src/components/data-grid/hooks/use-data-grid-column-visibility.tsx
1031
+ import { useCallback as useCallback6 } from "react";
1032
+ function useDataGridColumnVisibility(grid, matrix) {
1033
+ const columns = grid.getAllLeafColumns();
1034
+ const columnOptions = columns.map((column) => ({
1035
+ id: column.id,
1036
+ name: getColumnName(column),
1037
+ checked: column.getIsVisible(),
1038
+ disabled: !column.getCanHide()
1039
+ }));
1040
+ const handleToggleColumn = useCallback6(
1041
+ (index) => (value) => {
1042
+ const column = columns[index];
1043
+ if (!column.getCanHide()) {
1044
+ return;
1045
+ }
1046
+ matrix.toggleColumn(index, value);
1047
+ column.toggleVisibility(value);
1048
+ },
1049
+ [columns, matrix]
1050
+ );
1051
+ const handleResetColumns = useCallback6(() => {
1052
+ grid.setColumnVisibility({});
1053
+ }, [grid]);
1054
+ const optionCount = columnOptions.filter((c) => !c.disabled).length;
1055
+ const isDisabled = optionCount === 0;
1056
+ return {
1057
+ columnOptions,
1058
+ handleToggleColumn,
1059
+ handleResetColumns,
1060
+ isDisabled
1061
+ };
1062
+ }
1063
+ function getColumnName(column) {
1064
+ const id = column.columnDef.id;
1065
+ const enableHiding = column.columnDef.enableHiding;
1066
+ const meta = column?.columnDef.meta;
1067
+ if (!id) {
1068
+ throw new Error(
1069
+ "Column is missing an id, which is a required field. Please provide an id for the column."
1070
+ );
1071
+ }
1072
+ if (process.env.NODE_ENV === "development" && !meta?.name && enableHiding) {
1073
+ console.warn(
1074
+ `Column "${id}" does not have a name. You should add a name to the column definition. Falling back to the column id.`
1075
+ );
1076
+ }
1077
+ return meta?.name || id;
1078
+ }
1079
+
1080
+ // src/components/data-grid/hooks/use-data-grid-duplicate-cell.tsx
1081
+ import { useWatch } from "react-hook-form";
1082
+ var useDataGridDuplicateCell = ({
1083
+ duplicateOf
1084
+ }) => {
1085
+ const { control } = useDataGridContext();
1086
+ const watchedValue = useWatch({ control, name: duplicateOf });
1087
+ return {
1088
+ watchedValue
1089
+ };
1090
+ };
1091
+
1092
+ // src/components/data-grid/hooks/use-data-grid-error-highlighting.tsx
1093
+ import { useCallback as useCallback7, useMemo as useMemo3, useState as useState3 } from "react";
1094
+ var useDataGridErrorHighlighting = (matrix, grid, errors) => {
1095
+ const [isHighlighted, setIsHighlighted] = useState3(false);
1096
+ const [visibilitySnapshot, setVisibilitySnapshot] = useState3(null);
1097
+ const { flatRows } = grid.getRowModel();
1098
+ const flatColumns = grid.getAllFlatColumns();
1099
+ const errorPaths = findErrorPaths(errors);
1100
+ const errorCount = errorPaths.length;
1101
+ const { rowsWithErrors, columnsWithErrors } = useMemo3(() => {
1102
+ const rowsWithErrors2 = /* @__PURE__ */ new Set();
1103
+ const columnsWithErrors2 = /* @__PURE__ */ new Set();
1104
+ errorPaths.forEach((errorPath) => {
1105
+ const rowIndex = matrix.rowAccessors.findIndex(
1106
+ (accessor) => accessor && (errorPath === accessor || errorPath.startsWith(`${accessor}.`))
1107
+ );
1108
+ if (rowIndex !== -1) {
1109
+ rowsWithErrors2.add(rowIndex);
1110
+ }
1111
+ const columnIndex = matrix.columnAccessors.findIndex(
1112
+ (accessor) => accessor && (errorPath === accessor || errorPath.endsWith(`.${accessor}`))
1113
+ );
1114
+ if (columnIndex !== -1) {
1115
+ columnsWithErrors2.add(columnIndex);
1116
+ }
1117
+ });
1118
+ return { rowsWithErrors: rowsWithErrors2, columnsWithErrors: columnsWithErrors2 };
1119
+ }, [errorPaths, matrix.rowAccessors, matrix.columnAccessors]);
1120
+ const toggleErrorHighlighting = useCallback7(
1121
+ (currentRowVisibility, currentColumnVisibility, setRowVisibility, setColumnVisibility) => {
1122
+ if (isHighlighted) {
1123
+ if (visibilitySnapshot) {
1124
+ setRowVisibility(visibilitySnapshot.rows);
1125
+ setColumnVisibility(visibilitySnapshot.columns);
1126
+ }
1127
+ } else {
1128
+ setVisibilitySnapshot({
1129
+ rows: { ...currentRowVisibility },
1130
+ columns: { ...currentColumnVisibility }
1131
+ });
1132
+ const rowsToHide = flatRows.map((_, index) => {
1133
+ return !rowsWithErrors.has(index) ? index : void 0;
1134
+ }).filter((index) => index !== void 0);
1135
+ const columnsToHide = flatColumns.map((column, index) => {
1136
+ return !columnsWithErrors.has(index) && index !== 0 ? column.id : void 0;
1137
+ }).filter((id) => id !== void 0);
1138
+ setRowVisibility(
1139
+ rowsToHide.reduce((acc, row) => ({ ...acc, [row]: false }), {})
1140
+ );
1141
+ setColumnVisibility(
1142
+ columnsToHide.reduce(
1143
+ (acc, column) => ({ ...acc, [column]: false }),
1144
+ {}
1145
+ )
1146
+ );
1147
+ }
1148
+ setIsHighlighted((prev) => !prev);
1149
+ },
1150
+ [
1151
+ isHighlighted,
1152
+ visibilitySnapshot,
1153
+ flatRows,
1154
+ flatColumns,
1155
+ rowsWithErrors,
1156
+ columnsWithErrors
1157
+ ]
1158
+ );
1159
+ return {
1160
+ errorCount,
1161
+ isHighlighted,
1162
+ toggleErrorHighlighting
1163
+ };
1164
+ };
1165
+ function findErrorPaths(obj, path = []) {
1166
+ if (typeof obj !== "object" || obj === null) {
1167
+ return [];
1168
+ }
1169
+ if ("message" in obj && "type" in obj) {
1170
+ return [path.join(".")];
1171
+ }
1172
+ return Object.entries(obj).flatMap(
1173
+ ([key, value]) => findErrorPaths(value, [...path, key])
1174
+ );
1175
+ }
1176
+
1177
+ // src/components/data-grid/hooks/use-data-grid-form-handlers.tsx
1178
+ import { useCallback as useCallback8 } from "react";
1179
+ var useDataGridFormHandlers = ({
1180
+ matrix,
1181
+ form,
1182
+ anchor
1183
+ }) => {
1184
+ const { getValues, reset } = form;
1185
+ const getSelectionValues = useCallback8(
1186
+ (fields) => {
1187
+ if (!fields.length) {
1188
+ return [];
1189
+ }
1190
+ const allValues = getValues();
1191
+ return fields.map((field) => {
1192
+ return field.split(".").reduce((obj, key) => obj?.[key], allValues);
1193
+ });
1194
+ },
1195
+ [getValues]
1196
+ );
1197
+ const setSelectionValues = useCallback8(
1198
+ async (fields, values, isHistory) => {
1199
+ if (!fields.length || !anchor) {
1200
+ return;
1201
+ }
1202
+ const type = matrix.getCellType(anchor);
1203
+ if (!type) {
1204
+ return;
1205
+ }
1206
+ const convertedValues = convertArrayToPrimitive(values, type);
1207
+ const currentValues = getValues();
1208
+ fields.forEach((field, index) => {
1209
+ if (!field) {
1210
+ return;
1211
+ }
1212
+ const valueIndex = index % values.length;
1213
+ const newValue = convertedValues[valueIndex];
1214
+ setValue(currentValues, field, newValue, type, isHistory);
1215
+ });
1216
+ reset(currentValues, {
1217
+ keepDirty: true,
1218
+ keepTouched: true,
1219
+ keepDefaultValues: true
1220
+ });
1221
+ },
1222
+ [matrix, anchor, getValues, reset]
1223
+ );
1224
+ return {
1225
+ getSelectionValues,
1226
+ setSelectionValues
1227
+ };
1228
+ };
1229
+ function convertToNumber(value) {
1230
+ if (typeof value === "number") {
1231
+ return value;
1232
+ }
1233
+ const converted = Number(value);
1234
+ if (isNaN(converted)) {
1235
+ throw new Error(`String "${value}" cannot be converted to number.`);
1236
+ }
1237
+ return converted;
1238
+ }
1239
+ function convertToBoolean(value) {
1240
+ if (typeof value === "boolean") {
1241
+ return value;
1242
+ }
1243
+ if (typeof value === "undefined" || value === null) {
1244
+ return false;
1245
+ }
1246
+ const lowerValue = value.toLowerCase();
1247
+ if (lowerValue === "true" || lowerValue === "false") {
1248
+ return lowerValue === "true";
1249
+ }
1250
+ throw new Error(`String "${value}" cannot be converted to boolean.`);
1251
+ }
1252
+ function covertToString(value) {
1253
+ if (typeof value === "undefined" || value === null) {
1254
+ return "";
1255
+ }
1256
+ return String(value);
1257
+ }
1258
+ function convertToggleableNumber(value) {
1259
+ let obj = value;
1260
+ if (typeof obj === "string") {
1261
+ try {
1262
+ obj = JSON.parse(obj);
1263
+ } catch (error) {
1264
+ throw new Error(`String "${value}" cannot be converted to object.`);
1265
+ }
1266
+ }
1267
+ return obj;
1268
+ }
1269
+ function setValue(currentValues, field, newValue, type, isHistory) {
1270
+ if (type !== "togglable-number") {
1271
+ field.split(".").reduce((curr, key, index) => {
1272
+ if (index === field.split(".").length - 1) {
1273
+ curr[key] = newValue;
1274
+ }
1275
+ curr[key] ?? (curr[key] = {});
1276
+ return curr[key];
1277
+ }, currentValues);
1278
+ return;
1279
+ }
1280
+ setValueToggleableNumber(currentValues, field, newValue, isHistory);
1281
+ }
1282
+ function setValueToggleableNumber(currentValues, field, newValue, isHistory) {
1283
+ const currentValue = field.split(".").reduce((obj, key) => obj?.[key], currentValues);
1284
+ const { disabledToggle } = currentValue;
1285
+ const normalizeQuantity = (value) => {
1286
+ if (disabledToggle && value === "") {
1287
+ return 0;
1288
+ }
1289
+ return value;
1290
+ };
1291
+ const determineChecked = (quantity2) => {
1292
+ if (disabledToggle) {
1293
+ return true;
1294
+ }
1295
+ return quantity2 !== "" && quantity2 != null;
1296
+ };
1297
+ const quantity = normalizeQuantity(newValue.quantity);
1298
+ const checked = isHistory ? disabledToggle ? true : newValue.checked : determineChecked(quantity);
1299
+ const fieldParts = field.split(".");
1300
+ fieldParts.reduce((curr, key, index) => {
1301
+ if (index === fieldParts.length - 1) {
1302
+ curr[key] = {
1303
+ ...currentValues,
1304
+ quantity,
1305
+ checked
1306
+ };
1307
+ }
1308
+ curr[key] ?? (curr[key] = {});
1309
+ return curr[key];
1310
+ }, currentValues);
1311
+ }
1312
+ function convertArrayToPrimitive(values, type) {
1313
+ switch (type) {
1314
+ case "number":
1315
+ return values.map((v) => {
1316
+ if (v === "") {
1317
+ return v;
1318
+ }
1319
+ if (v == null) {
1320
+ return "";
1321
+ }
1322
+ return convertToNumber(v);
1323
+ });
1324
+ case "togglable-number":
1325
+ return values.map(convertToggleableNumber);
1326
+ case "boolean":
1327
+ return values.map(convertToBoolean);
1328
+ case "text":
1329
+ case "multiline-text":
1330
+ return values.map(covertToString);
1331
+ default:
1332
+ throw new Error(`Unsupported target type "${type}".`);
1333
+ }
1334
+ }
1335
+
1336
+ // src/components/data-grid/hooks/use-data-grid-keydown-event.tsx
1337
+ import { useCallback as useCallback9 } from "react";
1338
+ var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
1339
+ var VERTICAL_KEYS = ["ArrowUp", "ArrowDown"];
1340
+ var useDataGridKeydownEvent = ({
1341
+ containerRef,
1342
+ matrix,
1343
+ anchor,
1344
+ rangeEnd,
1345
+ isEditing,
1346
+ setTrapActive,
1347
+ scrollToCoordinates,
1348
+ setSingleRange,
1349
+ setRangeEnd,
1350
+ onEditingChangeHandler,
1351
+ getValues,
1352
+ setValue: setValue2,
1353
+ execute,
1354
+ undo,
1355
+ redo,
1356
+ queryTool,
1357
+ getSelectionValues,
1358
+ setSelectionValues,
1359
+ restoreSnapshot,
1360
+ createSnapshot
1361
+ }) => {
1362
+ const handleKeyboardNavigation = useCallback9(
1363
+ (e) => {
1364
+ if (!anchor) {
1365
+ return;
1366
+ }
1367
+ const type = matrix.getCellType(anchor);
1368
+ if (isEditing && type !== "boolean") {
1369
+ return;
1370
+ }
1371
+ const direction = VERTICAL_KEYS.includes(e.key) ? "vertical" : "horizontal";
1372
+ const basis = direction === "horizontal" ? anchor : e.shiftKey ? rangeEnd : anchor;
1373
+ const updater = direction === "horizontal" ? setSingleRange : e.shiftKey ? setRangeEnd : setSingleRange;
1374
+ if (!basis) {
1375
+ return;
1376
+ }
1377
+ const { row, col } = basis;
1378
+ const handleNavigation = (coords) => {
1379
+ e.preventDefault();
1380
+ e.stopPropagation();
1381
+ scrollToCoordinates(coords, direction);
1382
+ updater(coords);
1383
+ };
1384
+ const next = matrix.getValidMovement(
1385
+ row,
1386
+ col,
1387
+ e.key,
1388
+ e.metaKey || e.ctrlKey
1389
+ );
1390
+ handleNavigation(next);
1391
+ },
1392
+ [
1393
+ isEditing,
1394
+ anchor,
1395
+ rangeEnd,
1396
+ scrollToCoordinates,
1397
+ setSingleRange,
1398
+ setRangeEnd,
1399
+ matrix
1400
+ ]
1401
+ );
1402
+ const handleTabKey = useCallback9(
1403
+ (e) => {
1404
+ if (!anchor) {
1405
+ return;
1406
+ }
1407
+ e.preventDefault();
1408
+ e.stopPropagation();
1409
+ const { row, col } = anchor;
1410
+ const key = e.shiftKey ? "ArrowLeft" : "ArrowRight";
1411
+ const direction = "horizontal";
1412
+ const next = matrix.getValidMovement(
1413
+ row,
1414
+ col,
1415
+ key,
1416
+ e.metaKey || e.ctrlKey
1417
+ );
1418
+ scrollToCoordinates(next, direction);
1419
+ setSingleRange(next);
1420
+ },
1421
+ [anchor, scrollToCoordinates, setSingleRange, matrix]
1422
+ );
1423
+ const handleUndo = useCallback9(
1424
+ (e) => {
1425
+ e.preventDefault();
1426
+ if (e.shiftKey) {
1427
+ redo();
1428
+ return;
1429
+ }
1430
+ undo();
1431
+ },
1432
+ [redo, undo]
1433
+ );
1434
+ const handleSpaceKeyBoolean = useCallback9(
1435
+ (anchor2) => {
1436
+ const end = rangeEnd ?? anchor2;
1437
+ const fields = matrix.getFieldsInSelection(anchor2, end);
1438
+ const prev = getSelectionValues(fields);
1439
+ const allChecked = prev.every((value) => value === true);
1440
+ const next = Array.from({ length: prev.length }, () => !allChecked);
1441
+ const command = new DataGridBulkUpdateCommand({
1442
+ fields,
1443
+ next,
1444
+ prev,
1445
+ setter: setSelectionValues
1446
+ });
1447
+ execute(command);
1448
+ },
1449
+ [rangeEnd, matrix, getSelectionValues, setSelectionValues, execute]
1450
+ );
1451
+ const handleSpaceKeyText = useCallback9(
1452
+ (anchor2) => {
1453
+ const field = matrix.getCellField(anchor2);
1454
+ const input = queryTool?.getInput(anchor2);
1455
+ if (!field || !input) {
1456
+ return;
1457
+ }
1458
+ createSnapshot(anchor2);
1459
+ input.focus();
1460
+ },
1461
+ [matrix, queryTool, createSnapshot]
1462
+ );
1463
+ const handleSpaceKeyNumber = useCallback9(
1464
+ (anchor2) => {
1465
+ const field = matrix.getCellField(anchor2);
1466
+ const input = queryTool?.getInput(anchor2);
1467
+ if (!field || !input) {
1468
+ return;
1469
+ }
1470
+ createSnapshot(anchor2);
1471
+ const current = getValues(field);
1472
+ const next = "";
1473
+ const command = new DataGridUpdateCommand({
1474
+ next,
1475
+ prev: current,
1476
+ setter: (value) => {
1477
+ setValue2(field, value, {
1478
+ shouldDirty: true,
1479
+ shouldTouch: true
1480
+ });
1481
+ }
1482
+ });
1483
+ execute(command);
1484
+ input.focus();
1485
+ },
1486
+ [matrix, queryTool, getValues, execute, setValue2, createSnapshot]
1487
+ );
1488
+ const handleSpaceKeyTogglableNumber = useCallback9(
1489
+ (anchor2) => {
1490
+ const field = matrix.getCellField(anchor2);
1491
+ const input = queryTool?.getInput(anchor2);
1492
+ if (!field || !input) {
1493
+ return;
1494
+ }
1495
+ createSnapshot(anchor2);
1496
+ const current = getValues(field);
1497
+ let checked = current.checked;
1498
+ if (!current.disabledToggle) {
1499
+ checked = false;
1500
+ }
1501
+ const next = { ...current, quantity: "", checked };
1502
+ const command = new DataGridUpdateCommand({
1503
+ next,
1504
+ prev: current,
1505
+ setter: (value) => {
1506
+ setValue2(field, value, {
1507
+ shouldDirty: true,
1508
+ shouldTouch: true
1509
+ });
1510
+ }
1511
+ });
1512
+ execute(command);
1513
+ input.focus();
1514
+ },
1515
+ [matrix, queryTool, getValues, execute, setValue2, createSnapshot]
1516
+ );
1517
+ const handleSpaceKey = useCallback9(
1518
+ (e) => {
1519
+ if (!anchor || isEditing) {
1520
+ return;
1521
+ }
1522
+ e.preventDefault();
1523
+ const type = matrix.getCellType(anchor);
1524
+ if (!type) {
1525
+ return;
1526
+ }
1527
+ switch (type) {
1528
+ case "boolean":
1529
+ handleSpaceKeyBoolean(anchor);
1530
+ break;
1531
+ case "togglable-number":
1532
+ handleSpaceKeyTogglableNumber(anchor);
1533
+ break;
1534
+ case "text":
1535
+ case "multiline-text":
1536
+ handleSpaceKeyText(anchor);
1537
+ break;
1538
+ case "number":
1539
+ handleSpaceKeyNumber(anchor);
1540
+ break;
1541
+ }
1542
+ },
1543
+ [
1544
+ anchor,
1545
+ isEditing,
1546
+ matrix,
1547
+ handleSpaceKeyBoolean,
1548
+ handleSpaceKeyText,
1549
+ handleSpaceKeyNumber,
1550
+ handleSpaceKeyTogglableNumber
1551
+ ]
1552
+ );
1553
+ const handleMoveOnEnter = useCallback9(
1554
+ (e, anchor2) => {
1555
+ const direction = e.shiftKey ? "ArrowUp" : "ArrowDown";
1556
+ const pos = matrix.getValidMovement(
1557
+ anchor2.row,
1558
+ anchor2.col,
1559
+ direction,
1560
+ false
1561
+ );
1562
+ if (anchor2.row !== pos.row || anchor2.col !== pos.col) {
1563
+ setSingleRange(pos);
1564
+ scrollToCoordinates(pos, "vertical");
1565
+ } else {
1566
+ const container = queryTool?.getContainer(anchor2);
1567
+ container?.focus();
1568
+ }
1569
+ onEditingChangeHandler(false);
1570
+ },
1571
+ [
1572
+ queryTool,
1573
+ matrix,
1574
+ scrollToCoordinates,
1575
+ setSingleRange,
1576
+ onEditingChangeHandler
1577
+ ]
1578
+ );
1579
+ const handleEditOnEnter = useCallback9(
1580
+ (anchor2) => {
1581
+ const input = queryTool?.getInput(anchor2);
1582
+ if (!input) {
1583
+ return;
1584
+ }
1585
+ input.focus();
1586
+ onEditingChangeHandler(true);
1587
+ },
1588
+ [queryTool, onEditingChangeHandler]
1589
+ );
1590
+ const handleEnterKeyTextOrNumber = useCallback9(
1591
+ (e, anchor2) => {
1592
+ if (isEditing) {
1593
+ handleMoveOnEnter(e, anchor2);
1594
+ return;
1595
+ }
1596
+ handleEditOnEnter(anchor2);
1597
+ },
1598
+ [handleMoveOnEnter, handleEditOnEnter, isEditing]
1599
+ );
1600
+ const handleEnterKeyMultilineText = useCallback9(
1601
+ (e, anchor2) => {
1602
+ if (isEditing) {
1603
+ if (e.shiftKey) {
1604
+ return;
1605
+ }
1606
+ handleMoveOnEnter(e, anchor2);
1607
+ return;
1608
+ }
1609
+ handleEditOnEnter(anchor2);
1610
+ },
1611
+ [handleMoveOnEnter, handleEditOnEnter, isEditing]
1612
+ );
1613
+ const handleEnterKeyBoolean = useCallback9(
1614
+ (e, anchor2) => {
1615
+ const field = matrix.getCellField(anchor2);
1616
+ if (!field) {
1617
+ return;
1618
+ }
1619
+ const current = getValues(field);
1620
+ let next;
1621
+ if (typeof current === "boolean") {
1622
+ next = !current;
1623
+ } else {
1624
+ next = true;
1625
+ }
1626
+ const command = new DataGridUpdateCommand({
1627
+ next,
1628
+ prev: current,
1629
+ setter: (value) => {
1630
+ setValue2(field, value, {
1631
+ shouldDirty: true,
1632
+ shouldTouch: true
1633
+ });
1634
+ }
1635
+ });
1636
+ execute(command);
1637
+ handleMoveOnEnter(e, anchor2);
1638
+ },
1639
+ [execute, getValues, handleMoveOnEnter, matrix, setValue2]
1640
+ );
1641
+ const handleEnterKey = useCallback9(
1642
+ (e) => {
1643
+ if (!anchor) {
1644
+ return;
1645
+ }
1646
+ const type = matrix.getCellType(anchor);
1647
+ if (type === "multiline-text" && isEditing && e.shiftKey) {
1648
+ return;
1649
+ }
1650
+ e.preventDefault();
1651
+ switch (type) {
1652
+ case "multiline-text":
1653
+ handleEnterKeyMultilineText(e, anchor);
1654
+ break;
1655
+ case "togglable-number":
1656
+ case "text":
1657
+ case "number":
1658
+ handleEnterKeyTextOrNumber(e, anchor);
1659
+ break;
1660
+ case "boolean": {
1661
+ handleEnterKeyBoolean(e, anchor);
1662
+ break;
1663
+ }
1664
+ }
1665
+ },
1666
+ [
1667
+ anchor,
1668
+ matrix,
1669
+ isEditing,
1670
+ handleEnterKeyTextOrNumber,
1671
+ handleEnterKeyBoolean,
1672
+ handleEnterKeyMultilineText
1673
+ ]
1674
+ );
1675
+ const handleDeleteKeyTogglableNumber = useCallback9(
1676
+ (anchor2, rangeEnd2) => {
1677
+ const fields = matrix.getFieldsInSelection(anchor2, rangeEnd2);
1678
+ const prev = getSelectionValues(fields);
1679
+ const next = prev.map((value) => ({
1680
+ ...value,
1681
+ quantity: "",
1682
+ checked: value.disableToggle ? value.checked : false
1683
+ }));
1684
+ const command = new DataGridBulkUpdateCommand({
1685
+ fields,
1686
+ next,
1687
+ prev,
1688
+ setter: setSelectionValues
1689
+ });
1690
+ execute(command);
1691
+ },
1692
+ [matrix, getSelectionValues, setSelectionValues, execute]
1693
+ );
1694
+ const handleDeleteKeyTextOrNumber = useCallback9(
1695
+ (anchor2, rangeEnd2) => {
1696
+ const fields = matrix.getFieldsInSelection(anchor2, rangeEnd2);
1697
+ const prev = getSelectionValues(fields);
1698
+ const next = Array.from({ length: prev.length }, () => "");
1699
+ const command = new DataGridBulkUpdateCommand({
1700
+ fields,
1701
+ next,
1702
+ prev,
1703
+ setter: setSelectionValues
1704
+ });
1705
+ execute(command);
1706
+ },
1707
+ [matrix, getSelectionValues, setSelectionValues, execute]
1708
+ );
1709
+ const handleDeleteKeyBoolean = useCallback9(
1710
+ (anchor2, rangeEnd2) => {
1711
+ const fields = matrix.getFieldsInSelection(anchor2, rangeEnd2);
1712
+ const prev = getSelectionValues(fields);
1713
+ const next = Array.from({ length: prev.length }, () => false);
1714
+ const command = new DataGridBulkUpdateCommand({
1715
+ fields,
1716
+ next,
1717
+ prev,
1718
+ setter: setSelectionValues
1719
+ });
1720
+ execute(command);
1721
+ },
1722
+ [execute, getSelectionValues, matrix, setSelectionValues]
1723
+ );
1724
+ const handleDeleteKey = useCallback9(
1725
+ (e) => {
1726
+ if (!anchor || !rangeEnd || isEditing) {
1727
+ return;
1728
+ }
1729
+ e.preventDefault();
1730
+ const type = matrix.getCellType(anchor);
1731
+ if (!type) {
1732
+ return;
1733
+ }
1734
+ switch (type) {
1735
+ case "text":
1736
+ case "multiline-text":
1737
+ case "number":
1738
+ handleDeleteKeyTextOrNumber(anchor, rangeEnd);
1739
+ break;
1740
+ case "boolean":
1741
+ handleDeleteKeyBoolean(anchor, rangeEnd);
1742
+ break;
1743
+ case "togglable-number":
1744
+ handleDeleteKeyTogglableNumber(anchor, rangeEnd);
1745
+ break;
1746
+ }
1747
+ },
1748
+ [
1749
+ anchor,
1750
+ rangeEnd,
1751
+ isEditing,
1752
+ matrix,
1753
+ handleDeleteKeyTextOrNumber,
1754
+ handleDeleteKeyBoolean,
1755
+ handleDeleteKeyTogglableNumber
1756
+ ]
1757
+ );
1758
+ const handleEscapeKey = useCallback9(
1759
+ (e) => {
1760
+ if (!anchor || !isEditing) {
1761
+ return;
1762
+ }
1763
+ e.preventDefault();
1764
+ e.stopPropagation();
1765
+ restoreSnapshot();
1766
+ const container = queryTool?.getContainer(anchor);
1767
+ container?.focus();
1768
+ },
1769
+ [queryTool, isEditing, anchor, restoreSnapshot]
1770
+ );
1771
+ const handleSpecialFocusKeys = useCallback9(
1772
+ (e) => {
1773
+ if (!containerRef || isEditing) {
1774
+ return;
1775
+ }
1776
+ const focusableElements = getFocusableElements(containerRef);
1777
+ const focusElement = (element) => {
1778
+ if (element) {
1779
+ setTrapActive(false);
1780
+ element.focus();
1781
+ }
1782
+ };
1783
+ switch (e.key) {
1784
+ case ".":
1785
+ focusElement(focusableElements.cancel);
1786
+ break;
1787
+ case ",":
1788
+ focusElement(focusableElements.shortcuts);
1789
+ break;
1790
+ default:
1791
+ break;
1792
+ }
1793
+ },
1794
+ [isEditing, setTrapActive, containerRef]
1795
+ );
1796
+ const handleKeyDownEvent = useCallback9(
1797
+ (e) => {
1798
+ if (ARROW_KEYS.includes(e.key)) {
1799
+ handleKeyboardNavigation(e);
1800
+ return;
1801
+ }
1802
+ if (e.key === "z" && (e.metaKey || e.ctrlKey)) {
1803
+ handleUndo(e);
1804
+ return;
1805
+ }
1806
+ if (e.key === " ") {
1807
+ handleSpaceKey(e);
1808
+ return;
1809
+ }
1810
+ if (e.key === "Delete" || e.key === "Backspace") {
1811
+ handleDeleteKey(e);
1812
+ return;
1813
+ }
1814
+ if (e.key === "Enter") {
1815
+ handleEnterKey(e);
1816
+ return;
1817
+ }
1818
+ if (e.key === "Escape") {
1819
+ handleEscapeKey(e);
1820
+ return;
1821
+ }
1822
+ if (e.key === "Tab") {
1823
+ handleTabKey(e);
1824
+ return;
1825
+ }
1826
+ },
1827
+ [
1828
+ handleEscapeKey,
1829
+ handleKeyboardNavigation,
1830
+ handleUndo,
1831
+ handleSpaceKey,
1832
+ handleEnterKey,
1833
+ handleDeleteKey,
1834
+ handleTabKey
1835
+ ]
1836
+ );
1837
+ return {
1838
+ handleKeyDownEvent,
1839
+ handleSpecialFocusKeys
1840
+ };
1841
+ };
1842
+ function getFocusableElements(ref) {
1843
+ const focusableElements = Array.from(
1844
+ document.querySelectorAll(
1845
+ "[tabindex], a, button, input, select, textarea"
1846
+ )
1847
+ );
1848
+ const currentElementIndex = focusableElements.indexOf(ref.current);
1849
+ const shortcuts = currentElementIndex > 0 ? focusableElements[currentElementIndex - 1] : null;
1850
+ let cancel = null;
1851
+ for (let i = currentElementIndex + 1; i < focusableElements.length; i++) {
1852
+ if (!ref.current.contains(focusableElements[i])) {
1853
+ cancel = focusableElements[i];
1854
+ break;
1855
+ }
1856
+ }
1857
+ return { shortcuts, cancel };
1858
+ }
1859
+
1860
+ // src/components/data-grid/hooks/use-data-grid-mouse-up-event.tsx
1861
+ import { useCallback as useCallback10 } from "react";
1862
+ var useDataGridMouseUpEvent = ({
1863
+ matrix,
1864
+ anchor,
1865
+ dragEnd,
1866
+ setDragEnd,
1867
+ isDragging,
1868
+ setIsDragging,
1869
+ setRangeEnd,
1870
+ setIsSelecting,
1871
+ getSelectionValues,
1872
+ setSelectionValues,
1873
+ execute
1874
+ }) => {
1875
+ const handleDragEnd = useCallback10(() => {
1876
+ if (!isDragging) {
1877
+ return;
1878
+ }
1879
+ if (!anchor || !dragEnd) {
1880
+ return;
1881
+ }
1882
+ const dragSelection = matrix.getFieldsInSelection(anchor, dragEnd);
1883
+ const anchorField = matrix.getCellField(anchor);
1884
+ if (!anchorField || !dragSelection.length) {
1885
+ return;
1886
+ }
1887
+ const anchorValue = getSelectionValues([anchorField]);
1888
+ const fields = dragSelection.filter((field) => field !== anchorField);
1889
+ const prev = getSelectionValues(fields);
1890
+ const next = Array.from({ length: prev.length }, () => anchorValue[0]);
1891
+ const command = new DataGridBulkUpdateCommand({
1892
+ fields,
1893
+ prev,
1894
+ next,
1895
+ setter: setSelectionValues
1896
+ });
1897
+ execute(command);
1898
+ setIsDragging(false);
1899
+ setDragEnd(null);
1900
+ setRangeEnd(dragEnd);
1901
+ }, [
1902
+ isDragging,
1903
+ anchor,
1904
+ dragEnd,
1905
+ matrix,
1906
+ getSelectionValues,
1907
+ setSelectionValues,
1908
+ execute,
1909
+ setIsDragging,
1910
+ setDragEnd,
1911
+ setRangeEnd
1912
+ ]);
1913
+ const handleMouseUpEvent = useCallback10(() => {
1914
+ handleDragEnd();
1915
+ setIsSelecting(false);
1916
+ }, [handleDragEnd, setIsSelecting]);
1917
+ return {
1918
+ handleMouseUpEvent
1919
+ };
1920
+ };
1921
+
1922
+ // src/components/data-grid/hooks/use-data-grid-navigation.tsx
1923
+ import { useCallback as useCallback11 } from "react";
1924
+ var useDataGridNavigation = ({
1925
+ matrix,
1926
+ anchor,
1927
+ visibleColumns,
1928
+ visibleRows,
1929
+ columnVirtualizer,
1930
+ rowVirtualizer,
1931
+ setColumnVisibility,
1932
+ flatColumns,
1933
+ queryTool,
1934
+ setSingleRange
1935
+ }) => {
1936
+ const scrollToCoordinates = useCallback11(
1937
+ (coords, direction) => {
1938
+ if (!anchor) {
1939
+ return;
1940
+ }
1941
+ const { row, col } = coords;
1942
+ const { row: anchorRow, col: anchorCol } = anchor;
1943
+ const rowDirection = row >= anchorRow ? "down" : "up";
1944
+ const colDirection = col >= anchorCol ? "right" : "left";
1945
+ let toRow = rowDirection === "down" ? row + 1 : row - 1;
1946
+ if (visibleRows[toRow] === void 0) {
1947
+ toRow = row;
1948
+ }
1949
+ let toCol = colDirection === "right" ? col + 1 : col - 1;
1950
+ if (visibleColumns[toCol] === void 0) {
1951
+ toCol = col;
1952
+ }
1953
+ const scrollOptions = { align: "auto", behavior: "auto" };
1954
+ if (direction === "horizontal" || direction === "both") {
1955
+ columnVirtualizer.scrollToIndex(toCol, scrollOptions);
1956
+ }
1957
+ if (direction === "vertical" || direction === "both") {
1958
+ rowVirtualizer.scrollToIndex(toRow, scrollOptions);
1959
+ }
1960
+ },
1961
+ [anchor, columnVirtualizer, visibleRows, rowVirtualizer, visibleColumns]
1962
+ );
1963
+ const navigateToField = useCallback11(
1964
+ (field) => {
1965
+ const coords = matrix.getCoordinatesByField(field);
1966
+ if (!coords) {
1967
+ return;
1968
+ }
1969
+ const column = flatColumns[coords.col];
1970
+ setColumnVisibility((prev) => {
1971
+ return {
1972
+ ...prev,
1973
+ [column.id]: true
1974
+ };
1975
+ });
1976
+ requestAnimationFrame(() => {
1977
+ scrollToCoordinates(coords, "both");
1978
+ setSingleRange(coords);
1979
+ });
1980
+ requestAnimationFrame(() => {
1981
+ const input = queryTool?.getInput(coords);
1982
+ if (input) {
1983
+ input.focus();
1984
+ }
1985
+ });
1986
+ },
1987
+ [
1988
+ matrix,
1989
+ flatColumns,
1990
+ setColumnVisibility,
1991
+ scrollToCoordinates,
1992
+ setSingleRange,
1993
+ queryTool
1994
+ ]
1995
+ );
1996
+ return {
1997
+ scrollToCoordinates,
1998
+ navigateToField
1999
+ };
2000
+ };
2001
+
2002
+ // src/components/data-grid/hooks/use-data-grid-query-tool.tsx
2003
+ import { useEffect as useEffect2, useRef as useRef2 } from "react";
2004
+ var useDataGridQueryTool = (containerRef) => {
2005
+ const queryToolRef = useRef2(null);
2006
+ useEffect2(() => {
2007
+ if (containerRef.current) {
2008
+ queryToolRef.current = new DataGridQueryTool(containerRef.current);
2009
+ }
2010
+ }, [containerRef]);
2011
+ return queryToolRef.current;
2012
+ };
2013
+
2014
+ // src/components/data-grid/components/data-grid-cell-container.tsx
2015
+ import { ErrorMessage } from "@hookform/error-message";
2016
+ import { ExclamationCircle } from "@medusajs/icons";
2017
+ import { Tooltip as Tooltip2, clx } from "@medusajs/ui";
2018
+ import { get as get2 } from "react-hook-form";
2019
+
2020
+ // src/components/data-grid/components/data-grid-row-error-indicator.tsx
2021
+ import { Badge, Tooltip } from "@medusajs/ui";
2022
+ import { useTranslation } from "react-i18next";
2023
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
2024
+ var DataGridRowErrorIndicator = ({
2025
+ rowErrors
2026
+ }) => {
2027
+ const rowErrorCount = rowErrors ? rowErrors.length : 0;
2028
+ if (!rowErrors || rowErrorCount <= 0) {
2029
+ return null;
2030
+ }
2031
+ return /* @__PURE__ */ jsx2(
2032
+ Tooltip,
2033
+ {
2034
+ content: /* @__PURE__ */ jsx2("ul", { className: "flex flex-col gap-y-3", children: rowErrors.map((error, index) => /* @__PURE__ */ jsx2(DataGridRowErrorLine, { error }, index)) }),
2035
+ delayDuration: 0,
2036
+ children: /* @__PURE__ */ jsx2(Badge, { color: "red", size: "2xsmall", className: "cursor-default", children: rowErrorCount })
2037
+ }
2038
+ );
2039
+ };
2040
+ var DataGridRowErrorLine = ({
2041
+ error
2042
+ }) => {
2043
+ const { t } = useTranslation();
2044
+ return /* @__PURE__ */ jsxs2("li", { className: "txt-compact-small flex flex-col items-start", children: [
2045
+ error.message,
2046
+ /* @__PURE__ */ jsx2(
2047
+ "button",
2048
+ {
2049
+ type: "button",
2050
+ onClick: error.to,
2051
+ className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover transition-fg",
2052
+ children: t("dataGrid.errors.fixError")
2053
+ }
2054
+ )
2055
+ ] });
2056
+ };
2057
+
2058
+ // src/components/data-grid/components/data-grid-cell-container.tsx
2059
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
2060
+ var DataGridCellContainer = ({
2061
+ isAnchor,
2062
+ isSelected,
2063
+ isDragSelected,
2064
+ field,
2065
+ showOverlay,
2066
+ placeholder,
2067
+ innerProps,
2068
+ overlayProps,
2069
+ children,
2070
+ errors,
2071
+ rowErrors,
2072
+ outerComponent,
2073
+ isMultiLine
2074
+ }) => {
2075
+ const error = get2(errors, field);
2076
+ const hasError = !!error;
2077
+ return /* @__PURE__ */ jsxs3("div", { className: clx("group/container relative h-full w-full"), children: [
2078
+ /* @__PURE__ */ jsxs3(
2079
+ "div",
2080
+ {
2081
+ className: clx(
2082
+ "bg-ui-bg-base group/cell relative flex h-full w-full gap-x-2 px-4 py-2.5 outline-none",
2083
+ {
2084
+ "items-center": !isMultiLine,
2085
+ "items-start": isMultiLine,
2086
+ "bg-ui-tag-red-bg text-ui-tag-red-text": hasError && !isAnchor && !isSelected && !isDragSelected,
2087
+ "ring-ui-bg-interactive ring-2 ring-inset": isAnchor,
2088
+ "bg-ui-bg-highlight [&:has([data-field]:focus)]:bg-ui-bg-base": isSelected || isAnchor,
2089
+ "bg-ui-bg-subtle": isDragSelected && !isAnchor
2090
+ }
2091
+ ),
2092
+ tabIndex: -1,
2093
+ ...innerProps,
2094
+ children: [
2095
+ /* @__PURE__ */ jsx3(
2096
+ ErrorMessage,
2097
+ {
2098
+ name: field,
2099
+ errors,
2100
+ render: ({ message }) => {
2101
+ return /* @__PURE__ */ jsx3("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx3(Tooltip2, { content: message, delayDuration: 0, children: /* @__PURE__ */ jsx3(ExclamationCircle, { className: "text-ui-tag-red-icon z-[3]" }) }) });
2102
+ }
2103
+ }
2104
+ ),
2105
+ /* @__PURE__ */ jsx3(
2106
+ "div",
2107
+ {
2108
+ className: clx("relative z-[1] flex h-full w-full", {
2109
+ "items-center justify-center": !isMultiLine,
2110
+ "items-start": isMultiLine
2111
+ }),
2112
+ children: /* @__PURE__ */ jsx3(RenderChildren, { isAnchor, placeholder, children })
2113
+ }
2114
+ ),
2115
+ /* @__PURE__ */ jsx3(DataGridRowErrorIndicator, { rowErrors }),
2116
+ showOverlay && /* @__PURE__ */ jsx3(
2117
+ "div",
2118
+ {
2119
+ ...overlayProps,
2120
+ "data-cell-overlay": "true",
2121
+ className: "absolute inset-0 z-[2]"
2122
+ }
2123
+ )
2124
+ ]
2125
+ }
2126
+ ),
2127
+ outerComponent
2128
+ ] });
2129
+ };
2130
+ var RenderChildren = ({
2131
+ isAnchor,
2132
+ placeholder,
2133
+ children
2134
+ }) => {
2135
+ if (!isAnchor && placeholder) {
2136
+ return placeholder;
2137
+ }
2138
+ return children;
2139
+ };
2140
+
2141
+ // src/components/data-grid/components/data-grid-boolean-cell.tsx
2142
+ import { jsx as jsx4 } from "react/jsx-runtime";
2143
+ var DataGridBooleanCell = ({
2144
+ context,
2145
+ disabled
2146
+ }) => {
2147
+ const { field, control, renderProps } = useDataGridCell({
2148
+ context
2149
+ });
2150
+ const errorProps = useDataGridCellError({ context });
2151
+ const { container, input } = renderProps;
2152
+ return /* @__PURE__ */ jsx4(
2153
+ Controller,
2154
+ {
2155
+ control,
2156
+ name: field,
2157
+ render: ({ field: field2 }) => {
2158
+ return /* @__PURE__ */ jsx4(DataGridCellContainer, { ...container, ...errorProps, children: /* @__PURE__ */ jsx4(Inner, { field: field2, inputProps: input, disabled }) });
2159
+ }
2160
+ }
2161
+ );
2162
+ };
2163
+ var Inner = ({
2164
+ field,
2165
+ inputProps,
2166
+ disabled
2167
+ }) => {
2168
+ const { ref, value, onBlur, name, disabled: fieldDisabled } = field;
2169
+ const {
2170
+ ref: inputRef,
2171
+ onBlur: onInputBlur,
2172
+ onChange,
2173
+ onFocus,
2174
+ ...attributes
2175
+ } = inputProps;
2176
+ const combinedRefs = useCombinedRefs(ref, inputRef);
2177
+ return /* @__PURE__ */ jsx4(
2178
+ Checkbox,
2179
+ {
2180
+ disabled: disabled || fieldDisabled,
2181
+ name,
2182
+ checked: value,
2183
+ onCheckedChange: (newValue) => onChange(newValue === true, value),
2184
+ onFocus,
2185
+ onBlur: () => {
2186
+ onBlur();
2187
+ onInputBlur();
2188
+ },
2189
+ ref: combinedRefs,
2190
+ tabIndex: -1,
2191
+ ...attributes
2192
+ }
2193
+ );
2194
+ };
2195
+
2196
+ // src/components/data-grid/components/data-grid-currency-cell.tsx
2197
+ import CurrencyInput, {
2198
+ formatValue
2199
+ } from "react-currency-input-field";
2200
+ import { Controller as Controller2 } from "react-hook-form";
2201
+ import { useCallback as useCallback12, useEffect as useEffect3, useState as useState4 } from "react";
2202
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
2203
+ var DataGridCurrencyCell = ({
2204
+ context,
2205
+ code
2206
+ }) => {
2207
+ const { field, control, renderProps } = useDataGridCell({
2208
+ context
2209
+ });
2210
+ const errorProps = useDataGridCellError({ context });
2211
+ const { container, input } = renderProps;
2212
+ const currency = currencies[code.toUpperCase()];
2213
+ return /* @__PURE__ */ jsx5(
2214
+ Controller2,
2215
+ {
2216
+ control,
2217
+ name: field,
2218
+ render: ({ field: field2 }) => {
2219
+ return /* @__PURE__ */ jsx5(DataGridCellContainer, { ...container, ...errorProps, children: /* @__PURE__ */ jsx5(Inner2, { field: field2, inputProps: input, currencyInfo: currency }) });
2220
+ }
2221
+ }
2222
+ );
2223
+ };
2224
+ var Inner2 = ({
2225
+ field,
2226
+ inputProps,
2227
+ currencyInfo
2228
+ }) => {
2229
+ const { value, onChange: _, onBlur, ref, ...rest } = field;
2230
+ const {
2231
+ ref: inputRef,
2232
+ onBlur: onInputBlur,
2233
+ onFocus,
2234
+ onChange,
2235
+ ...attributes
2236
+ } = inputProps;
2237
+ const formatter = useCallback12(
2238
+ (value2) => {
2239
+ const ensuredValue = typeof value2 === "number" ? value2.toString() : value2 || "";
2240
+ return formatValue({
2241
+ value: ensuredValue,
2242
+ decimalScale: currencyInfo.decimal_digits,
2243
+ disableGroupSeparators: true,
2244
+ decimalSeparator: "."
2245
+ });
2246
+ },
2247
+ [currencyInfo]
2248
+ );
2249
+ const [localValue, setLocalValue] = useState4(value || "");
2250
+ const handleValueChange = (value2, _name, _values) => {
2251
+ if (!value2) {
2252
+ setLocalValue("");
2253
+ return;
2254
+ }
2255
+ setLocalValue(value2);
2256
+ };
2257
+ useEffect3(() => {
2258
+ let update = value;
2259
+ if (!isNaN(Number(value))) {
2260
+ update = formatter(update);
2261
+ }
2262
+ setLocalValue(update);
2263
+ }, [value, formatter]);
2264
+ const combinedRed = useCombinedRefs(inputRef, ref);
2265
+ return /* @__PURE__ */ jsxs4("div", { className: "relative flex size-full items-center", children: [
2266
+ /* @__PURE__ */ jsx5(
2267
+ "span",
2268
+ {
2269
+ className: "txt-compact-small text-ui-fg-muted pointer-events-none absolute left-0 w-fit min-w-4",
2270
+ "aria-hidden": true,
2271
+ children: currencyInfo.symbol_native
2272
+ }
2273
+ ),
2274
+ /* @__PURE__ */ jsx5(
2275
+ CurrencyInput,
2276
+ {
2277
+ ...rest,
2278
+ ...attributes,
2279
+ ref: combinedRed,
2280
+ className: "txt-compact-small w-full flex-1 cursor-default appearance-none bg-transparent pl-8 text-right outline-none",
2281
+ value: localValue || void 0,
2282
+ onValueChange: handleValueChange,
2283
+ formatValueOnBlur: true,
2284
+ onBlur: () => {
2285
+ onBlur();
2286
+ onInputBlur();
2287
+ onChange(localValue, value);
2288
+ },
2289
+ onFocus,
2290
+ decimalScale: currencyInfo.decimal_digits,
2291
+ decimalsLimit: currencyInfo.decimal_digits,
2292
+ autoComplete: "off",
2293
+ tabIndex: -1
2294
+ }
2295
+ )
2296
+ ] });
2297
+ };
2298
+
2299
+ // src/components/data-grid/components/data-grid-multiline-cell.tsx
2300
+ import { clx as clx2 } from "@medusajs/ui";
2301
+ import { useCallback as useCallback13, useEffect as useEffect4, useRef as useRef3, useState as useState5 } from "react";
2302
+ import { Controller as Controller3 } from "react-hook-form";
2303
+ import { jsx as jsx6 } from "react/jsx-runtime";
2304
+ var DataGridMultilineCell = ({
2305
+ context
2306
+ }) => {
2307
+ const { field, control, renderProps } = useDataGridCell({
2308
+ context
2309
+ });
2310
+ const errorProps = useDataGridCellError({ context });
2311
+ const { container, input } = renderProps;
2312
+ return /* @__PURE__ */ jsx6(
2313
+ Controller3,
2314
+ {
2315
+ control,
2316
+ name: field,
2317
+ render: ({ field: field2 }) => {
2318
+ return /* @__PURE__ */ jsx6(DataGridCellContainer, { ...container, ...errorProps, isMultiLine: true, children: /* @__PURE__ */ jsx6(Inner3, { field: field2, inputProps: input }) });
2319
+ }
2320
+ }
2321
+ );
2322
+ };
2323
+ var Inner3 = ({
2324
+ field,
2325
+ inputProps
2326
+ }) => {
2327
+ const { onChange: _, onBlur, ref, value, ...rest } = field;
2328
+ const { ref: inputRef, onBlur: onInputBlur, onChange, ...input } = inputProps;
2329
+ const [localValue, setLocalValue] = useState5(value);
2330
+ const textareaRef = useRef3(null);
2331
+ useEffect4(() => {
2332
+ setLocalValue(value);
2333
+ }, [value]);
2334
+ const combinedRefs = useCombinedRefs(inputRef, ref, textareaRef);
2335
+ const adjustTextareaHeight = useCallback13(() => {
2336
+ const textarea = textareaRef.current;
2337
+ if (textarea) {
2338
+ textarea.style.height = "0px";
2339
+ const newHeight = Math.max(textarea.scrollHeight, 24);
2340
+ textarea.style.height = `${newHeight}px`;
2341
+ }
2342
+ }, []);
2343
+ useEffect4(() => {
2344
+ adjustTextareaHeight();
2345
+ }, [localValue, adjustTextareaHeight]);
2346
+ useEffect4(() => {
2347
+ adjustTextareaHeight();
2348
+ const timeoutId = setTimeout(adjustTextareaHeight, 50);
2349
+ return () => clearTimeout(timeoutId);
2350
+ }, [adjustTextareaHeight]);
2351
+ return /* @__PURE__ */ jsx6(
2352
+ "textarea",
2353
+ {
2354
+ className: clx2(
2355
+ "txt-compact-small text-ui-fg-subtle flex w-full cursor-pointer bg-transparent outline-none",
2356
+ "focus:cursor-text",
2357
+ "resize-none overflow-hidden py-2"
2358
+ ),
2359
+ autoComplete: "off",
2360
+ tabIndex: -1,
2361
+ value: localValue ?? "",
2362
+ onChange: (e) => {
2363
+ setLocalValue(e.target.value);
2364
+ adjustTextareaHeight();
2365
+ },
2366
+ ref: combinedRefs,
2367
+ onBlur: () => {
2368
+ onBlur();
2369
+ onInputBlur();
2370
+ onChange(localValue, value);
2371
+ },
2372
+ ...input,
2373
+ ...rest
2374
+ }
2375
+ );
2376
+ };
2377
+
2378
+ // src/components/data-grid/components/data-grid-number-cell.tsx
2379
+ import { clx as clx3 } from "@medusajs/ui";
2380
+ import { useEffect as useEffect5, useState as useState6 } from "react";
2381
+ import { Controller as Controller4 } from "react-hook-form";
2382
+ import { jsx as jsx7 } from "react/jsx-runtime";
2383
+ var DataGridNumberCell = ({
2384
+ context,
2385
+ ...rest
2386
+ }) => {
2387
+ const { field, control, renderProps } = useDataGridCell({
2388
+ context
2389
+ });
2390
+ const errorProps = useDataGridCellError({ context });
2391
+ const { container, input } = renderProps;
2392
+ return /* @__PURE__ */ jsx7(
2393
+ Controller4,
2394
+ {
2395
+ control,
2396
+ name: field,
2397
+ render: ({ field: field2 }) => {
2398
+ return /* @__PURE__ */ jsx7(DataGridCellContainer, { ...container, ...errorProps, children: /* @__PURE__ */ jsx7(Inner4, { field: field2, inputProps: input, ...rest }) });
2399
+ }
2400
+ }
2401
+ );
2402
+ };
2403
+ var Inner4 = ({
2404
+ field,
2405
+ inputProps,
2406
+ ...props
2407
+ }) => {
2408
+ const { ref, value, onChange: _, onBlur, ...fieldProps } = field;
2409
+ const {
2410
+ ref: inputRef,
2411
+ onChange,
2412
+ onBlur: onInputBlur,
2413
+ onFocus,
2414
+ ...attributes
2415
+ } = inputProps;
2416
+ const [localValue, setLocalValue] = useState6(value);
2417
+ useEffect5(() => {
2418
+ setLocalValue(value);
2419
+ }, [value]);
2420
+ const combinedRefs = useCombinedRefs(inputRef, ref);
2421
+ return /* @__PURE__ */ jsx7("div", { className: "size-full", children: /* @__PURE__ */ jsx7(
2422
+ "input",
2423
+ {
2424
+ ref: combinedRefs,
2425
+ value: localValue,
2426
+ onChange: (e) => setLocalValue(e.target.value),
2427
+ onBlur: () => {
2428
+ onBlur();
2429
+ onInputBlur();
2430
+ onChange(localValue, value);
2431
+ },
2432
+ onFocus,
2433
+ type: "number",
2434
+ inputMode: "decimal",
2435
+ className: clx3(
2436
+ "txt-compact-small size-full bg-transparent outline-none",
2437
+ "placeholder:text-ui-fg-muted"
2438
+ ),
2439
+ tabIndex: -1,
2440
+ ...props,
2441
+ ...fieldProps,
2442
+ ...attributes
2443
+ }
2444
+ ) });
2445
+ };
2446
+
2447
+ // src/components/data-grid/components/data-grid-readonly-cell.tsx
2448
+ import { clx as clx4 } from "@medusajs/ui";
2449
+ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
2450
+ var DataGridReadonlyCell = ({
2451
+ context,
2452
+ color = "muted",
2453
+ children,
2454
+ isMultiLine = false
2455
+ }) => {
2456
+ const { rowErrors } = useDataGridCellError({ context });
2457
+ return /* @__PURE__ */ jsxs5(
2458
+ "div",
2459
+ {
2460
+ className: clx4(
2461
+ "txt-compact-small text-ui-fg-subtle flex w-full cursor-not-allowed justify-between overflow-hidden px-4 py-2.5 outline-none",
2462
+ color === "muted" && "bg-ui-bg-subtle",
2463
+ color === "normal" && "bg-ui-bg-base",
2464
+ "h-full items-center"
2465
+ ),
2466
+ children: [
2467
+ /* @__PURE__ */ jsx8(
2468
+ "div",
2469
+ {
2470
+ className: clx4("flex-1", {
2471
+ truncate: !isMultiLine,
2472
+ "whitespace-pre-wrap break-words": isMultiLine
2473
+ }),
2474
+ children
2475
+ }
2476
+ ),
2477
+ /* @__PURE__ */ jsx8(DataGridRowErrorIndicator, { rowErrors })
2478
+ ]
2479
+ }
2480
+ );
2481
+ };
2482
+
2483
+ // src/components/data-grid/components/data-grid-root.tsx
2484
+ import {
2485
+ Adjustments,
2486
+ AdjustmentsDone,
2487
+ ExclamationCircle as ExclamationCircle2
2488
+ } from "@medusajs/icons";
2489
+ import { Button as Button2, DropdownMenu, clx as clx6 } from "@medusajs/ui";
2490
+ import {
2491
+ flexRender,
2492
+ getCoreRowModel,
2493
+ useReactTable
2494
+ } from "@tanstack/react-table";
2495
+ import {
2496
+ useVirtualizer
2497
+ } from "@tanstack/react-virtual";
2498
+ import {
2499
+ useCallback as useCallback15,
2500
+ useEffect as useEffect6,
2501
+ useMemo as useMemo5,
2502
+ useRef as useRef4,
2503
+ useState as useState9
2504
+ } from "react";
2505
+ import { useTranslation as useTranslation3 } from "react-i18next";
2506
+
2507
+ // src/hooks/use-command-history.tsx
2508
+ import { useCallback as useCallback14, useState as useState7 } from "react";
2509
+ var useCommandHistory = (maxHistory = 20) => {
2510
+ const [past, setPast] = useState7([]);
2511
+ const [future, setFuture] = useState7([]);
2512
+ const canUndo = past.length > 0;
2513
+ const canRedo = future.length > 0;
2514
+ const undo = useCallback14(() => {
2515
+ if (!canUndo) {
2516
+ return;
2517
+ }
2518
+ const previous = past[past.length - 1];
2519
+ const newPast = past.slice(0, past.length - 1);
2520
+ previous.undo();
2521
+ setPast(newPast);
2522
+ setFuture([previous, ...future.slice(0, maxHistory - 1)]);
2523
+ }, [canUndo, future, past, maxHistory]);
2524
+ const redo = useCallback14(() => {
2525
+ if (!canRedo) {
2526
+ return;
2527
+ }
2528
+ const next = future[0];
2529
+ const newFuture = future.slice(1);
2530
+ next.redo();
2531
+ setPast([...past, next].slice(0, maxHistory - 1));
2532
+ setFuture(newFuture);
2533
+ }, [canRedo, future, past, maxHistory]);
2534
+ const execute = useCallback14(
2535
+ (command) => {
2536
+ command.execute();
2537
+ setPast((past2) => [...past2, command].slice(0, maxHistory - 1));
2538
+ setFuture([]);
2539
+ },
2540
+ [maxHistory]
2541
+ );
2542
+ return {
2543
+ undo,
2544
+ redo,
2545
+ execute,
2546
+ canUndo,
2547
+ canRedo
2548
+ };
2549
+ };
2550
+
2551
+ // src/components/data-grid/components/data-grid-keyboard-shortcut-modal.tsx
2552
+ import { XMark } from "@medusajs/icons";
2553
+ import {
2554
+ Button,
2555
+ clx as clx5,
2556
+ Heading,
2557
+ IconButton,
2558
+ Input,
2559
+ Kbd,
2560
+ Text
2561
+ } from "@medusajs/ui";
2562
+ import { Dialog as RadixDialog } from "radix-ui";
2563
+ import { useMemo as useMemo4, useState as useState8 } from "react";
2564
+ import { useTranslation as useTranslation2 } from "react-i18next";
2565
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
2566
+ var useDataGridShortcuts = () => {
2567
+ const { t } = useTranslation2();
2568
+ const shortcuts = useMemo4(
2569
+ () => [
2570
+ {
2571
+ label: t("dataGrid.shortcuts.commands.undo"),
2572
+ keys: {
2573
+ Mac: ["\u2318", "Z"],
2574
+ Windows: ["Ctrl", "Z"]
2575
+ }
2576
+ },
2577
+ {
2578
+ label: t("dataGrid.shortcuts.commands.redo"),
2579
+ keys: {
2580
+ Mac: ["\u21E7", "\u2318", "Z"],
2581
+ Windows: ["Shift", "Ctrl", "Z"]
2582
+ }
2583
+ },
2584
+ {
2585
+ label: t("dataGrid.shortcuts.commands.copy"),
2586
+ keys: {
2587
+ Mac: ["\u2318", "C"],
2588
+ Windows: ["Ctrl", "C"]
2589
+ }
2590
+ },
2591
+ {
2592
+ label: t("dataGrid.shortcuts.commands.paste"),
2593
+ keys: {
2594
+ Mac: ["\u2318", "V"],
2595
+ Windows: ["Ctrl", "V"]
2596
+ }
2597
+ },
2598
+ {
2599
+ label: t("dataGrid.shortcuts.commands.edit"),
2600
+ keys: {
2601
+ Mac: ["\u21B5"],
2602
+ Windows: ["Enter"]
2603
+ }
2604
+ },
2605
+ {
2606
+ label: t("dataGrid.shortcuts.commands.delete"),
2607
+ keys: {
2608
+ Mac: ["\u232B"],
2609
+ Windows: ["Backspace"]
2610
+ }
2611
+ },
2612
+ {
2613
+ label: t("dataGrid.shortcuts.commands.clear"),
2614
+ keys: {
2615
+ Mac: ["Space"],
2616
+ Windows: ["Space"]
2617
+ }
2618
+ },
2619
+ {
2620
+ label: t("dataGrid.shortcuts.commands.moveUp"),
2621
+ keys: {
2622
+ Mac: ["\u2191"],
2623
+ Windows: ["\u2191"]
2624
+ }
2625
+ },
2626
+ {
2627
+ label: t("dataGrid.shortcuts.commands.moveDown"),
2628
+ keys: {
2629
+ Mac: ["\u2193"],
2630
+ Windows: ["\u2193"]
2631
+ }
2632
+ },
2633
+ {
2634
+ label: t("dataGrid.shortcuts.commands.moveLeft"),
2635
+ keys: {
2636
+ Mac: ["\u2190"],
2637
+ Windows: ["\u2190"]
2638
+ }
2639
+ },
2640
+ {
2641
+ label: t("dataGrid.shortcuts.commands.moveRight"),
2642
+ keys: {
2643
+ Mac: ["\u2192"],
2644
+ Windows: ["\u2192"]
2645
+ }
2646
+ },
2647
+ {
2648
+ label: t("dataGrid.shortcuts.commands.moveTop"),
2649
+ keys: {
2650
+ Mac: ["\u2318", "\u2191"],
2651
+ Windows: ["Ctrl", "\u2191"]
2652
+ }
2653
+ },
2654
+ {
2655
+ label: t("dataGrid.shortcuts.commands.moveBottom"),
2656
+ keys: {
2657
+ Mac: ["\u2318", "\u2193"],
2658
+ Windows: ["Ctrl", "\u2193"]
2659
+ }
2660
+ },
2661
+ {
2662
+ label: t("dataGrid.shortcuts.commands.selectDown"),
2663
+ keys: {
2664
+ Mac: ["\u21E7", "\u2193"],
2665
+ Windows: ["Shift", "\u2193"]
2666
+ }
2667
+ },
2668
+ {
2669
+ label: t("dataGrid.shortcuts.commands.selectUp"),
2670
+ keys: {
2671
+ Mac: ["\u21E7", "\u2191"],
2672
+ Windows: ["Shift", "\u2191"]
2673
+ }
2674
+ },
2675
+ {
2676
+ label: t("dataGrid.shortcuts.commands.selectColumnDown"),
2677
+ keys: {
2678
+ Mac: ["\u21E7", "\u2318", "\u2193"],
2679
+ Windows: ["Shift", "Ctrl", "\u2193"]
2680
+ }
2681
+ },
2682
+ {
2683
+ label: t("dataGrid.shortcuts.commands.selectColumnUp"),
2684
+ keys: {
2685
+ Mac: ["\u21E7", "\u2318", "\u2191"],
2686
+ Windows: ["Shift", "Ctrl", "\u2191"]
2687
+ }
2688
+ },
2689
+ {
2690
+ label: t("dataGrid.shortcuts.commands.focusToolbar"),
2691
+ keys: {
2692
+ Mac: ["\u2303", "\u2325", ","],
2693
+ Windows: ["Ctrl", "Alt", ","]
2694
+ }
2695
+ },
2696
+ {
2697
+ label: t("dataGrid.shortcuts.commands.focusCancel"),
2698
+ keys: {
2699
+ Mac: ["\u2303", "\u2325", "."],
2700
+ Windows: ["Ctrl", "Alt", "."]
2701
+ }
2702
+ }
2703
+ ],
2704
+ [t]
2705
+ );
2706
+ return shortcuts;
2707
+ };
2708
+ var DataGridKeyboardShortcutModal = ({
2709
+ open,
2710
+ onOpenChange
2711
+ }) => {
2712
+ const { t } = useTranslation2();
2713
+ const [searchValue, onSearchValueChange] = useState8("");
2714
+ const shortcuts = useDataGridShortcuts();
2715
+ const searchResults = useMemo4(() => {
2716
+ return shortcuts.filter(
2717
+ (shortcut) => shortcut.label.toLowerCase().includes(searchValue.toLowerCase())
2718
+ );
2719
+ }, [searchValue, shortcuts]);
2720
+ return /* @__PURE__ */ jsxs6(RadixDialog.Root, { open, onOpenChange, children: [
2721
+ /* @__PURE__ */ jsx9(RadixDialog.Trigger, { asChild: true, children: /* @__PURE__ */ jsx9(Button, { size: "small", variant: "secondary", children: t("dataGrid.shortcuts.label") }) }),
2722
+ /* @__PURE__ */ jsxs6(RadixDialog.Portal, { children: [
2723
+ /* @__PURE__ */ jsx9(
2724
+ RadixDialog.Overlay,
2725
+ {
2726
+ className: clx5(
2727
+ "bg-ui-bg-overlay fixed inset-0",
2728
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
2729
+ )
2730
+ }
2731
+ ),
2732
+ /* @__PURE__ */ jsxs6(RadixDialog.Content, { className: "bg-ui-bg-subtle shadow-elevation-modal fixed left-[50%] top-[50%] flex h-full max-h-[612px] w-full max-w-[560px] translate-x-[-50%] translate-y-[-50%] flex-col divide-y overflow-hidden rounded-lg outline-none", children: [
2733
+ /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-y-3 px-6 py-4", children: [
2734
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between", children: [
2735
+ /* @__PURE__ */ jsxs6("div", { children: [
2736
+ /* @__PURE__ */ jsx9(RadixDialog.Title, { asChild: true, children: /* @__PURE__ */ jsx9(Heading, { children: t("app.menus.user.shortcuts") }) }),
2737
+ /* @__PURE__ */ jsx9(RadixDialog.Description, { className: "sr-only" })
2738
+ ] }),
2739
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-x-2", children: [
2740
+ /* @__PURE__ */ jsx9(Kbd, { children: "esc" }),
2741
+ /* @__PURE__ */ jsx9(RadixDialog.Close, { asChild: true, children: /* @__PURE__ */ jsx9(IconButton, { variant: "transparent", size: "small", children: /* @__PURE__ */ jsx9(XMark, {}) }) })
2742
+ ] })
2743
+ ] }),
2744
+ /* @__PURE__ */ jsx9("div", { children: /* @__PURE__ */ jsx9(
2745
+ Input,
2746
+ {
2747
+ type: "search",
2748
+ value: searchValue,
2749
+ autoFocus: true,
2750
+ onChange: (e) => onSearchValueChange(e.target.value)
2751
+ }
2752
+ ) })
2753
+ ] }),
2754
+ /* @__PURE__ */ jsx9("div", { className: "flex flex-col divide-y overflow-y-auto", children: searchResults.map((shortcut, index) => {
2755
+ return /* @__PURE__ */ jsxs6(
2756
+ "div",
2757
+ {
2758
+ className: "text-ui-fg-subtle flex items-center justify-between px-6 py-3",
2759
+ children: [
2760
+ /* @__PURE__ */ jsx9(Text, { size: "small", children: shortcut.label }),
2761
+ /* @__PURE__ */ jsx9("div", { className: "flex items-center gap-x-1", children: shortcut.keys.Mac?.map((key, index2) => {
2762
+ return /* @__PURE__ */ jsx9("div", { className: "flex items-center gap-x-1", children: /* @__PURE__ */ jsx9(Kbd, { children: key }) }, index2);
2763
+ }) })
2764
+ ]
2765
+ },
2766
+ index
2767
+ );
2768
+ }) })
2769
+ ] })
2770
+ ] })
2771
+ ] });
2772
+ };
2773
+
2774
+ // src/components/data-grid/components/data-grid-root.tsx
2775
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
2776
+ var ROW_HEIGHT = 40;
2777
+ var getCommonPinningStyles = (column) => {
2778
+ const isPinned = column.getIsPinned();
2779
+ const isDarkMode = document.documentElement.classList.contains("dark");
2780
+ const BORDER_COLOR = isDarkMode ? "rgb(50,50,53)" : "rgb(228,228,231)";
2781
+ return {
2782
+ position: isPinned ? "sticky" : "relative",
2783
+ width: column.getSize(),
2784
+ zIndex: isPinned ? 1 : 0,
2785
+ borderBottom: isPinned ? `1px solid ${BORDER_COLOR}` : void 0,
2786
+ borderRight: isPinned ? `1px solid ${BORDER_COLOR}` : void 0,
2787
+ left: isPinned === "left" ? `${column.getStart("left")}px` : void 0,
2788
+ right: isPinned === "right" ? `${column.getAfter("right")}px` : void 0
2789
+ };
2790
+ };
2791
+ var DataGridRoot = ({
2792
+ data = [],
2793
+ columns,
2794
+ state,
2795
+ getSubRows,
2796
+ onEditingChange,
2797
+ disableInteractions,
2798
+ multiColumnSelection = false,
2799
+ showColumnsDropdown = true,
2800
+ totalRowCount,
2801
+ onFetchMore,
2802
+ isFetchingMore,
2803
+ hasNextPage,
2804
+ headerContent
2805
+ }) => {
2806
+ const isLazyMode = totalRowCount !== void 0;
2807
+ const containerRef = useRef4(null);
2808
+ const { redo, undo, execute } = useCommandHistory();
2809
+ const {
2810
+ register,
2811
+ control,
2812
+ getValues,
2813
+ setValue: setValue2,
2814
+ formState: { errors }
2815
+ } = state;
2816
+ const [internalTrapActive, setTrapActive] = useState9(true);
2817
+ const trapActive = !disableInteractions && internalTrapActive;
2818
+ const [anchor, setAnchor] = useState9(null);
2819
+ const [rangeEnd, setRangeEnd] = useState9(null);
2820
+ const [dragEnd, setDragEnd] = useState9(null);
2821
+ const [isSelecting, setIsSelecting] = useState9(false);
2822
+ const [isDragging, setIsDragging] = useState9(false);
2823
+ const [isEditing, setIsEditing] = useState9(false);
2824
+ const [columnVisibility, setColumnVisibility] = useState9({});
2825
+ const [rowVisibility, setRowVisibility] = useState9({});
2826
+ const grid = useReactTable({
2827
+ data,
2828
+ columns,
2829
+ initialState: {
2830
+ columnPinning: {
2831
+ left: [columns[0].id]
2832
+ }
2833
+ },
2834
+ state: {
2835
+ columnVisibility
2836
+ },
2837
+ onColumnVisibilityChange: setColumnVisibility,
2838
+ getSubRows,
2839
+ getCoreRowModel: getCoreRowModel(),
2840
+ defaultColumn: {
2841
+ size: 200,
2842
+ maxSize: 400
2843
+ }
2844
+ });
2845
+ const { flatRows } = grid.getRowModel();
2846
+ const flatColumns = grid.getAllFlatColumns();
2847
+ const visibleRows = useMemo5(
2848
+ () => flatRows.filter((_, index) => rowVisibility?.[index] !== false),
2849
+ [flatRows, rowVisibility]
2850
+ );
2851
+ const visibleColumns = grid.getVisibleLeafColumns();
2852
+ const effectiveRowCount = isLazyMode ? totalRowCount : visibleRows.length;
2853
+ const rowVirtualizer = useVirtualizer({
2854
+ count: effectiveRowCount,
2855
+ estimateSize: () => ROW_HEIGHT,
2856
+ getScrollElement: () => containerRef.current,
2857
+ // Measure actual row heights for dynamic sizing (disabled in Firefox due to measurement issues). Taken from Tanstack
2858
+ measureElement: typeof window !== "undefined" && navigator.userAgent.indexOf("Firefox") === -1 ? (element) => element?.getBoundingClientRect().height : void 0,
2859
+ overscan: 5,
2860
+ rangeExtractor: (range) => {
2861
+ const toRender = new Set(
2862
+ Array.from(
2863
+ { length: range.endIndex - range.startIndex + 1 },
2864
+ (_, i) => range.startIndex + i
2865
+ )
2866
+ );
2867
+ if (anchor && visibleRows[anchor.row]) {
2868
+ toRender.add(anchor.row);
2869
+ }
2870
+ if (rangeEnd && visibleRows[rangeEnd.row]) {
2871
+ toRender.add(rangeEnd.row);
2872
+ }
2873
+ return Array.from(toRender).sort((a, b) => a - b);
2874
+ }
2875
+ });
2876
+ const virtualRows = rowVirtualizer.getVirtualItems();
2877
+ const lazyLoadingRefs = useRef4({
2878
+ onFetchMore,
2879
+ hasNextPage,
2880
+ isFetchingMore,
2881
+ loadedRowCount: visibleRows.length
2882
+ });
2883
+ useEffect6(() => {
2884
+ lazyLoadingRefs.current = {
2885
+ onFetchMore,
2886
+ hasNextPage,
2887
+ isFetchingMore,
2888
+ loadedRowCount: visibleRows.length
2889
+ };
2890
+ }, [onFetchMore, hasNextPage, isFetchingMore, visibleRows.length]);
2891
+ const hasData = visibleRows.length > 0;
2892
+ const handleScroll = useCallback15(() => {
2893
+ const { onFetchMore: onFetchMore2, hasNextPage: hasNextPage2, isFetchingMore: isFetchingMore2, loadedRowCount } = lazyLoadingRefs.current;
2894
+ if (!onFetchMore2 || !hasNextPage2 || isFetchingMore2) {
2895
+ return;
2896
+ }
2897
+ const scrollElement = containerRef.current;
2898
+ const { scrollTop, clientHeight } = scrollElement;
2899
+ const loadedHeight = loadedRowCount * ROW_HEIGHT;
2900
+ const viewportBottom = scrollTop + clientHeight;
2901
+ const fetchThreshold = loadedHeight - ROW_HEIGHT * 10;
2902
+ if (viewportBottom >= fetchThreshold) {
2903
+ onFetchMore2();
2904
+ }
2905
+ }, [lazyLoadingRefs, containerRef]);
2906
+ useEffect6(() => {
2907
+ if (!isLazyMode || !hasData) {
2908
+ return;
2909
+ }
2910
+ const container = containerRef.current;
2911
+ if (!container) {
2912
+ return;
2913
+ }
2914
+ const timeoutId = setTimeout(() => {
2915
+ const scrollElement = containerRef.current;
2916
+ if (!scrollElement) {
2917
+ return;
2918
+ }
2919
+ scrollElement.addEventListener("scroll", handleScroll);
2920
+ }, 100);
2921
+ return () => {
2922
+ clearTimeout(timeoutId);
2923
+ const scrollElement = containerRef.current;
2924
+ scrollElement?.removeEventListener("scroll", handleScroll);
2925
+ };
2926
+ }, [isLazyMode, hasData]);
2927
+ const columnVirtualizer = useVirtualizer({
2928
+ count: visibleColumns.length,
2929
+ estimateSize: (index) => visibleColumns[index].getSize(),
2930
+ getScrollElement: () => containerRef.current,
2931
+ horizontal: true,
2932
+ overscan: 3,
2933
+ rangeExtractor: (range) => {
2934
+ const startIndex = range.startIndex;
2935
+ const endIndex = range.endIndex;
2936
+ const toRender = new Set(
2937
+ Array.from(
2938
+ { length: endIndex - startIndex + 1 },
2939
+ (_, i) => startIndex + i
2940
+ )
2941
+ );
2942
+ if (anchor && visibleColumns[anchor.col]) {
2943
+ toRender.add(anchor.col);
2944
+ }
2945
+ if (rangeEnd && visibleColumns[rangeEnd.col]) {
2946
+ toRender.add(rangeEnd.col);
2947
+ }
2948
+ toRender.add(0);
2949
+ return Array.from(toRender).sort((a, b) => a - b);
2950
+ }
2951
+ });
2952
+ const virtualColumns = columnVirtualizer.getVirtualItems();
2953
+ let virtualPaddingLeft;
2954
+ let virtualPaddingRight;
2955
+ if (columnVirtualizer && virtualColumns?.length) {
2956
+ virtualPaddingLeft = virtualColumns[0]?.start ?? 0;
2957
+ virtualPaddingRight = columnVirtualizer.getTotalSize() - (virtualColumns[virtualColumns.length - 1]?.end ?? 0);
2958
+ }
2959
+ const matrix = useMemo5(
2960
+ () => new DataGridMatrix(
2961
+ flatRows,
2962
+ columns,
2963
+ multiColumnSelection
2964
+ ),
2965
+ [flatRows, columns, multiColumnSelection]
2966
+ );
2967
+ const queryTool = useDataGridQueryTool(containerRef);
2968
+ const setSingleRange = useCallback15(
2969
+ (coordinates) => {
2970
+ setAnchor(coordinates);
2971
+ setRangeEnd(coordinates);
2972
+ },
2973
+ []
2974
+ );
2975
+ const { errorCount, isHighlighted, toggleErrorHighlighting } = useDataGridErrorHighlighting(matrix, grid, errors);
2976
+ const handleToggleErrorHighlighting = useCallback15(() => {
2977
+ toggleErrorHighlighting(
2978
+ rowVisibility,
2979
+ columnVisibility,
2980
+ setRowVisibility,
2981
+ setColumnVisibility
2982
+ );
2983
+ }, [toggleErrorHighlighting, rowVisibility, columnVisibility]);
2984
+ const {
2985
+ columnOptions,
2986
+ handleToggleColumn,
2987
+ handleResetColumns,
2988
+ isDisabled: isColumsDisabled
2989
+ } = useDataGridColumnVisibility(grid, matrix);
2990
+ const handleToggleColumnVisibility = useCallback15(
2991
+ (index) => {
2992
+ return handleToggleColumn(index);
2993
+ },
2994
+ [handleToggleColumn]
2995
+ );
2996
+ const { navigateToField, scrollToCoordinates } = useDataGridNavigation({
2997
+ matrix,
2998
+ queryTool,
2999
+ anchor,
3000
+ columnVirtualizer,
3001
+ rowVirtualizer,
3002
+ flatColumns,
3003
+ setColumnVisibility,
3004
+ setSingleRange,
3005
+ visibleColumns,
3006
+ visibleRows
3007
+ });
3008
+ const { createSnapshot, restoreSnapshot } = useDataGridCellSnapshot({
3009
+ matrix,
3010
+ form: state
3011
+ });
3012
+ const onEditingChangeHandler = useCallback15(
3013
+ (value) => {
3014
+ if (onEditingChange) {
3015
+ onEditingChange(value);
3016
+ }
3017
+ if (value) {
3018
+ createSnapshot(anchor);
3019
+ }
3020
+ setIsEditing(value);
3021
+ },
3022
+ [anchor, createSnapshot, onEditingChange]
3023
+ );
3024
+ const { getSelectionValues, setSelectionValues } = useDataGridFormHandlers({
3025
+ matrix,
3026
+ form: state,
3027
+ anchor
3028
+ });
3029
+ const { handleKeyDownEvent, handleSpecialFocusKeys } = useDataGridKeydownEvent({
3030
+ containerRef,
3031
+ matrix,
3032
+ queryTool,
3033
+ anchor,
3034
+ rangeEnd,
3035
+ isEditing,
3036
+ setTrapActive,
3037
+ setRangeEnd,
3038
+ getSelectionValues,
3039
+ getValues,
3040
+ setSelectionValues,
3041
+ onEditingChangeHandler,
3042
+ restoreSnapshot,
3043
+ createSnapshot,
3044
+ setSingleRange,
3045
+ scrollToCoordinates,
3046
+ execute,
3047
+ undo,
3048
+ redo,
3049
+ setValue: setValue2
3050
+ });
3051
+ const { handleMouseUpEvent } = useDataGridMouseUpEvent({
3052
+ matrix,
3053
+ anchor,
3054
+ dragEnd,
3055
+ setDragEnd,
3056
+ isDragging,
3057
+ setIsDragging,
3058
+ setRangeEnd,
3059
+ setIsSelecting,
3060
+ getSelectionValues,
3061
+ setSelectionValues,
3062
+ execute
3063
+ });
3064
+ const { handleCopyEvent, handlePasteEvent } = useDataGridClipboardEvents({
3065
+ matrix,
3066
+ isEditing,
3067
+ anchor,
3068
+ rangeEnd,
3069
+ getSelectionValues,
3070
+ setSelectionValues,
3071
+ execute
3072
+ });
3073
+ const {
3074
+ getWrapperFocusHandler,
3075
+ getInputChangeHandler,
3076
+ getOverlayMouseDownHandler,
3077
+ getWrapperMouseOverHandler,
3078
+ getIsCellDragSelected,
3079
+ getIsCellSelected,
3080
+ onDragToFillStart
3081
+ } = useDataGridCellHandlers({
3082
+ matrix,
3083
+ anchor,
3084
+ rangeEnd,
3085
+ setRangeEnd,
3086
+ isDragging,
3087
+ setIsDragging,
3088
+ isSelecting,
3089
+ setIsSelecting,
3090
+ setSingleRange,
3091
+ dragEnd,
3092
+ setDragEnd,
3093
+ setValue: setValue2,
3094
+ execute,
3095
+ multiColumnSelection
3096
+ });
3097
+ const { getCellErrorMetadata, getCellMetadata } = useDataGridCellMetadata({
3098
+ matrix
3099
+ });
3100
+ useEffect6(() => {
3101
+ if (!trapActive) {
3102
+ return;
3103
+ }
3104
+ window.addEventListener("keydown", handleKeyDownEvent);
3105
+ window.addEventListener("mouseup", handleMouseUpEvent);
3106
+ window.addEventListener("copy", handleCopyEvent);
3107
+ window.addEventListener("paste", handlePasteEvent);
3108
+ return () => {
3109
+ window.removeEventListener("keydown", handleKeyDownEvent);
3110
+ window.removeEventListener("mouseup", handleMouseUpEvent);
3111
+ window.removeEventListener("copy", handleCopyEvent);
3112
+ window.removeEventListener("paste", handlePasteEvent);
3113
+ };
3114
+ }, [
3115
+ trapActive,
3116
+ handleKeyDownEvent,
3117
+ handleMouseUpEvent,
3118
+ handleCopyEvent,
3119
+ handlePasteEvent
3120
+ ]);
3121
+ useEffect6(() => {
3122
+ const specialFocusHandler = (e) => {
3123
+ if (isSpecialFocusKey(e)) {
3124
+ handleSpecialFocusKeys(e);
3125
+ return;
3126
+ }
3127
+ };
3128
+ window.addEventListener("keydown", specialFocusHandler);
3129
+ return () => {
3130
+ window.removeEventListener("keydown", specialFocusHandler);
3131
+ };
3132
+ }, [handleSpecialFocusKeys]);
3133
+ const handleHeaderInteractionChange = useCallback15((isActive) => {
3134
+ if (isActive) {
3135
+ setTrapActive(false);
3136
+ }
3137
+ }, []);
3138
+ useEffect6(() => {
3139
+ if (!anchor) {
3140
+ return;
3141
+ }
3142
+ if (rangeEnd) {
3143
+ return;
3144
+ }
3145
+ setRangeEnd(anchor);
3146
+ }, [anchor, rangeEnd]);
3147
+ useEffect6(() => {
3148
+ if (!anchor && matrix) {
3149
+ const coords = matrix.getFirstNavigableCell();
3150
+ if (coords) {
3151
+ setSingleRange(coords);
3152
+ }
3153
+ }
3154
+ }, [anchor, matrix, setSingleRange]);
3155
+ const values = useMemo5(
3156
+ () => ({
3157
+ anchor,
3158
+ control,
3159
+ trapActive,
3160
+ errors,
3161
+ setTrapActive,
3162
+ setIsSelecting,
3163
+ setIsEditing: onEditingChangeHandler,
3164
+ setSingleRange,
3165
+ setRangeEnd,
3166
+ getWrapperFocusHandler,
3167
+ getInputChangeHandler,
3168
+ getOverlayMouseDownHandler,
3169
+ getWrapperMouseOverHandler,
3170
+ register,
3171
+ getIsCellSelected,
3172
+ getIsCellDragSelected,
3173
+ getCellMetadata,
3174
+ getCellErrorMetadata,
3175
+ navigateToField
3176
+ }),
3177
+ [
3178
+ anchor,
3179
+ control,
3180
+ trapActive,
3181
+ errors,
3182
+ setTrapActive,
3183
+ setIsSelecting,
3184
+ onEditingChangeHandler,
3185
+ setSingleRange,
3186
+ setRangeEnd,
3187
+ getWrapperFocusHandler,
3188
+ getInputChangeHandler,
3189
+ getOverlayMouseDownHandler,
3190
+ getWrapperMouseOverHandler,
3191
+ register,
3192
+ getIsCellSelected,
3193
+ getIsCellDragSelected,
3194
+ getCellMetadata,
3195
+ getCellErrorMetadata,
3196
+ navigateToField
3197
+ ]
3198
+ );
3199
+ const handleRestoreGridFocus = useCallback15(() => {
3200
+ if (anchor && !trapActive) {
3201
+ setTrapActive(true);
3202
+ setSingleRange(anchor);
3203
+ scrollToCoordinates(anchor, "both");
3204
+ requestAnimationFrame(() => {
3205
+ queryTool?.getContainer(anchor)?.focus();
3206
+ });
3207
+ }
3208
+ }, [anchor, trapActive, setSingleRange, scrollToCoordinates, queryTool]);
3209
+ return /* @__PURE__ */ jsx10(DataGridContext.Provider, { value: values, children: /* @__PURE__ */ jsxs7("div", { className: "bg-ui-bg-subtle flex size-full flex-col", children: [
3210
+ /* @__PURE__ */ jsx10(
3211
+ DataGridHeader,
3212
+ {
3213
+ showColumnsDropdown,
3214
+ columnOptions,
3215
+ isDisabled: isColumsDisabled,
3216
+ onToggleColumn: handleToggleColumnVisibility,
3217
+ errorCount,
3218
+ onToggleErrorHighlighting: handleToggleErrorHighlighting,
3219
+ onResetColumns: handleResetColumns,
3220
+ isHighlighted,
3221
+ onHeaderInteractionChange: handleHeaderInteractionChange,
3222
+ headerContent
3223
+ }
3224
+ ),
3225
+ /* @__PURE__ */ jsx10("div", { className: "size-full overflow-hidden", children: /* @__PURE__ */ jsx10(
3226
+ "div",
3227
+ {
3228
+ ref: containerRef,
3229
+ autoFocus: true,
3230
+ tabIndex: 0,
3231
+ className: "relative h-full select-none overflow-auto outline-none",
3232
+ onFocus: handleRestoreGridFocus,
3233
+ onClick: handleRestoreGridFocus,
3234
+ "data-container": true,
3235
+ role: "application",
3236
+ children: /* @__PURE__ */ jsxs7("div", { role: "grid", className: "text-ui-fg-subtle grid", children: [
3237
+ /* @__PURE__ */ jsx10(
3238
+ "div",
3239
+ {
3240
+ role: "rowgroup",
3241
+ className: "txt-compact-small-plus bg-ui-bg-subtle sticky top-0 z-[1] grid",
3242
+ children: grid.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxs7(
3243
+ "div",
3244
+ {
3245
+ role: "row",
3246
+ className: "flex h-10 w-full",
3247
+ children: [
3248
+ virtualPaddingLeft ? /* @__PURE__ */ jsx10(
3249
+ "div",
3250
+ {
3251
+ role: "presentation",
3252
+ style: { display: "flex", width: virtualPaddingLeft }
3253
+ }
3254
+ ) : null,
3255
+ virtualColumns.reduce((acc, vc, index, array) => {
3256
+ const header = headerGroup.headers[vc.index];
3257
+ const previousVC = array[index - 1];
3258
+ if (previousVC && vc.index !== previousVC.index + 1) {
3259
+ acc.push(
3260
+ /* @__PURE__ */ jsx10(
3261
+ "div",
3262
+ {
3263
+ role: "presentation",
3264
+ style: {
3265
+ display: "flex",
3266
+ width: `${vc.start - previousVC.end}px`
3267
+ }
3268
+ },
3269
+ `padding-${previousVC.index}-${vc.index}`
3270
+ )
3271
+ );
3272
+ }
3273
+ acc.push(
3274
+ /* @__PURE__ */ jsx10(
3275
+ "div",
3276
+ {
3277
+ role: "columnheader",
3278
+ "data-column-index": vc.index,
3279
+ style: {
3280
+ width: header.getSize(),
3281
+ ...getCommonPinningStyles(header.column)
3282
+ },
3283
+ className: "bg-ui-bg-base txt-compact-small-plus flex items-center border-b border-r px-4 py-2.5",
3284
+ children: header.isPlaceholder ? null : flexRender(
3285
+ header.column.columnDef.header,
3286
+ header.getContext()
3287
+ )
3288
+ },
3289
+ header.id
3290
+ )
3291
+ );
3292
+ return acc;
3293
+ }, []),
3294
+ virtualPaddingRight ? /* @__PURE__ */ jsx10(
3295
+ "div",
3296
+ {
3297
+ role: "presentation",
3298
+ style: {
3299
+ display: "flex",
3300
+ width: virtualPaddingRight
3301
+ }
3302
+ }
3303
+ ) : null
3304
+ ]
3305
+ },
3306
+ headerGroup.id
3307
+ ))
3308
+ }
3309
+ ),
3310
+ /* @__PURE__ */ jsx10(
3311
+ "div",
3312
+ {
3313
+ role: "rowgroup",
3314
+ className: "relative grid",
3315
+ style: {
3316
+ height: `${rowVirtualizer.getTotalSize()}px`
3317
+ },
3318
+ children: virtualRows.map((virtualRow) => {
3319
+ const row = visibleRows[virtualRow.index];
3320
+ if (!row) {
3321
+ return /* @__PURE__ */ jsx10(
3322
+ DataGridRowSkeleton,
3323
+ {
3324
+ virtualRow,
3325
+ virtualColumns,
3326
+ virtualPaddingLeft,
3327
+ virtualPaddingRight
3328
+ },
3329
+ `skeleton-${virtualRow.index}`
3330
+ );
3331
+ }
3332
+ const rowIndex = flatRows.findIndex((r) => r.id === row.id);
3333
+ return /* @__PURE__ */ jsx10(
3334
+ DataGridRow,
3335
+ {
3336
+ row,
3337
+ rowIndex,
3338
+ virtualRow,
3339
+ rowVirtualizer,
3340
+ flatColumns,
3341
+ virtualColumns,
3342
+ anchor,
3343
+ virtualPaddingLeft,
3344
+ virtualPaddingRight,
3345
+ onDragToFillStart,
3346
+ multiColumnSelection
3347
+ },
3348
+ row.id
3349
+ );
3350
+ })
3351
+ }
3352
+ )
3353
+ ] })
3354
+ }
3355
+ ) })
3356
+ ] }) });
3357
+ };
3358
+ var DataGridHeader = ({
3359
+ columnOptions,
3360
+ isDisabled,
3361
+ onToggleColumn,
3362
+ onResetColumns,
3363
+ isHighlighted,
3364
+ errorCount,
3365
+ onToggleErrorHighlighting,
3366
+ onHeaderInteractionChange,
3367
+ showColumnsDropdown,
3368
+ headerContent
3369
+ }) => {
3370
+ const [shortcutsOpen, setShortcutsOpen] = useState9(false);
3371
+ const [columnsOpen, setColumnsOpen] = useState9(false);
3372
+ const { t } = useTranslation3();
3373
+ const direction = useDocumentDirection();
3374
+ const hasChanged = columnOptions.some((column) => !column.checked);
3375
+ const handleShortcutsOpenChange = (value) => {
3376
+ onHeaderInteractionChange(value);
3377
+ setShortcutsOpen(value);
3378
+ };
3379
+ const handleColumnsOpenChange = (value) => {
3380
+ onHeaderInteractionChange(value);
3381
+ setColumnsOpen(value);
3382
+ };
3383
+ return /* @__PURE__ */ jsxs7("div", { className: "bg-ui-bg-base flex items-center justify-between border-b p-4", children: [
3384
+ showColumnsDropdown && /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-x-2", children: [
3385
+ /* @__PURE__ */ jsxs7(
3386
+ DropdownMenu,
3387
+ {
3388
+ dir: direction,
3389
+ open: columnsOpen,
3390
+ onOpenChange: handleColumnsOpenChange,
3391
+ children: [
3392
+ /* @__PURE__ */ jsx10(
3393
+ ConditionalTooltip,
3394
+ {
3395
+ showTooltip: isDisabled,
3396
+ content: t("dataGrid.columns.disabled"),
3397
+ children: /* @__PURE__ */ jsx10(DropdownMenu.Trigger, { asChild: true, disabled: isDisabled, children: /* @__PURE__ */ jsxs7(Button2, { size: "small", variant: "secondary", children: [
3398
+ hasChanged ? /* @__PURE__ */ jsx10(AdjustmentsDone, {}) : /* @__PURE__ */ jsx10(Adjustments, {}),
3399
+ t("dataGrid.columns.view")
3400
+ ] }) })
3401
+ }
3402
+ ),
3403
+ /* @__PURE__ */ jsx10(DropdownMenu.Content, { children: columnOptions.map((column, index) => {
3404
+ const { checked, disabled, id, name } = column;
3405
+ if (disabled) {
3406
+ return null;
3407
+ }
3408
+ return /* @__PURE__ */ jsx10(
3409
+ DropdownMenu.CheckboxItem,
3410
+ {
3411
+ checked,
3412
+ onCheckedChange: onToggleColumn(index),
3413
+ onSelect: (e) => e.preventDefault(),
3414
+ children: name
3415
+ },
3416
+ id
3417
+ );
3418
+ }) })
3419
+ ]
3420
+ }
3421
+ ),
3422
+ hasChanged && /* @__PURE__ */ jsx10(
3423
+ Button2,
3424
+ {
3425
+ size: "small",
3426
+ variant: "transparent",
3427
+ type: "button",
3428
+ onClick: onResetColumns,
3429
+ className: "text-ui-fg-muted hover:text-ui-fg-subtle",
3430
+ "data-id": "reset-columns",
3431
+ children: t("dataGrid.columns.resetToDefault")
3432
+ }
3433
+ )
3434
+ ] }),
3435
+ headerContent,
3436
+ /* @__PURE__ */ jsxs7("div", { className: "ml-auto flex items-center gap-x-2", children: [
3437
+ errorCount > 0 && /* @__PURE__ */ jsxs7(
3438
+ Button2,
3439
+ {
3440
+ size: "small",
3441
+ variant: "secondary",
3442
+ type: "button",
3443
+ onClick: onToggleErrorHighlighting,
3444
+ className: clx6({
3445
+ "bg-ui-button-neutral-pressed": isHighlighted
3446
+ }),
3447
+ children: [
3448
+ /* @__PURE__ */ jsx10(ExclamationCircle2, { className: "text-ui-fg-subtle" }),
3449
+ /* @__PURE__ */ jsx10("span", { children: t("dataGrid.errors.count", {
3450
+ count: errorCount
3451
+ }) })
3452
+ ]
3453
+ }
3454
+ ),
3455
+ /* @__PURE__ */ jsx10(
3456
+ DataGridKeyboardShortcutModal,
3457
+ {
3458
+ open: shortcutsOpen,
3459
+ onOpenChange: handleShortcutsOpenChange
3460
+ }
3461
+ )
3462
+ ] })
3463
+ ] });
3464
+ };
3465
+ var DataGridCell = ({
3466
+ cell,
3467
+ columnIndex,
3468
+ rowIndex,
3469
+ anchor,
3470
+ onDragToFillStart,
3471
+ multiColumnSelection
3472
+ }) => {
3473
+ const coords = {
3474
+ row: rowIndex,
3475
+ col: columnIndex
3476
+ };
3477
+ const isAnchor = isCellMatch(coords, anchor);
3478
+ return /* @__PURE__ */ jsx10(
3479
+ "div",
3480
+ {
3481
+ role: "gridcell",
3482
+ "aria-rowindex": rowIndex,
3483
+ "aria-colindex": columnIndex,
3484
+ style: {
3485
+ width: cell.column.getSize(),
3486
+ ...getCommonPinningStyles(cell.column)
3487
+ },
3488
+ "data-row-index": rowIndex,
3489
+ "data-column-index": columnIndex,
3490
+ className: clx6(
3491
+ "relative flex items-stretch border-b border-r p-0 outline-none"
3492
+ ),
3493
+ tabIndex: -1,
3494
+ children: /* @__PURE__ */ jsxs7("div", { className: "relative w-full", children: [
3495
+ flexRender(cell.column.columnDef.cell, {
3496
+ ...cell.getContext(),
3497
+ columnIndex,
3498
+ rowIndex
3499
+ }),
3500
+ isAnchor && /* @__PURE__ */ jsx10(
3501
+ "div",
3502
+ {
3503
+ onMouseDown: onDragToFillStart,
3504
+ className: clx6(
3505
+ "bg-ui-fg-interactive absolute bottom-0 right-0 z-[3] size-1.5 cursor-ns-resize",
3506
+ {
3507
+ "cursor-nwse-resize": multiColumnSelection
3508
+ }
3509
+ )
3510
+ }
3511
+ )
3512
+ ] })
3513
+ }
3514
+ );
3515
+ };
3516
+ var DataGridRow = ({
3517
+ row,
3518
+ rowIndex,
3519
+ virtualRow,
3520
+ rowVirtualizer,
3521
+ virtualPaddingLeft,
3522
+ virtualPaddingRight,
3523
+ virtualColumns,
3524
+ flatColumns,
3525
+ anchor,
3526
+ onDragToFillStart,
3527
+ multiColumnSelection
3528
+ }) => {
3529
+ const visibleCells = row.getVisibleCells();
3530
+ return /* @__PURE__ */ jsxs7(
3531
+ "div",
3532
+ {
3533
+ role: "row",
3534
+ "aria-rowindex": virtualRow.index,
3535
+ "data-index": virtualRow.index,
3536
+ ref: (node) => rowVirtualizer.measureElement(node),
3537
+ style: {
3538
+ transform: `translateY(${virtualRow.start}px)`
3539
+ },
3540
+ className: "bg-ui-bg-subtle txt-compact-small absolute flex min-h-10 w-full",
3541
+ children: [
3542
+ virtualPaddingLeft ? /* @__PURE__ */ jsx10(
3543
+ "div",
3544
+ {
3545
+ role: "presentation",
3546
+ style: { display: "flex", width: virtualPaddingLeft }
3547
+ }
3548
+ ) : null,
3549
+ virtualColumns.reduce((acc, vc, index, array) => {
3550
+ const cell = visibleCells[vc.index];
3551
+ const column = cell.column;
3552
+ const columnIndex = flatColumns.findIndex((c) => c.id === column.id);
3553
+ const previousVC = array[index - 1];
3554
+ if (previousVC && vc.index !== previousVC.index + 1) {
3555
+ acc.push(
3556
+ /* @__PURE__ */ jsx10(
3557
+ "div",
3558
+ {
3559
+ role: "presentation",
3560
+ style: {
3561
+ display: "flex",
3562
+ width: `${vc.start - previousVC.end}px`
3563
+ }
3564
+ },
3565
+ `padding-${previousVC.index}-${vc.index}`
3566
+ )
3567
+ );
3568
+ }
3569
+ acc.push(
3570
+ /* @__PURE__ */ jsx10(
3571
+ DataGridCell,
3572
+ {
3573
+ cell,
3574
+ columnIndex,
3575
+ rowIndex,
3576
+ anchor,
3577
+ onDragToFillStart,
3578
+ multiColumnSelection
3579
+ },
3580
+ cell.id
3581
+ )
3582
+ );
3583
+ return acc;
3584
+ }, []),
3585
+ virtualPaddingRight ? /* @__PURE__ */ jsx10(
3586
+ "div",
3587
+ {
3588
+ role: "presentation",
3589
+ style: { display: "flex", width: virtualPaddingRight }
3590
+ }
3591
+ ) : null
3592
+ ]
3593
+ }
3594
+ );
3595
+ };
3596
+ var DataGridRowSkeleton = ({
3597
+ virtualRow,
3598
+ virtualPaddingLeft,
3599
+ virtualPaddingRight,
3600
+ virtualColumns
3601
+ }) => {
3602
+ return /* @__PURE__ */ jsxs7(
3603
+ "div",
3604
+ {
3605
+ role: "row",
3606
+ "aria-rowindex": virtualRow.index,
3607
+ style: {
3608
+ transform: `translateY(${virtualRow.start}px)`
3609
+ },
3610
+ className: "bg-ui-bg-subtle txt-compact-small absolute flex h-10 w-full",
3611
+ children: [
3612
+ virtualPaddingLeft ? /* @__PURE__ */ jsx10(
3613
+ "div",
3614
+ {
3615
+ role: "presentation",
3616
+ style: { display: "flex", width: virtualPaddingLeft }
3617
+ }
3618
+ ) : null,
3619
+ virtualColumns.map((vc, index, array) => {
3620
+ const previousVC = array[index - 1];
3621
+ const elements = [];
3622
+ if (previousVC && vc.index !== previousVC.index + 1) {
3623
+ elements.push(
3624
+ /* @__PURE__ */ jsx10(
3625
+ "div",
3626
+ {
3627
+ role: "presentation",
3628
+ style: {
3629
+ display: "flex",
3630
+ width: `${vc.start - previousVC.end}px`
3631
+ }
3632
+ },
3633
+ `padding-${previousVC.index}-${vc.index}`
3634
+ )
3635
+ );
3636
+ }
3637
+ elements.push(
3638
+ /* @__PURE__ */ jsx10(
3639
+ "div",
3640
+ {
3641
+ role: "gridcell",
3642
+ style: { width: vc.size },
3643
+ className: "relative flex items-center border-b border-r p-0 outline-none",
3644
+ children: /* @__PURE__ */ jsx10("div", { className: "flex h-full w-full items-center px-4", children: /* @__PURE__ */ jsx10("div", { className: "bg-ui-bg-component h-4 w-3/4 animate-pulse rounded" }) })
3645
+ },
3646
+ `skeleton-cell-${vc.index}`
3647
+ )
3648
+ );
3649
+ return elements;
3650
+ }),
3651
+ virtualPaddingRight ? /* @__PURE__ */ jsx10(
3652
+ "div",
3653
+ {
3654
+ role: "presentation",
3655
+ style: { display: "flex", width: virtualPaddingRight }
3656
+ }
3657
+ ) : null
3658
+ ]
3659
+ }
3660
+ );
3661
+ };
3662
+
3663
+ // src/components/data-grid/components/data-grid-text-cell.tsx
3664
+ import { clx as clx7 } from "@medusajs/ui";
3665
+ import { useEffect as useEffect7, useRef as useRef5, useState as useState10 } from "react";
3666
+ import { Controller as Controller5 } from "react-hook-form";
3667
+ import { jsx as jsx11 } from "react/jsx-runtime";
3668
+ var DataGridTextCell = ({
3669
+ context
3670
+ }) => {
3671
+ const { field, control, renderProps } = useDataGridCell({
3672
+ context
3673
+ });
3674
+ const errorProps = useDataGridCellError({ context });
3675
+ const { container, input } = renderProps;
3676
+ return /* @__PURE__ */ jsx11(
3677
+ Controller5,
3678
+ {
3679
+ control,
3680
+ name: field,
3681
+ render: ({ field: field2 }) => {
3682
+ return /* @__PURE__ */ jsx11(DataGridCellContainer, { ...container, ...errorProps, children: /* @__PURE__ */ jsx11(Inner5, { field: field2, inputProps: input }) });
3683
+ }
3684
+ }
3685
+ );
3686
+ };
3687
+ var Inner5 = ({
3688
+ field,
3689
+ inputProps
3690
+ }) => {
3691
+ const { onChange: _, onBlur, ref, value, ...rest } = field;
3692
+ const { ref: inputRef, onBlur: onInputBlur, onChange, ...input } = inputProps;
3693
+ const [localValue, setLocalValue] = useState10(value);
3694
+ const inputElRef = useRef5(null);
3695
+ useEffect7(() => {
3696
+ setLocalValue(value);
3697
+ }, [value]);
3698
+ const combinedRefs = useCombinedRefs(inputRef, ref, inputElRef);
3699
+ return /* @__PURE__ */ jsx11(
3700
+ "input",
3701
+ {
3702
+ className: clx7(
3703
+ "txt-compact-small text-ui-fg-subtle flex size-full cursor-pointer bg-transparent outline-none",
3704
+ "focus:cursor-text",
3705
+ "items-center justify-center"
3706
+ ),
3707
+ autoComplete: "off",
3708
+ tabIndex: -1,
3709
+ value: localValue ?? "",
3710
+ onChange: (e) => setLocalValue(e.target.value),
3711
+ ref: combinedRefs,
3712
+ onBlur: () => {
3713
+ onBlur();
3714
+ onInputBlur();
3715
+ onChange(localValue, value);
3716
+ },
3717
+ ...input,
3718
+ ...rest
3719
+ }
3720
+ );
3721
+ };
3722
+
3723
+ // src/components/data-grid/components/data-grid-textarea-modal-cell.tsx
3724
+ import { clx as clx8, Textarea } from "@medusajs/ui";
3725
+ import { Popover as RadixPopover } from "radix-ui";
3726
+ import { useCallback as useCallback16, useEffect as useEffect8, useRef as useRef6, useState as useState11 } from "react";
3727
+ import { Controller as Controller6 } from "react-hook-form";
3728
+ import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
3729
+ var DataGridExpandableTextCell = ({
3730
+ context,
3731
+ fieldLabel
3732
+ }) => {
3733
+ const { field, control, renderProps } = useDataGridCell({
3734
+ context
3735
+ });
3736
+ const errorProps = useDataGridCellError({ context });
3737
+ const { container, input } = renderProps;
3738
+ return /* @__PURE__ */ jsx12(
3739
+ Controller6,
3740
+ {
3741
+ control,
3742
+ name: field,
3743
+ render: ({ field: field2 }) => {
3744
+ return /* @__PURE__ */ jsx12(
3745
+ Inner6,
3746
+ {
3747
+ field: field2,
3748
+ inputProps: input,
3749
+ fieldLabel,
3750
+ container,
3751
+ errorProps
3752
+ }
3753
+ );
3754
+ }
3755
+ }
3756
+ );
3757
+ };
3758
+ var Inner6 = ({
3759
+ field,
3760
+ inputProps,
3761
+ fieldLabel: _fieldLabel,
3762
+ container,
3763
+ errorProps
3764
+ }) => {
3765
+ const { onChange: _, onBlur, ref, value, ...rest } = field;
3766
+ const { ref: inputRef, onBlur: onInputBlur, onChange, ...input } = inputProps;
3767
+ const { setSingleRange, anchor } = useDataGridContext();
3768
+ const { row, col } = anchor || { row: 0, col: 0 };
3769
+ const [localValue, setLocalValue] = useState11(value || "");
3770
+ const [isPopoverOpen, setIsPopoverOpen] = useState11(false);
3771
+ const [popoverValue, setPopoverValue] = useState11(value || "");
3772
+ const popoverContentRef = useRef6(null);
3773
+ useEffect8(() => {
3774
+ setLocalValue(value || "");
3775
+ }, [value]);
3776
+ useEffect8(() => {
3777
+ if (isPopoverOpen) {
3778
+ setPopoverValue(value || "");
3779
+ }
3780
+ }, [isPopoverOpen, value]);
3781
+ useEffect8(() => {
3782
+ if (!isPopoverOpen || !popoverContentRef.current) {
3783
+ return;
3784
+ }
3785
+ const handleKeyDownCapture = (e) => {
3786
+ const target = e.target;
3787
+ const isTextarea = target.tagName === "TEXTAREA";
3788
+ const isInPopover = popoverContentRef.current && popoverContentRef.current.contains(target);
3789
+ if (isTextarea || isInPopover) {
3790
+ const dataGridKeys = [
3791
+ "Enter",
3792
+ "Delete",
3793
+ "Backspace",
3794
+ "ArrowUp",
3795
+ "ArrowDown",
3796
+ "ArrowLeft",
3797
+ "ArrowRight",
3798
+ "Tab",
3799
+ " "
3800
+ ];
3801
+ if (dataGridKeys.includes(e.key) && e.key !== "Escape") {
3802
+ e.stopImmediatePropagation();
3803
+ }
3804
+ }
3805
+ };
3806
+ window.addEventListener("keydown", handleKeyDownCapture, true);
3807
+ return () => {
3808
+ window.removeEventListener("keydown", handleKeyDownCapture, true);
3809
+ };
3810
+ }, [isPopoverOpen]);
3811
+ const combinedRefs = useCombinedRefs(inputRef, ref);
3812
+ const handleOverlayMouseDown = useCallback16(
3813
+ (e) => {
3814
+ if (e.detail === 2) {
3815
+ e.preventDefault();
3816
+ e.stopPropagation();
3817
+ setSingleRange({ row, col });
3818
+ setIsPopoverOpen(true);
3819
+ return;
3820
+ }
3821
+ container.overlayProps.onMouseDown?.(e);
3822
+ },
3823
+ [container.overlayProps, setSingleRange, row, col]
3824
+ );
3825
+ const customContainer = {
3826
+ ...container,
3827
+ overlayProps: {
3828
+ ...container.overlayProps,
3829
+ onMouseDown: handleOverlayMouseDown
3830
+ }
3831
+ };
3832
+ const handlePopoverSave = () => {
3833
+ onChange(popoverValue, value);
3834
+ setLocalValue(popoverValue);
3835
+ setIsPopoverOpen(false);
3836
+ onBlur();
3837
+ onInputBlur();
3838
+ };
3839
+ const handlePopoverKeyDown = useCallback16((e) => {
3840
+ if (e.key !== "Escape") {
3841
+ e.stopPropagation();
3842
+ }
3843
+ }, []);
3844
+ const displayValue = localValue || "";
3845
+ const truncatedValue = displayValue.length > 50 ? `${displayValue.substring(0, 50)}...` : displayValue;
3846
+ return /* @__PURE__ */ jsxs8(
3847
+ RadixPopover.Root,
3848
+ {
3849
+ open: isPopoverOpen,
3850
+ onOpenChange: (open) => {
3851
+ if (!open) {
3852
+ handlePopoverSave();
3853
+ } else {
3854
+ setIsPopoverOpen(true);
3855
+ }
3856
+ },
3857
+ children: [
3858
+ /* @__PURE__ */ jsxs8(DataGridCellContainer, { ...customContainer, ...errorProps, children: [
3859
+ /* @__PURE__ */ jsx12(RadixPopover.Anchor, { asChild: true, children: /* @__PURE__ */ jsx12(
3860
+ "div",
3861
+ {
3862
+ className: clx8(
3863
+ "txt-compact-small text-ui-fg-subtle flex size-full cursor-pointer items-center justify-center bg-transparent outline-none",
3864
+ "focus:cursor-text"
3865
+ ),
3866
+ children: /* @__PURE__ */ jsx12("span", { className: "w-full truncate text-center", children: truncatedValue })
3867
+ }
3868
+ ) }),
3869
+ /* @__PURE__ */ jsx12(
3870
+ "input",
3871
+ {
3872
+ className: "sr-only",
3873
+ autoComplete: "off",
3874
+ tabIndex: -1,
3875
+ value: localValue,
3876
+ onChange: (e) => setLocalValue(e.target.value),
3877
+ ref: combinedRefs,
3878
+ onBlur: () => {
3879
+ onBlur();
3880
+ onInputBlur();
3881
+ onChange(localValue, value);
3882
+ },
3883
+ ...input,
3884
+ ...rest
3885
+ }
3886
+ )
3887
+ ] }),
3888
+ /* @__PURE__ */ jsx12(RadixPopover.Portal, { children: /* @__PURE__ */ jsx12(
3889
+ RadixPopover.Content,
3890
+ {
3891
+ className: clx8(
3892
+ "bg-ui-bg-base shadow-elevation-flyout flex max-h-[80vh] w-[600px] overflow-hidden p-0 outline-none"
3893
+ ),
3894
+ align: "start",
3895
+ side: "bottom",
3896
+ sideOffset: -29,
3897
+ alignOffset: -16,
3898
+ collisionPadding: 24,
3899
+ onEscapeKeyDown: handlePopoverSave,
3900
+ onKeyDown: handlePopoverKeyDown,
3901
+ children: /* @__PURE__ */ jsx12("div", { ref: popoverContentRef, className: "h-full w-full", children: /* @__PURE__ */ jsx12(
3902
+ Textarea,
3903
+ {
3904
+ value: popoverValue,
3905
+ onChange: (e) => setPopoverValue(e.target.value),
3906
+ onKeyDown: (e) => {
3907
+ e.stopPropagation();
3908
+ },
3909
+ className: "!bg-ui-bg-base h-full min-h-[300px] w-full resize-none border-0 p-4 !shadow-none focus-visible:!shadow-none"
3910
+ }
3911
+ ) })
3912
+ }
3913
+ ) })
3914
+ ]
3915
+ }
3916
+ );
3917
+ };
3918
+
3919
+ // src/components/data-grid/data-grid.tsx
3920
+ import { jsx as jsx13 } from "react/jsx-runtime";
3921
+ var _DataGrid = ({
3922
+ isLoading,
3923
+ // Lazy loading props - passed through to DataGridRoot
3924
+ totalRowCount,
3925
+ onFetchMore,
3926
+ isFetchingMore,
3927
+ hasNextPage,
3928
+ ...props
3929
+ }) => {
3930
+ return isLoading ? /* @__PURE__ */ jsx13(
3931
+ DataGridSkeleton,
3932
+ {
3933
+ columns: props.columns,
3934
+ rows: props.data?.length && props.data.length > 0 ? props.data.length : 10
3935
+ }
3936
+ ) : /* @__PURE__ */ jsx13(
3937
+ DataGridRoot,
3938
+ {
3939
+ ...props,
3940
+ totalRowCount,
3941
+ onFetchMore,
3942
+ isFetchingMore,
3943
+ hasNextPage
3944
+ }
3945
+ );
3946
+ };
3947
+ var DataGrid = Object.assign(_DataGrid, {
3948
+ BooleanCell: DataGridBooleanCell,
3949
+ TextCell: DataGridTextCell,
3950
+ MultilineCell: DataGridMultilineCell,
3951
+ ExpandableTextCell: DataGridExpandableTextCell,
3952
+ NumberCell: DataGridNumberCell,
3953
+ CurrencyCell: DataGridCurrencyCell,
3954
+ ReadonlyCell: DataGridReadonlyCell
3955
+ });
3956
+
3957
+ // src/components/data-grid/helpers/create-data-grid-column-helper.ts
3958
+ import {
3959
+ createColumnHelper
3960
+ } from "@tanstack/react-table";
3961
+ function createDataGridHelper() {
3962
+ const columnHelper = createColumnHelper();
3963
+ return {
3964
+ column: ({
3965
+ id,
3966
+ name,
3967
+ header,
3968
+ cell,
3969
+ disableHiding = false,
3970
+ field,
3971
+ type,
3972
+ size,
3973
+ minSize,
3974
+ maxSize
3975
+ }) => columnHelper.display({
3976
+ id,
3977
+ header,
3978
+ cell,
3979
+ enableHiding: !disableHiding,
3980
+ size,
3981
+ minSize,
3982
+ maxSize,
3983
+ meta: {
3984
+ name,
3985
+ field,
3986
+ type
3987
+ }
3988
+ })
3989
+ };
3990
+ }
3991
+
3992
+ // src/components/common/tax-badge/tax-badge.tsx
3993
+ import { TaxExclusive, TaxInclusive } from "@medusajs/icons";
3994
+ import { Tooltip as Tooltip3 } from "@medusajs/ui";
3995
+ import { useTranslation as useTranslation4 } from "react-i18next";
3996
+ import { jsx as jsx14 } from "react/jsx-runtime";
3997
+ var IncludesTaxTooltip = ({
3998
+ includesTax
3999
+ }) => {
4000
+ const { t } = useTranslation4();
4001
+ return /* @__PURE__ */ jsx14(
4002
+ Tooltip3,
4003
+ {
4004
+ maxWidth: 999,
4005
+ content: includesTax ? t("general.includesTaxTooltip") : t("general.excludesTaxTooltip"),
4006
+ children: includesTax ? /* @__PURE__ */ jsx14(TaxInclusive, { className: "text-ui-fg-muted shrink-0" }) : /* @__PURE__ */ jsx14(TaxExclusive, { className: "text-ui-fg-muted shrink-0" })
4007
+ }
4008
+ );
4009
+ };
4010
+
4011
+ // src/components/data-grid/helpers/create-data-grid-price-columns.tsx
4012
+ import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
4013
+ var createDataGridPriceColumns = ({
4014
+ currencies: currencies2,
4015
+ regions,
4016
+ pricePreferences,
4017
+ isReadyOnly,
4018
+ getFieldName,
4019
+ t
4020
+ }) => {
4021
+ const columnHelper = createDataGridHelper();
4022
+ return [
4023
+ ...currencies2?.map((currency) => {
4024
+ const preference = pricePreferences?.find(
4025
+ (p) => p.attribute === "currency_code" && p.value === currency
4026
+ );
4027
+ const translatedCurrencyName = t("fields.priceTemplate", {
4028
+ regionOrCurrency: currency.toUpperCase()
4029
+ });
4030
+ return columnHelper.column({
4031
+ id: `currency_prices.${currency}`,
4032
+ name: t("fields.priceTemplate", {
4033
+ regionOrCurrency: currency.toUpperCase()
4034
+ }),
4035
+ field: (context) => {
4036
+ const isReadyOnlyValue = isReadyOnly?.(context);
4037
+ if (isReadyOnlyValue) {
4038
+ return null;
4039
+ }
4040
+ return getFieldName(context, currency);
4041
+ },
4042
+ type: "number",
4043
+ header: () => /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center justify-between gap-3", children: [
4044
+ /* @__PURE__ */ jsx15("span", { className: "truncate", title: translatedCurrencyName, children: translatedCurrencyName }),
4045
+ /* @__PURE__ */ jsx15(IncludesTaxTooltip, { includesTax: preference?.is_tax_inclusive })
4046
+ ] }),
4047
+ cell: (context) => {
4048
+ if (isReadyOnly?.(context)) {
4049
+ return /* @__PURE__ */ jsx15(DataGridReadonlyCell, { context });
4050
+ }
4051
+ return /* @__PURE__ */ jsx15(DataGridCurrencyCell, { code: currency, context });
4052
+ }
4053
+ });
4054
+ }) ?? [],
4055
+ ...regions?.map((region) => {
4056
+ const preference = pricePreferences?.find(
4057
+ (p) => p.attribute === "region_id" && p.value === region.id
4058
+ );
4059
+ const translatedRegionName = t("fields.priceTemplate", {
4060
+ regionOrCurrency: region.name
4061
+ });
4062
+ return columnHelper.column({
4063
+ id: `region_prices.${region.id}`,
4064
+ name: t("fields.priceTemplate", {
4065
+ regionOrCurrency: region.name
4066
+ }),
4067
+ field: (context) => {
4068
+ const isReadyOnlyValue = isReadyOnly?.(context);
4069
+ if (isReadyOnlyValue) {
4070
+ return null;
4071
+ }
4072
+ return getFieldName(context, region.id);
4073
+ },
4074
+ type: "number",
4075
+ header: () => /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center justify-between gap-3", children: [
4076
+ /* @__PURE__ */ jsx15("span", { className: "truncate", title: translatedRegionName, children: translatedRegionName }),
4077
+ /* @__PURE__ */ jsx15(IncludesTaxTooltip, { includesTax: preference?.is_tax_inclusive })
4078
+ ] }),
4079
+ cell: (context) => {
4080
+ if (isReadyOnly?.(context)) {
4081
+ return /* @__PURE__ */ jsx15(DataGridReadonlyCell, { context });
4082
+ }
4083
+ const currency = currencies2?.find((c) => c === region.currency_code);
4084
+ if (!currency) {
4085
+ return null;
4086
+ }
4087
+ return /* @__PURE__ */ jsx15(
4088
+ DataGridCurrencyCell,
4089
+ {
4090
+ code: region.currency_code,
4091
+ context
4092
+ }
4093
+ );
4094
+ }
4095
+ });
4096
+ }) ?? []
4097
+ ];
4098
+ };
4099
+
4100
+ export {
4101
+ useCombinedRefs,
4102
+ useDataGridCell,
4103
+ useDataGridCellError,
4104
+ useDataGridDuplicateCell,
4105
+ DataGridCellContainer,
4106
+ DataGridReadonlyCell,
4107
+ DataGridSkeleton,
4108
+ DataGrid,
4109
+ createDataGridHelper,
4110
+ IncludesTaxTooltip,
4111
+ createDataGridPriceColumns
4112
+ };