@mercurjs/admin 2.3.7-canary.0 → 2.3.7

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 (120) hide show
  1. package/dist/{add-campaign-promotions-HHMISUZB.js → add-campaign-promotions-6BYWL6AA.js} +1 -1
  2. package/dist/{api-key-management-list-D3W4HEBM.js → api-key-management-list-7L7OLDGO.js} +2 -2
  3. package/dist/{attribute-detail-4B2P7UFG.js → attribute-detail-5AB2NEZE.js} +1 -1
  4. package/dist/{attribute-list-TZH5MVDT.js → attribute-list-QPJM77HR.js} +2 -2
  5. package/dist/{campaign-detail-W57XZ472.js → campaign-detail-VT62HOSX.js} +2 -2
  6. package/dist/{campaign-list-QVXUWMO5.js → campaign-list-4UPMYKLS.js} +2 -2
  7. package/dist/{category-detail-T27AGZ6B.js → category-detail-WM5PKZHS.js} +2 -2
  8. package/dist/{category-list-F6ZFHTGZ.js → category-list-67JSNVXT.js} +2 -2
  9. package/dist/{category-products-UE5Y3VG3.js → category-products-RYOQ5TM5.js} +1 -1
  10. package/dist/{chunk-W76OQ4UW.js → chunk-2D5NZTA6.js} +1 -1
  11. package/dist/chunk-35TFC2OI.js +210 -0
  12. package/dist/{chunk-OIMNVZDF.js → chunk-37GE6N5V.js} +1 -1
  13. package/dist/{chunk-DL3P6W63.js → chunk-4NMCASJ4.js} +1 -1
  14. package/dist/{chunk-OIWWUZDL.js → chunk-64EWPXUL.js} +1 -1
  15. package/dist/{chunk-K6WZ5WW5.js → chunk-66YS5LUL.js} +1 -1
  16. package/dist/{chunk-46WZTQ36.js → chunk-6QXWDLBA.js} +1 -1
  17. package/dist/{chunk-FCV5FSUM.js → chunk-7CNMMPNC.js} +1 -1
  18. package/dist/{chunk-BIL56N3K.js → chunk-7WTDVMPJ.js} +1 -1
  19. package/dist/{chunk-F6OU2QCY.js → chunk-7ZFSINKL.js} +1 -1
  20. package/dist/{chunk-SU36MZXC.js → chunk-AJZPQDDW.js} +12 -4
  21. package/dist/{chunk-DM52HEOD.js → chunk-BJCD2G3U.js} +1 -1
  22. package/dist/{chunk-YIFUH266.js → chunk-BRC3VJXF.js} +1 -1
  23. package/dist/{chunk-EHNOBH5I.js → chunk-CDFZKJSC.js} +1 -1
  24. package/dist/{chunk-AXCRJBUY.js → chunk-D7PXCIZX.js} +1 -1
  25. package/dist/{chunk-EP5CUH4C.js → chunk-FVC2Z3LR.js} +1 -1
  26. package/dist/{chunk-ATZPWIEI.js → chunk-GF4BJFSQ.js} +1 -1
  27. package/dist/{chunk-6A4PFRRO.js → chunk-GIFVQPFT.js} +1 -1
  28. package/dist/{chunk-D2VI737U.js → chunk-IG6ODEES.js} +1 -1
  29. package/dist/{chunk-GMJLK3IK.js → chunk-JOIE6CIR.js} +20 -1
  30. package/dist/{chunk-X6NX7BIG.js → chunk-MXIRZGYW.js} +1 -1
  31. package/dist/{chunk-4CGY6T44.js → chunk-NGYIAHMG.js} +1 -1
  32. package/dist/{chunk-22WJ7M7K.js → chunk-O3JRFTHJ.js} +1 -1
  33. package/dist/{chunk-AR3A6ZV4.js → chunk-O4L5V6TE.js} +1 -1
  34. package/dist/{chunk-6BX43GXE.js → chunk-ODBRDDOZ.js} +1 -1
  35. package/dist/{chunk-YQUS4QOS.js → chunk-OHL76ICJ.js} +1 -1
  36. package/dist/{chunk-BB4C372O.js → chunk-OHTFAHSD.js} +1 -1
  37. package/dist/{chunk-PQJ2KGLD.js → chunk-PFP6ZXLY.js} +2 -2
  38. package/dist/{chunk-AAVL5MJC.js → chunk-PTE652T6.js} +1 -1
  39. package/dist/{chunk-HZ4ADOD4.js → chunk-PTEWKH52.js} +1 -1
  40. package/dist/{chunk-MXMLUPAQ.js → chunk-Q254WWFS.js} +1 -1
  41. package/dist/{chunk-FHZ6TGFK.js → chunk-Q2ZJOBFJ.js} +1 -1
  42. package/dist/{chunk-6HHWBWQS.js → chunk-QHWI5KGN.js} +1 -1
  43. package/dist/{chunk-XZ2I74IZ.js → chunk-QPMAY54N.js} +1 -1
  44. package/dist/{chunk-MBSBOJFI.js → chunk-T3IV6KW3.js} +1 -1
  45. package/dist/{chunk-NRR55ZC2.js → chunk-UUQEZYGA.js} +1 -1
  46. package/dist/{chunk-5R457J2W.js → chunk-V2N6JLWD.js} +1 -1
  47. package/dist/{chunk-WXZYC4LI.js → chunk-V6OUOIBQ.js} +1 -1
  48. package/dist/{chunk-TSYSLFEE.js → chunk-VHO5PEEO.js} +1 -1
  49. package/dist/{chunk-NJAKCRO2.js → chunk-WDTE56OU.js} +1 -1
  50. package/dist/{chunk-AMRK755L.js → chunk-WISQFAJG.js} +177 -176
  51. package/dist/{chunk-CGKIYXZ6.js → chunk-WUCZ7VH3.js} +1 -1
  52. package/dist/{chunk-GOHCQWAJ.js → chunk-Y3P5VQ64.js} +1 -1
  53. package/dist/{chunk-AHRICJVV.js → chunk-YRMMQMSK.js} +1 -1
  54. package/dist/{chunk-TVCHVG2A.js → chunk-YZ7TYYVL.js} +1 -1
  55. package/dist/{chunk-J7FYKWJU.js → chunk-ZCPG6OV7.js} +1 -1
  56. package/dist/{chunk-R7LXMTIT.js → chunk-ZPKQWWCF.js} +2 -2
  57. package/dist/{chunk-QE36PNTV.js → chunk-ZQMCTQ2T.js} +1 -1
  58. package/dist/{collection-add-products-VNSPLNGL.js → collection-add-products-YQP5YOZO.js} +1 -1
  59. package/dist/{collection-detail-2XGAQMMS.js → collection-detail-IQV54EVJ.js} +2 -2
  60. package/dist/{collection-list-D23O4C7N.js → collection-list-Z7IA57OF.js} +2 -2
  61. package/dist/{commissions-list-ENJJOKHU.js → commissions-list-4MRDFAN6.js} +2 -2
  62. package/dist/{customer-detail-DROF3TFM.js → customer-detail-KOWSLCSV.js} +4 -3
  63. package/dist/{customer-group-add-customers-BRAX5VEC.js → customer-group-add-customers-KF432FE3.js} +1 -1
  64. package/dist/{customer-group-detail-7SRN7XGR.js → customer-group-detail-KYEP2WK5.js} +2 -2
  65. package/dist/{customer-group-list-3UV4JFIC.js → customer-group-list-GOAFY7WR.js} +2 -2
  66. package/dist/{customer-list-IF5HB6CU.js → customer-list-NVJX3U6Z.js} +2 -2
  67. package/dist/{customers-add-customer-group-7XSK3ZI6.js → customers-add-customer-group-CAPDOFBQ.js} +1 -1
  68. package/dist/index.d.ts +7 -0
  69. package/dist/index.js +86 -86
  70. package/dist/{inventory-detail-YMY427YA.js → inventory-detail-5MBZ3WUH.js} +2 -2
  71. package/dist/{inventory-list-RNA7PFS5.js → inventory-list-PUHEUY6U.js} +2 -2
  72. package/dist/{location-fulfillment-providers-RI6OE65I.js → location-fulfillment-providers-RHFROGUA.js} +1 -1
  73. package/dist/{location-service-zone-create-Y3QEVCV2.js → location-service-zone-create-76EAFAJQ.js} +2 -2
  74. package/dist/{location-service-zone-manage-areas-7GT26QCN.js → location-service-zone-manage-areas-AU6O2R7D.js} +2 -2
  75. package/dist/{marketplace-add-currencies-2LCP4XJV.js → marketplace-add-currencies-LP54QP2F.js} +1 -1
  76. package/dist/{marketplace-detail-J7GVUZ7T.js → marketplace-detail-XIWEU2BP.js} +2 -2
  77. package/dist/{offer-detail-page-3H5APJUL.js → offer-detail-page-XNA63LSW.js} +2 -2
  78. package/dist/{offer-variant-detail-page-V6MP4SDN.js → offer-variant-detail-page-UATB4UIF.js} +2 -2
  79. package/dist/{offers-V4LY624Q.js → offers-3VVLBXXT.js} +1 -1
  80. package/dist/{order-create-claim-HRKNY4UI.js → order-create-claim-SA7G3BF7.js} +1 -1
  81. package/dist/{order-create-edit-LRHRGV4I.js → order-create-edit-MTLZ4MH6.js} +1 -1
  82. package/dist/{order-create-exchange-O23CVHIT.js → order-create-exchange-EY5GJP46.js} +1 -1
  83. package/dist/{order-create-return-R7YVDNVA.js → order-create-return-A7F4OQUD.js} +1 -1
  84. package/dist/{order-detail-56D3JKHO.js → order-detail-RJFKE5JR.js} +2 -2
  85. package/dist/{order-list-WJBA7YQN.js → order-list-V5SXVY4C.js} +4 -3
  86. package/dist/pages/index.js +45 -45
  87. package/dist/{payout-list-RYMCSVCT.js → payout-list-J5QBFBDQ.js} +2 -2
  88. package/dist/{price-list-create-UM63JWQQ.js → price-list-create-M7DT7DIB.js} +2 -2
  89. package/dist/{price-list-detail-G74QPX4O.js → price-list-detail-K5GT75MR.js} +2 -2
  90. package/dist/{price-list-list-IRVQYOHC.js → price-list-list-RVA2BXQB.js} +2 -2
  91. package/dist/{price-list-prices-add-H2MEQ2QR.js → price-list-prices-add-MNDRESKR.js} +2 -2
  92. package/dist/{product-create-WNSDDRLU.js → product-create-UZOSX5CO.js} +3 -3
  93. package/dist/{product-detail-3BCNKITT.js → product-detail-P5TG7T7B.js} +2 -2
  94. package/dist/{product-list-7CP6FHMX.js → product-list-YDYL765G.js} +2 -2
  95. package/dist/{product-media-SHV2VX7L.js → product-media-K2EC5Z2P.js} +1 -1
  96. package/dist/{product-tag-detail-LIAIYUDS.js → product-tag-detail-VJW4TMI6.js} +2 -2
  97. package/dist/{product-tag-list-BHRUK7QW.js → product-tag-list-ZF44FBU3.js} +2 -2
  98. package/dist/{product-type-detail-2K3HSKEC.js → product-type-detail-O5MQCKY2.js} +2 -2
  99. package/dist/{product-type-list-QA4OOOCL.js → product-type-list-B6RRMREU.js} +2 -2
  100. package/dist/{promotion-list-FXWF6U3M.js → promotion-list-AKK3OZJO.js} +2 -2
  101. package/dist/{region-add-countries-DV54R2PN.js → region-add-countries-IA2HWUQX.js} +1 -1
  102. package/dist/{region-create-CJM7NXOM.js → region-create-HRJDZSAK.js} +1 -1
  103. package/dist/{region-detail-3RF2GD3W.js → region-detail-UDNWHURY.js} +2 -2
  104. package/dist/{region-list-3QKAMIKS.js → region-list-QQ3XRZBU.js} +2 -2
  105. package/dist/{reservation-list-X4C45DYL.js → reservation-list-FJEIO3S2.js} +2 -2
  106. package/dist/{return-reason-list-OKMBV3IZ.js → return-reason-list-3PS25BKE.js} +2 -2
  107. package/dist/{review-list-M7LNFCKQ.js → review-list-TWXSIZOP.js} +2 -2
  108. package/dist/{sales-channel-add-products-Q6TSFJKU.js → sales-channel-add-products-KC4RYJT3.js} +1 -1
  109. package/dist/{sales-channel-detail-IISFMMEN.js → sales-channel-detail-2NIKTQNB.js} +2 -2
  110. package/dist/{shipping-option-type-list-TR3OGBEP.js → shipping-option-type-list-SC3AKZ3A.js} +2 -2
  111. package/dist/{shipping-profiles-list-WJI2DCLN.js → shipping-profiles-list-OC45TR2L.js} +2 -2
  112. package/dist/{store-details-GR4XNG6J.js → store-details-CGAKQDWN.js} +2 -2
  113. package/dist/{store-edit-JMRDCFIC.js → store-edit-XBWOY5CE.js} +1 -1
  114. package/dist/{store-list-6UMZQV5N.js → store-list-7FX5VPU2.js} +2 -2
  115. package/dist/{tax-region-tax-override-create-WPCZ47CE.js → tax-region-tax-override-create-5FUN3FYU.js} +2 -2
  116. package/dist/{tax-region-tax-override-edit-O5CTVPCG.js → tax-region-tax-override-edit-AGHJ76KK.js} +2 -2
  117. package/dist/{user-invite-S3SL2HJF.js → user-invite-DMUC4EQ4.js} +1 -1
  118. package/dist/{user-list-7P2ZSQGM.js → user-list-ZK63T6SJ.js} +2 -2
  119. package/package.json +6 -6
  120. package/dist/chunk-W7TEZYU7.js +0 -98
@@ -26,7 +26,7 @@ import "./chunk-FQERBIVS.js";
26
26
  import {
27
27
  _DataTable,
28
28
  useDataTable
29
- } from "./chunk-SU36MZXC.js";
29
+ } from "./chunk-AJZPQDDW.js";
30
30
  import "./chunk-YN3FGNJM.js";
31
31
  import "./chunk-ZAOEFQ6K.js";
32
32
  import "./chunk-4J74G7N2.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ApiKeyManagementListPage
3
- } from "./chunk-J7FYKWJU.js";
3
+ } from "./chunk-ZCPG6OV7.js";
4
4
  import "./chunk-XFR5JLNF.js";
5
5
  import "./chunk-F3XPA5ID.js";
6
6
  import "./chunk-JHIMVLB2.js";
@@ -11,7 +11,7 @@ import "./chunk-E74OUNA3.js";
11
11
  import "./chunk-H6MYB7GB.js";
12
12
  import "./chunk-THHRRYRS.js";
13
13
  import "./chunk-FQERBIVS.js";
14
- import "./chunk-SU36MZXC.js";
14
+ import "./chunk-AJZPQDDW.js";
15
15
  import "./chunk-YN3FGNJM.js";
16
16
  import "./chunk-ZAOEFQ6K.js";
17
17
  import "./chunk-4J74G7N2.js";
@@ -20,7 +20,7 @@ import "./chunk-FQERBIVS.js";
20
20
  import {
21
21
  _DataTable,
22
22
  useDataTable
23
- } from "./chunk-SU36MZXC.js";
23
+ } from "./chunk-AJZPQDDW.js";
24
24
  import "./chunk-YN3FGNJM.js";
25
25
  import "./chunk-ZAOEFQ6K.js";
26
26
  import {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  AttributeListPage,
3
3
  attributeListLoader
4
- } from "./chunk-MBSBOJFI.js";
4
+ } from "./chunk-T3IV6KW3.js";
5
5
  import "./chunk-JHIMVLB2.js";
6
6
  import "./chunk-PHOCVOZ5.js";
7
7
  import "./chunk-RT6L7JXU.js";
@@ -11,7 +11,7 @@ import "./chunk-E74OUNA3.js";
11
11
  import "./chunk-H6MYB7GB.js";
12
12
  import "./chunk-THHRRYRS.js";
13
13
  import "./chunk-FQERBIVS.js";
14
- import "./chunk-SU36MZXC.js";
14
+ import "./chunk-AJZPQDDW.js";
15
15
  import "./chunk-YN3FGNJM.js";
16
16
  import "./chunk-ZAOEFQ6K.js";
17
17
  import "./chunk-4J74G7N2.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CAMPAIGN_DETAIL_FIELDS,
3
3
  CampaignDetailPage
4
- } from "./chunk-6HHWBWQS.js";
4
+ } from "./chunk-QHWI5KGN.js";
5
5
  import "./chunk-WP3B4NEU.js";
6
6
  import "./chunk-7CGMFCSU.js";
7
7
  import "./chunk-FB2PJHN5.js";
@@ -17,7 +17,7 @@ import "./chunk-E74OUNA3.js";
17
17
  import "./chunk-H6MYB7GB.js";
18
18
  import "./chunk-THHRRYRS.js";
19
19
  import "./chunk-FQERBIVS.js";
20
- import "./chunk-SU36MZXC.js";
20
+ import "./chunk-AJZPQDDW.js";
21
21
  import "./chunk-YN3FGNJM.js";
22
22
  import "./chunk-ZAOEFQ6K.js";
23
23
  import "./chunk-4J74G7N2.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CampaignListPage
3
- } from "./chunk-D2VI737U.js";
3
+ } from "./chunk-IG6ODEES.js";
4
4
  import "./chunk-7VO6VJZJ.js";
5
5
  import "./chunk-WP3B4NEU.js";
6
6
  import "./chunk-LISOKQBZ.js";
@@ -12,7 +12,7 @@ import "./chunk-E74OUNA3.js";
12
12
  import "./chunk-H6MYB7GB.js";
13
13
  import "./chunk-THHRRYRS.js";
14
14
  import "./chunk-FQERBIVS.js";
15
- import "./chunk-SU36MZXC.js";
15
+ import "./chunk-AJZPQDDW.js";
16
16
  import "./chunk-YN3FGNJM.js";
17
17
  import "./chunk-ZAOEFQ6K.js";
18
18
  import "./chunk-4J74G7N2.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CategoryDetailPage
3
- } from "./chunk-CGKIYXZ6.js";
3
+ } from "./chunk-WUCZ7VH3.js";
4
4
  import "./chunk-7AV5EJJ5.js";
5
5
  import "./chunk-N4G3RFLY.js";
6
6
  import "./chunk-Y456KVIN.js";
@@ -19,7 +19,7 @@ import "./chunk-U3I6S3RO.js";
19
19
  import "./chunk-THHRRYRS.js";
20
20
  import "./chunk-ESRIX7ZH.js";
21
21
  import "./chunk-FQERBIVS.js";
22
- import "./chunk-SU36MZXC.js";
22
+ import "./chunk-AJZPQDDW.js";
23
23
  import "./chunk-YN3FGNJM.js";
24
24
  import "./chunk-ZAOEFQ6K.js";
25
25
  import "./chunk-4J74G7N2.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CategoryListPage
3
- } from "./chunk-FCV5FSUM.js";
3
+ } from "./chunk-7CNMMPNC.js";
4
4
  import "./chunk-N4G3RFLY.js";
5
5
  import "./chunk-JHIMVLB2.js";
6
6
  import "./chunk-Y456KVIN.js";
@@ -14,7 +14,7 @@ import "./chunk-H6MYB7GB.js";
14
14
  import "./chunk-U3I6S3RO.js";
15
15
  import "./chunk-THHRRYRS.js";
16
16
  import "./chunk-FQERBIVS.js";
17
- import "./chunk-SU36MZXC.js";
17
+ import "./chunk-AJZPQDDW.js";
18
18
  import "./chunk-YN3FGNJM.js";
19
19
  import "./chunk-ZAOEFQ6K.js";
20
20
  import "./chunk-4J74G7N2.js";
@@ -27,7 +27,7 @@ import "./chunk-FQERBIVS.js";
27
27
  import {
28
28
  _DataTable,
29
29
  useDataTable
30
- } from "./chunk-SU36MZXC.js";
30
+ } from "./chunk-AJZPQDDW.js";
31
31
  import "./chunk-YN3FGNJM.js";
32
32
  import "./chunk-ZAOEFQ6K.js";
33
33
  import "./chunk-4J74G7N2.js";
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  _DataTable,
18
18
  useDataTable
19
- } from "./chunk-SU36MZXC.js";
19
+ } from "./chunk-AJZPQDDW.js";
20
20
  import {
21
21
  ActionMenu
22
22
  } from "./chunk-3UOYBH5O.js";
@@ -0,0 +1,210 @@
1
+ import {
2
+ useDebouncedSearch
3
+ } from "./chunk-PYDRHQTY.js";
4
+ import {
5
+ useCustomers
6
+ } from "./chunk-DEEY267U.js";
7
+ import {
8
+ useSellers
9
+ } from "./chunk-RP3J3X7P.js";
10
+ import {
11
+ useSalesChannels
12
+ } from "./chunk-7NXOLMSS.js";
13
+
14
+ // src/pages/orders/order-list/components/order-list-table/use-order-table-filters.tsx
15
+ import { usePermissions } from "@mercurjs/dashboard-shared";
16
+ import { keepPreviousData } from "@tanstack/react-query";
17
+ import { useMemo } from "react";
18
+ import { useTranslation } from "react-i18next";
19
+ import { useSearchParams } from "react-router-dom";
20
+ var OPTIONS_PAGE_SIZE = 50;
21
+ var mergeOptions = (selected, found) => {
22
+ const seen = /* @__PURE__ */ new Set();
23
+ return [...selected, ...found].filter((option) => {
24
+ if (seen.has(option.value)) {
25
+ return false;
26
+ }
27
+ seen.add(option.value);
28
+ return true;
29
+ });
30
+ };
31
+ var useSelectedIds = (key) => {
32
+ const [searchParams] = useSearchParams();
33
+ const raw = searchParams.get(key);
34
+ return useMemo(() => raw?.split(",").filter(Boolean) ?? [], [raw]);
35
+ };
36
+ var PAYMENT_STATUSES = [
37
+ "not_paid",
38
+ "awaiting",
39
+ "authorized",
40
+ "partially_authorized",
41
+ "captured",
42
+ "partially_captured",
43
+ "refunded",
44
+ "partially_refunded",
45
+ "canceled",
46
+ "requires_action"
47
+ ];
48
+ var camelCase = (value) => value.replace(/_([a-z])/g, (_, char) => char.toUpperCase());
49
+ var useOrderGroupTableFilters = () => {
50
+ const { t } = useTranslation();
51
+ const { can } = usePermissions();
52
+ const customerSearch = useDebouncedSearch();
53
+ const sellerSearch = useDebouncedSearch();
54
+ const salesChannelSearch = useDebouncedSearch();
55
+ const selectedCustomerIds = useSelectedIds("customer_id");
56
+ const selectedSellerIds = useSelectedIds("seller_id");
57
+ const selectedSalesChannelIds = useSelectedIds("sales_channel_id");
58
+ const canViewCustomers = can("customers");
59
+ const canViewSellers = can("sellers");
60
+ const canViewSalesChannels = can("sales_channels");
61
+ const customerFields = "id,first_name,last_name,email";
62
+ const { customers, isFetching: isFetchingCustomers } = useCustomers(
63
+ {
64
+ limit: OPTIONS_PAGE_SIZE,
65
+ fields: customerFields,
66
+ ...customerSearch.query ? { q: customerSearch.query } : {}
67
+ },
68
+ { enabled: canViewCustomers, placeholderData: keepPreviousData }
69
+ );
70
+ const { customers: selectedCustomers } = useCustomers(
71
+ {
72
+ id: selectedCustomerIds,
73
+ limit: selectedCustomerIds.length,
74
+ fields: customerFields
75
+ },
76
+ { enabled: canViewCustomers && selectedCustomerIds.length > 0 }
77
+ );
78
+ const { sellers, isFetching: isFetchingSellers } = useSellers(
79
+ {
80
+ limit: OPTIONS_PAGE_SIZE,
81
+ fields: "id,name",
82
+ ...sellerSearch.query ? { q: sellerSearch.query } : {}
83
+ },
84
+ { enabled: canViewSellers, placeholderData: keepPreviousData }
85
+ );
86
+ const { sellers: selectedSellers } = useSellers(
87
+ {
88
+ id: selectedSellerIds,
89
+ limit: selectedSellerIds.length,
90
+ fields: "id,name"
91
+ },
92
+ { enabled: canViewSellers && selectedSellerIds.length > 0 }
93
+ );
94
+ const { sales_channels, isFetching: isFetchingSalesChannels } = useSalesChannels(
95
+ {
96
+ limit: OPTIONS_PAGE_SIZE,
97
+ fields: "id,name",
98
+ ...salesChannelSearch.query ? { q: salesChannelSearch.query } : {}
99
+ },
100
+ { enabled: canViewSalesChannels, placeholderData: keepPreviousData }
101
+ );
102
+ const { sales_channels: selectedSalesChannels } = useSalesChannels(
103
+ {
104
+ id: selectedSalesChannelIds,
105
+ limit: selectedSalesChannelIds.length,
106
+ fields: "id,name"
107
+ },
108
+ { enabled: canViewSalesChannels && selectedSalesChannelIds.length > 0 }
109
+ );
110
+ return useMemo(() => {
111
+ const filters = [];
112
+ const customerOption = (c) => ({
113
+ label: [c.first_name, c.last_name].filter(Boolean).join(" ") || c.email || c.id,
114
+ value: c.id
115
+ });
116
+ const namedOption = (s) => ({
117
+ label: s.name || s.id,
118
+ value: s.id
119
+ });
120
+ if (canViewCustomers) {
121
+ filters.push({
122
+ key: "customer_id",
123
+ label: t("fields.customer"),
124
+ type: "select",
125
+ multiple: true,
126
+ searchable: true,
127
+ onSearch: customerSearch.onSearchValueChange,
128
+ isLoading: isFetchingCustomers,
129
+ options: mergeOptions(
130
+ (selectedCustomers ?? []).map(customerOption),
131
+ (customers ?? []).map(customerOption)
132
+ )
133
+ });
134
+ }
135
+ if (canViewSellers) {
136
+ filters.push({
137
+ key: "seller_id",
138
+ label: t("fields.store"),
139
+ type: "select",
140
+ multiple: true,
141
+ searchable: true,
142
+ onSearch: sellerSearch.onSearchValueChange,
143
+ isLoading: isFetchingSellers,
144
+ options: mergeOptions(
145
+ (selectedSellers ?? []).map(namedOption),
146
+ (sellers ?? []).map(namedOption)
147
+ )
148
+ });
149
+ }
150
+ if (canViewSalesChannels) {
151
+ filters.push({
152
+ key: "sales_channel_id",
153
+ label: t("fields.salesChannel"),
154
+ type: "select",
155
+ multiple: true,
156
+ searchable: true,
157
+ onSearch: salesChannelSearch.onSearchValueChange,
158
+ isLoading: isFetchingSalesChannels,
159
+ options: mergeOptions(
160
+ (selectedSalesChannels ?? []).map(namedOption),
161
+ (sales_channels ?? []).map(namedOption)
162
+ )
163
+ });
164
+ }
165
+ filters.push(
166
+ {
167
+ key: "payment_status",
168
+ label: t("orders.payment.statusLabel"),
169
+ type: "select",
170
+ multiple: true,
171
+ options: PAYMENT_STATUSES.map((status) => ({
172
+ label: t(`orders.payment.status.${camelCase(status)}`),
173
+ value: status
174
+ }))
175
+ },
176
+ {
177
+ key: "created_at",
178
+ label: t("fields.createdAt"),
179
+ type: "date"
180
+ },
181
+ {
182
+ key: "updated_at",
183
+ label: t("fields.updatedAt"),
184
+ type: "date"
185
+ }
186
+ );
187
+ return filters;
188
+ }, [
189
+ t,
190
+ canViewCustomers,
191
+ canViewSellers,
192
+ canViewSalesChannels,
193
+ customers,
194
+ selectedCustomers,
195
+ isFetchingCustomers,
196
+ customerSearch.onSearchValueChange,
197
+ sellers,
198
+ selectedSellers,
199
+ isFetchingSellers,
200
+ sellerSearch.onSearchValueChange,
201
+ sales_channels,
202
+ selectedSalesChannels,
203
+ isFetchingSalesChannels,
204
+ salesChannelSearch.onSearchValueChange
205
+ ]);
206
+ };
207
+
208
+ export {
209
+ useOrderGroupTableFilters
210
+ };
@@ -19,7 +19,7 @@ import {
19
19
  import {
20
20
  _DataTable,
21
21
  useDataTable
22
- } from "./chunk-SU36MZXC.js";
22
+ } from "./chunk-AJZPQDDW.js";
23
23
  import {
24
24
  ActionMenu
25
25
  } from "./chunk-3UOYBH5O.js";
@@ -22,7 +22,7 @@ import {
22
22
  import {
23
23
  _DataTable,
24
24
  useDataTable
25
- } from "./chunk-SU36MZXC.js";
25
+ } from "./chunk-AJZPQDDW.js";
26
26
  import {
27
27
  ActionMenu
28
28
  } from "./chunk-3UOYBH5O.js";
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  _DataTable,
18
18
  useDataTable
19
- } from "./chunk-SU36MZXC.js";
19
+ } from "./chunk-AJZPQDDW.js";
20
20
  import {
21
21
  ActionMenu
22
22
  } from "./chunk-3UOYBH5O.js";
@@ -19,7 +19,7 @@ import {
19
19
  import {
20
20
  _DataTable,
21
21
  useDataTable
22
- } from "./chunk-SU36MZXC.js";
22
+ } from "./chunk-AJZPQDDW.js";
23
23
  import {
24
24
  ActionMenu
25
25
  } from "./chunk-3UOYBH5O.js";
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  _DataTable,
15
15
  useDataTable
16
- } from "./chunk-SU36MZXC.js";
16
+ } from "./chunk-AJZPQDDW.js";
17
17
  import {
18
18
  ActionMenu
19
19
  } from "./chunk-3UOYBH5O.js";
@@ -28,7 +28,7 @@ import {
28
28
  import {
29
29
  _DataTable,
30
30
  useDataTable
31
- } from "./chunk-SU36MZXC.js";
31
+ } from "./chunk-AJZPQDDW.js";
32
32
  import {
33
33
  ActionMenu
34
34
  } from "./chunk-3UOYBH5O.js";
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  _DataTable,
18
18
  useDataTable
19
- } from "./chunk-SU36MZXC.js";
19
+ } from "./chunk-AJZPQDDW.js";
20
20
  import {
21
21
  ActionMenu
22
22
  } from "./chunk-3UOYBH5O.js";
@@ -26,7 +26,7 @@ import {
26
26
  import {
27
27
  _DataTable,
28
28
  useDataTable
29
- } from "./chunk-SU36MZXC.js";
29
+ } from "./chunk-AJZPQDDW.js";
30
30
  import {
31
31
  useDate
32
32
  } from "./chunk-EIWPJWKF.js";
@@ -649,6 +649,8 @@ var SelectFilter = ({
649
649
  readonly,
650
650
  multiple,
651
651
  searchable,
652
+ onSearch,
653
+ isLoading,
652
654
  options,
653
655
  openOnMount
654
656
  }) => {
@@ -679,8 +681,12 @@ var SelectFilter = ({
679
681
  }, 200);
680
682
  }
681
683
  };
684
+ const handleSearchChange = (value) => {
685
+ setSearch(value);
686
+ onSearch?.(value);
687
+ };
682
688
  const handleClearSearch = () => {
683
- setSearch("");
689
+ handleSearchChange("");
684
690
  if (searchRef) {
685
691
  searchRef.focus();
686
692
  }
@@ -725,14 +731,14 @@ var SelectFilter = ({
725
731
  }
726
732
  }
727
733
  },
728
- children: /* @__PURE__ */ jsxs4(Command, { className: "h-full", children: [
734
+ children: /* @__PURE__ */ jsxs4(Command, { className: "h-full", shouldFilter: !onSearch, children: [
729
735
  searchable && /* @__PURE__ */ jsx4("div", { className: "border-b p-1", children: /* @__PURE__ */ jsxs4("div", { className: "grid grid-cols-[1fr_20px] gap-x-2 rounded-md px-2 py-1", children: [
730
736
  /* @__PURE__ */ jsx4(
731
737
  Command.Input,
732
738
  {
733
739
  ref: setSearchRef,
734
740
  value: search,
735
- onValueChange: setSearch,
741
+ onValueChange: handleSearchChange,
736
742
  className: "txt-compact-small placeholder:text-ui-fg-muted bg-transparent outline-none",
737
743
  placeholder: t2("general.search")
738
744
  }
@@ -752,7 +758,7 @@ var SelectFilter = ({
752
758
  }
753
759
  ) })
754
760
  ] }) }),
755
- /* @__PURE__ */ jsx4(Command.Empty, { className: "txt-compact-small flex items-center justify-center p-1", children: /* @__PURE__ */ jsx4("span", { className: "w-full px-2 py-1 text-center", children: t2("general.noResultsTitle") }) }),
761
+ /* @__PURE__ */ jsx4(Command.Empty, { className: "txt-compact-small flex items-center justify-center p-1", children: /* @__PURE__ */ jsx4("span", { className: "w-full px-2 py-1 text-center", children: isLoading ? t2("general.loading") : t2("general.noResultsTitle") }) }),
756
762
  /* @__PURE__ */ jsx4(Command.List, { className: "h-full max-h-[163px] min-h-[0] overflow-auto p-1 outline-none", children: options.map((option) => {
757
763
  const isSelected = selectedParams.get().includes(String(option.value));
758
764
  return /* @__PURE__ */ jsxs4(
@@ -966,6 +972,8 @@ var DataTableFilter = ({
966
972
  options: filter.options,
967
973
  multiple: filter.multiple,
968
974
  searchable: filter.searchable,
975
+ onSearch: filter.onSearch,
976
+ isLoading: filter.isLoading,
969
977
  openOnMount: filter.openOnMount
970
978
  },
971
979
  filter.key
@@ -19,7 +19,7 @@ import {
19
19
  import {
20
20
  _DataTable,
21
21
  useDataTable
22
- } from "./chunk-SU36MZXC.js";
22
+ } from "./chunk-AJZPQDDW.js";
23
23
 
24
24
  // src/pages/locations/common/components/geo-zone-form/geo-zone-form.tsx
25
25
  import { Button as Button2, Checkbox } from "@medusajs/ui";
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  _DataTable,
12
12
  useDataTable
13
- } from "./chunk-SU36MZXC.js";
13
+ } from "./chunk-AJZPQDDW.js";
14
14
  import {
15
15
  useDate
16
16
  } from "./chunk-EIWPJWKF.js";
@@ -27,7 +27,7 @@ import {
27
27
  import {
28
28
  _DataTable,
29
29
  useDataTable
30
- } from "./chunk-SU36MZXC.js";
30
+ } from "./chunk-AJZPQDDW.js";
31
31
  import {
32
32
  ActionMenu
33
33
  } from "./chunk-3UOYBH5O.js";
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  _DataTable,
15
15
  useDataTable
16
- } from "./chunk-SU36MZXC.js";
16
+ } from "./chunk-AJZPQDDW.js";
17
17
  import {
18
18
  ActionMenu
19
19
  } from "./chunk-3UOYBH5O.js";
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  _DataTable,
18
18
  useDataTable
19
- } from "./chunk-SU36MZXC.js";
19
+ } from "./chunk-AJZPQDDW.js";
20
20
  import {
21
21
  ActionMenu
22
22
  } from "./chunk-3UOYBH5O.js";
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  _DataTable,
15
15
  useDataTable
16
- } from "./chunk-SU36MZXC.js";
16
+ } from "./chunk-AJZPQDDW.js";
17
17
  import {
18
18
  ActionMenu
19
19
  } from "./chunk-3UOYBH5O.js";
@@ -46,7 +46,7 @@ import {
46
46
  import {
47
47
  _DataTable,
48
48
  useDataTable
49
- } from "./chunk-SU36MZXC.js";
49
+ } from "./chunk-AJZPQDDW.js";
50
50
  import {
51
51
  useCreatePriceList
52
52
  } from "./chunk-HDZAXTTU.js";
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  _DataTable,
12
12
  useDataTable
13
- } from "./chunk-SU36MZXC.js";
13
+ } from "./chunk-AJZPQDDW.js";
14
14
  import {
15
15
  ActionMenu
16
16
  } from "./chunk-3UOYBH5O.js";
@@ -191,6 +191,25 @@ var generateVariantsFromAttributes = (attributes, currentVariants) => {
191
191
  }
192
192
  return newVariants;
193
193
  };
194
+ var syncVariantsWithAttributes = (form) => {
195
+ const currentVariants = form.getValues("variants") ?? [];
196
+ const nextVariants = generateVariantsFromAttributes(
197
+ form.getValues("attributes") ?? [],
198
+ currentVariants
199
+ );
200
+ const sameOptions = JSON.stringify(nextVariants.map((v) => v.options)) === JSON.stringify(currentVariants.map((v) => v.options));
201
+ if (!sameOptions) {
202
+ form.setValue("variants", nextVariants);
203
+ }
204
+ };
205
+ var subscribeVariantsToAttributes = (form) => {
206
+ syncVariantsWithAttributes(form);
207
+ return form.subscribe({
208
+ name: "attributes",
209
+ formState: { values: true },
210
+ callback: () => syncVariantsWithAttributes(form)
211
+ });
212
+ };
194
213
 
195
214
  // src/pages/products/product-create/constants.ts
196
215
  var MediaSchema = z.object({
@@ -343,7 +362,7 @@ var PRODUCT_CREATE_FORM_DEFAULTS = {
343
362
  export {
344
363
  normalizeProductFormValues,
345
364
  decorateVariantsWithDefaultValues,
346
- generateVariantsFromAttributes,
365
+ subscribeVariantsToAttributes,
347
366
  MediaSchema,
348
367
  ProductCreateSchema,
349
368
  EditProductMediaSchema,
@@ -42,7 +42,7 @@ import {
42
42
  import {
43
43
  _DataTable,
44
44
  useDataTable
45
- } from "./chunk-SU36MZXC.js";
45
+ } from "./chunk-AJZPQDDW.js";
46
46
  import {
47
47
  NoRecords
48
48
  } from "./chunk-4J74G7N2.js";
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  _DataTable,
26
26
  useDataTable
27
- } from "./chunk-SU36MZXC.js";
27
+ } from "./chunk-AJZPQDDW.js";
28
28
  import {
29
29
  NoRecords
30
30
  } from "./chunk-4J74G7N2.js";
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  _DataTable,
23
23
  useDataTable
24
- } from "./chunk-SU36MZXC.js";
24
+ } from "./chunk-AJZPQDDW.js";
25
25
  import {
26
26
  ActionMenu
27
27
  } from "./chunk-3UOYBH5O.js";
@@ -14,7 +14,7 @@ import {
14
14
  import {
15
15
  _DataTable,
16
16
  useDataTable
17
- } from "./chunk-SU36MZXC.js";
17
+ } from "./chunk-AJZPQDDW.js";
18
18
  import {
19
19
  ActionMenu
20
20
  } from "./chunk-3UOYBH5O.js";
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  _DataTable,
15
15
  useDataTable
16
- } from "./chunk-SU36MZXC.js";
16
+ } from "./chunk-AJZPQDDW.js";
17
17
  import {
18
18
  ActionMenu
19
19
  } from "./chunk-3UOYBH5O.js";