@mercurjs/admin 2.2.0-canary.5 → 2.2.0-canary.8

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 (160) hide show
  1. package/dist/{add-campaign-promotions-FAG3FAOF.js → add-campaign-promotions-RURZSD6G.js} +3 -3
  2. package/dist/{adjust-inventory-EAAPNIBZ.js → adjust-inventory-4PM2YZK3.js} +2 -3
  3. package/dist/{api-key-management-detail-PIN6NFQF.js → api-key-management-detail-BG7U2KCT.js} +3 -4
  4. package/dist/{attribute-create-F55LOXRA.js → attribute-create-L6YA6HTF.js} +46 -25
  5. package/dist/{attribute-detail-NRDJUPTJ.js → attribute-detail-Q3P7SCZ2.js} +5 -6
  6. package/dist/{attribute-edit-SB6GN67M.js → attribute-edit-LUY66TG3.js} +2 -2
  7. package/dist/{attribute-edit-possible-value-5CLQOLVR.js → attribute-edit-possible-value-IOS3625C.js} +2 -2
  8. package/dist/{attribute-list-URWKNTSJ.js → attribute-list-RUMLW7EI.js} +2 -3
  9. package/dist/{campaign-detail-QMLFWZ6K.js → campaign-detail-JFNFC6FY.js} +6 -7
  10. package/dist/{categories-metadata-5GXBBHEH.js → categories-metadata-5THJAHOA.js} +2 -3
  11. package/dist/{category-detail-RIKOZMPK.js → category-detail-7Y76K4I5.js} +7 -8
  12. package/dist/{category-products-255EJFTV.js → category-products-T525MDHE.js} +6 -7
  13. package/dist/{chunk-LD7NVG2X.js → chunk-2666PZI5.js} +2 -2
  14. package/dist/{chunk-GPJ6KVY2.js → chunk-2AFIUBWT.js} +2 -2
  15. package/dist/{chunk-SA3MMYXT.js → chunk-362ZBMNT.js} +1 -1
  16. package/dist/{chunk-VERWLDVW.js → chunk-3UKIBKFD.js} +3 -3
  17. package/dist/{chunk-SXGSYSW7.js → chunk-3VDLE5GA.js} +12 -4
  18. package/dist/{chunk-LXMGYWPO.js → chunk-45LX4LPV.js} +2 -2
  19. package/dist/{chunk-6RHAGO5O.js → chunk-4TWWSI7H.js} +2 -2
  20. package/dist/{chunk-EBQUMS7H.js → chunk-5MVC35DX.js} +1 -1
  21. package/dist/{chunk-KTBL35I2.js → chunk-B2STTXQV.js} +1 -1
  22. package/dist/{chunk-3OUWXGMT.js → chunk-EJBFKCC5.js} +2 -2
  23. package/dist/{chunk-SS7LB52P.js → chunk-FGWD66ZZ.js} +4 -4
  24. package/dist/{chunk-AKC67AN5.js → chunk-FJLKDTNA.js} +6 -3
  25. package/dist/{chunk-UNOG2S56.js → chunk-GOWTUDQ3.js} +4 -4
  26. package/dist/{chunk-LO7NJYHZ.js → chunk-HEX3M4TL.js} +2 -2
  27. package/dist/{chunk-NMFVQDVF.js → chunk-HJKZBCDB.js} +2 -2
  28. package/dist/{chunk-D2NBZVQC.js → chunk-I7L2Q6AL.js} +2 -2
  29. package/dist/{chunk-34OFJ74B.js → chunk-JB6QDJN3.js} +2 -2
  30. package/dist/{chunk-M5AJSIRN.js → chunk-JSMUFZZN.js} +1 -1
  31. package/dist/{chunk-TE245WV3.js → chunk-LSLPZITW.js} +2 -2
  32. package/dist/{chunk-UFGVU7RF.js → chunk-LXJH3DOV.js} +1 -1
  33. package/dist/{chunk-XAIID3PU.js → chunk-MU63NHPX.js} +3 -3
  34. package/dist/{chunk-F7O6IXPA.js → chunk-NC46O6TE.js} +1 -1
  35. package/dist/{chunk-MFI5TG54.js → chunk-NPQKCEAH.js} +2 -2
  36. package/dist/{chunk-6NDM5WGE.js → chunk-OMBP3YSV.js} +1 -1
  37. package/dist/{chunk-TNNQPNXY.js → chunk-OPX5O57R.js} +1 -1
  38. package/dist/{chunk-6XTHMAA2.js → chunk-PK645GWX.js} +1 -1
  39. package/dist/{chunk-2XVH2IJL.js → chunk-PK6LEBI7.js} +2 -2
  40. package/dist/{chunk-CKUIM5ZD.js → chunk-QJUWQDTX.js} +2 -2
  41. package/dist/{chunk-5J2HQOKK.js → chunk-U4IQFWPI.js} +1 -1
  42. package/dist/{chunk-F5H5JZQZ.js → chunk-UCYSCKZV.js} +0 -9
  43. package/dist/{chunk-2MVNFKL6.js → chunk-UGC6Z6CQ.js} +2 -2
  44. package/dist/{chunk-G3GSRFTB.js → chunk-UQORUXQR.js} +2 -2
  45. package/dist/{chunk-WRVGLMRW.js → chunk-URZCZO6F.js} +1 -1
  46. package/dist/{chunk-6WBQDJIH.js → chunk-VXMTBOKI.js} +58 -48
  47. package/dist/{chunk-N3334MXP.js → chunk-W4GX5X5E.js} +1 -1
  48. package/dist/{chunk-QFE4AEQJ.js → chunk-WCSHDVMB.js} +9 -48
  49. package/dist/{chunk-UKDC2AQR.js → chunk-WPVDACTL.js} +1 -1
  50. package/dist/{chunk-K43FFKGD.js → chunk-WVJJGXM5.js} +1 -1
  51. package/dist/{collection-add-products-4ZTBHENL.js → collection-add-products-6HKW4CCS.js} +6 -7
  52. package/dist/{collection-detail-W7OC2ALM.js → collection-detail-BCIH2FB7.js} +7 -8
  53. package/dist/{collection-list-B7LALPSA.js → collection-list-O24SYINI.js} +6 -7
  54. package/dist/{collection-metadata-E4C54MTU.js → collection-metadata-5VPC4CJI.js} +2 -3
  55. package/dist/{commission-rate-create-7MEIKAXK.js → commission-rate-create-7NSSEEH5.js} +8 -9
  56. package/dist/{commission-rate-detail-XBMB3Y7S.js → commission-rate-detail-2FGQ3V2J.js} +2 -3
  57. package/dist/{commission-rate-edit-XXUAGK5Q.js → commission-rate-edit-NXSXX4TA.js} +8 -9
  58. package/dist/{customer-detail-ONZGPCHW.js → customer-detail-SDKM7KM5.js} +2 -3
  59. package/dist/{customer-group-detail-XTCDJX7O.js → customer-group-detail-AMZNW2XW.js} +2 -3
  60. package/dist/{customer-group-list-63ER7WQH.js → customer-group-list-ES6FKPEC.js} +2 -3
  61. package/dist/{customer-group-metadata-N7HGHXNC.js → customer-group-metadata-PU2ZQP2Z.js} +2 -3
  62. package/dist/{customer-metadata-63OWV4KB.js → customer-metadata-ZCREBYFN.js} +2 -3
  63. package/dist/{customers-add-customer-group-NUXPXNUC.js → customers-add-customer-group-SQIJ7CDL.js} +2 -3
  64. package/dist/{edit-inventory-item-YOJTYA7H.js → edit-inventory-item-JUWUPXRF.js} +2 -3
  65. package/dist/{edit-inventory-item-attributes-JGY633F2.js → edit-inventory-item-attributes-3GQMHSL2.js} +2 -3
  66. package/dist/{edit-rules-4VAD5Q3L.js → edit-rules-72KZYLNI.js} +2 -3
  67. package/dist/index.js +139 -193
  68. package/dist/{inventory-create-3NJZLSFO.js → inventory-create-QUE6RTM5.js} +2 -3
  69. package/dist/{inventory-detail-B3HU2OVR.js → inventory-detail-42GIKTMR.js} +2 -3
  70. package/dist/{inventory-metadata-WCFTI7AH.js → inventory-metadata-VLXNSQS7.js} +2 -3
  71. package/dist/{inventory-stock-M65W4GRN.js → inventory-stock-V37WSJ7V.js} +2 -3
  72. package/dist/{location-detail-2NCZD5MO.js → location-detail-PBCO6YON.js} +2 -3
  73. package/dist/{location-fulfillment-providers-3XKOFATD.js → location-fulfillment-providers-UGTP3SCR.js} +4 -5
  74. package/dist/{location-list-VS6V2FXE.js → location-list-YD4MZG2C.js} +2 -3
  75. package/dist/{location-service-zone-shipping-option-create-LAM3OHBC.js → location-service-zone-shipping-option-create-BU6RQKYU.js} +2 -3
  76. package/dist/{login-DJWU5X5L.js → login-4IJPWFIN.js} +2 -3
  77. package/dist/{marketplace-detail-IQLU7R3J.js → marketplace-detail-LFCGTWIJ.js} +2 -3
  78. package/dist/{marketplace-metadata-7DNBHUDD.js → marketplace-metadata-BCPLQY5Y.js} +2 -3
  79. package/dist/{offers-UJCSO3RD.js → offers-5L46FLHU.js} +2 -2
  80. package/dist/{order-create-exchange-O6COEAGJ.js → order-create-exchange-Z7F6FRMI.js} +2 -3
  81. package/dist/{order-create-fulfillment-Y4HQ5YRS.js → order-create-fulfillment-DC4LWQYX.js} +2 -3
  82. package/dist/{order-create-refund-TCNCSOMX.js → order-create-refund-OWCLXLH3.js} +2 -3
  83. package/dist/{order-create-shipment-EWOJJXEM.js → order-create-shipment-JSYNAOBR.js} +2 -3
  84. package/dist/{order-detail-BOW62X75.js → order-detail-7GQLUWBA.js} +3 -4
  85. package/dist/{order-edit-billing-address-5ZBOWDWQ.js → order-edit-billing-address-BW5NU3KC.js} +3 -4
  86. package/dist/{order-edit-email-DQJW2SAM.js → order-edit-email-GQQY2SU7.js} +2 -3
  87. package/dist/{order-edit-shipping-address-RIML4XFQ.js → order-edit-shipping-address-DMUVVAZ6.js} +2 -3
  88. package/dist/{order-list-U5DZYLJK.js → order-list-KTKSHQST.js} +2 -2
  89. package/dist/{order-metadata-WGZUETFN.js → order-metadata-YJ6LWUYD.js} +2 -3
  90. package/dist/{order-receive-return-MDUU4L4X.js → order-receive-return-QY6KQBDB.js} +2 -3
  91. package/dist/{order-request-transfer-QFUMEZPD.js → order-request-transfer-6EOWBAJP.js} +2 -3
  92. package/dist/pages/index.d.ts +1 -28
  93. package/dist/pages/index.js +48 -58
  94. package/dist/{price-list-create-J4AJG42T.js → price-list-create-F5ASYWH2.js} +7 -8
  95. package/dist/{price-list-detail-D2ETNZ5N.js → price-list-detail-Q7IODVDV.js} +7 -8
  96. package/dist/{price-list-prices-add-FQLQ5DPX.js → price-list-prices-add-C5OEGJSE.js} +7 -8
  97. package/dist/{price-list-prices-edit-4HBSUC5W.js → price-list-prices-edit-TGYZNOK4.js} +2 -3
  98. package/dist/{product-add-existing-attributes-IHCIKDIH.js → product-add-existing-attributes-NTDMPDPZ.js} +4 -5
  99. package/dist/{product-create-BQXFDMEP.js → product-create-WTEZJRJC.js} +6 -7
  100. package/dist/{product-create-variant-MVYZPDO7.js → product-create-variant-AVV4LL7R.js} +3 -3
  101. package/dist/{product-detail-I57XSYLB.js → product-detail-H25AVTG7.js} +4 -5
  102. package/dist/{product-list-PR532XII.js → product-list-X7ZL4KY5.js} +7 -8
  103. package/dist/{product-media-J3VTWOU4.js → product-media-IE4P5WAE.js} +2 -2
  104. package/dist/{product-metadata-T2D4GEIP.js → product-metadata-3DGBHQTM.js} +2 -3
  105. package/dist/{product-organization-D6UMZAUE.js → product-organization-64KMYNZH.js} +0 -43
  106. package/dist/{product-tag-create-47G425O2.js → product-tag-create-6TDIKP6X.js} +2 -3
  107. package/dist/{product-tag-detail-VNGOBWYE.js → product-tag-detail-2OB43Q5H.js} +9 -10
  108. package/dist/{product-tag-edit-DN7IVL75.js → product-tag-edit-SJY7L6IL.js} +2 -3
  109. package/dist/{product-tag-list-ZGRJZT2U.js → product-tag-list-H4HRDCAI.js} +9 -10
  110. package/dist/{product-tag-metadata-YLDBRJMI.js → product-tag-metadata-UCMA6YAN.js} +2 -3
  111. package/dist/{product-type-detail-MPONGCVO.js → product-type-detail-WTEDFJAW.js} +7 -8
  112. package/dist/{product-type-metadata-TDAER7JD.js → product-type-metadata-3WCSSNDX.js} +2 -3
  113. package/dist/{product-variant-detail-5BF6JTHV.js → product-variant-detail-3YX6AL23.js} +2 -3
  114. package/dist/{product-variant-edit-2RHFG2CZ.js → product-variant-edit-MDXJUTQR.js} +4 -5
  115. package/dist/{product-variant-metadata-G2LLH7YK.js → product-variant-metadata-34BBPRKZ.js} +2 -3
  116. package/dist/{promotion-create-G3M4UJX2.js → promotion-create-FSXBFC6B.js} +2 -3
  117. package/dist/{promotion-detail-4EHU6FKF.js → promotion-detail-OKCXRU4Z.js} +5 -6
  118. package/dist/{promotion-list-AFBLWKTJ.js → promotion-list-7YRTZF3S.js} +4 -4
  119. package/dist/{refund-reason-create-6RPQHIJI.js → refund-reason-create-AKZX4RAN.js} +2 -3
  120. package/dist/{refund-reason-edit-W2TVZB3N.js → refund-reason-edit-LXMQTLR6.js} +2 -3
  121. package/dist/{refund-reason-list-TS6JWYS4.js → refund-reason-list-6JXGHJRA.js} +7 -8
  122. package/dist/{region-metadata-TNSJDCBM.js → region-metadata-GS4IS7UT.js} +2 -3
  123. package/dist/{reservation-detail-KFOVTTFH.js → reservation-detail-CVV36FXP.js} +2 -3
  124. package/dist/{reservation-metadata-HBFAVVPW.js → reservation-metadata-364D3VZ7.js} +2 -3
  125. package/dist/{reset-password-3NYZNQPK.js → reset-password-MH3JTCCE.js} +1 -1
  126. package/dist/{return-reason-list-WBLPUYD4.js → return-reason-list-J7QUYMYH.js} +5 -5
  127. package/dist/{sales-channel-add-products-IHGDKRKH.js → sales-channel-add-products-Q352GB72.js} +6 -7
  128. package/dist/{sales-channel-detail-QCFO7VUA.js → sales-channel-detail-7WO26EOP.js} +7 -8
  129. package/dist/{sales-channel-list-YNHR5EHL.js → sales-channel-list-LSKZXQQC.js} +2 -3
  130. package/dist/{sales-channel-metadata-OEQVWJRQ.js → sales-channel-metadata-Z75VZHOY.js} +2 -3
  131. package/dist/{shipping-option-type-create-SMXDCF6I.js → shipping-option-type-create-NCI2LJAA.js} +2 -3
  132. package/dist/{shipping-option-type-detail-MO3YRUVR.js → shipping-option-type-detail-YNRLWD33.js} +4 -5
  133. package/dist/{shipping-option-type-edit-KO64TZS6.js → shipping-option-type-edit-XJFALSAR.js} +2 -3
  134. package/dist/{shipping-option-type-list-6C26GWDM.js → shipping-option-type-list-HZBMHE23.js} +4 -5
  135. package/dist/{shipping-profile-metadata-FLTMLAZN.js → shipping-profile-metadata-YJMMBUYN.js} +2 -3
  136. package/dist/{store-bulk-edit-LW6ABDJK.js → store-bulk-edit-BNF3HH5K.js} +1 -1
  137. package/dist/{store-create-STR6YNFJ.js → store-create-A23PSUWX.js} +2 -3
  138. package/dist/{store-details-3U4OEFWC.js → store-details-R3J3YYR6.js} +8 -9
  139. package/dist/{store-edit-KRBR5MGV.js → store-edit-ZGBEXU4H.js} +3 -3
  140. package/dist/{store-list-PJ3U254I.js → store-list-TPMIQ6OO.js} +6 -7
  141. package/dist/{store-member-invite-AKH3KHMF.js → store-member-invite-J5XSPWMW.js} +1 -1
  142. package/dist/{tax-region-create-NEKIT7TT.js → tax-region-create-LQU7MWPP.js} +3 -4
  143. package/dist/{tax-region-detail-LVN5XSN5.js → tax-region-detail-2KADHBYF.js} +2 -3
  144. package/dist/{tax-region-edit-4PJV5F5X.js → tax-region-edit-TAWTPUQC.js} +2 -3
  145. package/dist/{tax-region-metadata-EYRFMJLL.js → tax-region-metadata-W4R2SPDH.js} +2 -3
  146. package/dist/{tax-region-province-detail-MTHKW7LW.js → tax-region-province-detail-W6BDEQA5.js} +2 -3
  147. package/dist/{tax-region-tax-override-create-OGW3MPBD.js → tax-region-tax-override-create-M3FKWCY3.js} +8 -9
  148. package/dist/{tax-region-tax-override-edit-LTZCYN4Y.js → tax-region-tax-override-edit-4TRW73DK.js} +8 -9
  149. package/dist/{user-metadata-GIR3A7WO.js → user-metadata-XTDSENAD.js} +2 -3
  150. package/package.json +1 -1
  151. package/dist/chunk-DDANJIE7.js +0 -207
  152. package/dist/chunk-J65IXAGI.js +0 -292
  153. package/dist/chunk-V5XHY5LP.js +0 -39
  154. package/dist/chunk-ZZ3XFIEM.js +0 -84
  155. package/dist/product-brand-create-B3ZJGHUQ.js +0 -171
  156. package/dist/product-brand-detail-O7UKYV4H.js +0 -100
  157. package/dist/product-brand-edit-3TQDHZNN.js +0 -179
  158. package/dist/product-brand-list-ZBPBSRQN.js +0 -30
  159. package/dist/product-brand-metadata-N2CJ5K3Z.js +0 -87
  160. /package/dist/{chunk-46A3QXAL.js → chunk-LYREZINJ.js} +0 -0
@@ -1,292 +0,0 @@
1
- import {
2
- useDeleteProductBrandAction
3
- } from "./chunk-V5XHY5LP.js";
4
- import {
5
- useDateTableFilters
6
- } from "./chunk-26OOAKQ6.js";
7
- import {
8
- DateCell
9
- } from "./chunk-25LYVP3C.js";
10
- import {
11
- TextCell
12
- } from "./chunk-JHIMVLB2.js";
13
- import {
14
- _DataTable,
15
- useDataTable
16
- } from "./chunk-NQEXDLYH.js";
17
- import {
18
- SingleColumnPage
19
- } from "./chunk-H6MYB7GB.js";
20
- import {
21
- useQueryParams
22
- } from "./chunk-THHRRYRS.js";
23
- import {
24
- useProductBrands
25
- } from "./chunk-ZZ3XFIEM.js";
26
- import {
27
- ActionMenu
28
- } from "./chunk-BDGZ4EQO.js";
29
-
30
- // src/pages/product-brands/product-brand-list/product-brand-list.tsx
31
- import { Children as Children3 } from "react";
32
-
33
- // src/pages/product-brands/product-brand-list/components/product-brand-list-view/product-brand-list-view.tsx
34
- import { Children as Children2 } from "react";
35
- import { Container } from "@medusajs/ui";
36
-
37
- // src/pages/product-brands/product-brand-list/components/product-brand-list-view/product-brand-list-data-table.tsx
38
- import { keepPreviousData } from "@tanstack/react-query";
39
- import { createColumnHelper as createColumnHelper2 } from "@tanstack/react-table";
40
- import { useMemo as useMemo2 } from "react";
41
- import { useTranslation as useTranslation3 } from "react-i18next";
42
-
43
- // src/hooks/table/columns/use-product-brand-table-columns.tsx
44
- import { createColumnHelper } from "@tanstack/react-table";
45
- import { useMemo } from "react";
46
- import { useTranslation } from "react-i18next";
47
- import { jsx } from "react/jsx-runtime";
48
- var columnHelper = createColumnHelper();
49
- var useProductBrandTableColumns = () => {
50
- const { t } = useTranslation();
51
- return useMemo(
52
- () => [
53
- columnHelper.accessor("name", {
54
- header: () => t("fields.name"),
55
- cell: ({ getValue }) => /* @__PURE__ */ jsx(TextCell, { text: getValue() })
56
- }),
57
- columnHelper.accessor("handle", {
58
- header: () => t("fields.handle"),
59
- cell: ({ getValue }) => /* @__PURE__ */ jsx(TextCell, { text: getValue() })
60
- }),
61
- columnHelper.accessor("created_at", {
62
- header: () => t("fields.createdAt"),
63
- cell: ({ getValue }) => {
64
- return /* @__PURE__ */ jsx(DateCell, { date: getValue() });
65
- }
66
- }),
67
- columnHelper.accessor("updated_at", {
68
- header: () => t("fields.updatedAt"),
69
- cell: ({ getValue }) => {
70
- return /* @__PURE__ */ jsx(DateCell, { date: getValue() });
71
- }
72
- })
73
- ],
74
- [t]
75
- );
76
- };
77
-
78
- // src/hooks/table/filters/use-product-brand-table-filters.tsx
79
- var useProductBrandTableFilters = () => {
80
- const dateFilters = useDateTableFilters();
81
- return dateFilters;
82
- };
83
-
84
- // src/hooks/table/query/use-product-brand-table-query.tsx
85
- var useProductBrandTableQuery = ({
86
- prefix,
87
- pageSize = 20
88
- }) => {
89
- const queryObject = useQueryParams(
90
- ["offset", "q", "order", "created_at", "updated_at"],
91
- prefix
92
- );
93
- const { offset, q, order, created_at, updated_at } = queryObject;
94
- const searchParams = {
95
- limit: pageSize,
96
- offset: offset ? Number(offset) : 0,
97
- order,
98
- created_at: created_at ? JSON.parse(created_at) : void 0,
99
- updated_at: updated_at ? JSON.parse(updated_at) : void 0,
100
- q
101
- };
102
- return {
103
- searchParams,
104
- raw: queryObject
105
- };
106
- };
107
-
108
- // src/pages/product-brands/product-brand-list/components/product-brand-list-table/product-brand-row-actions.tsx
109
- import { PencilSquare, Trash } from "@medusajs/icons";
110
- import { useTranslation as useTranslation2 } from "react-i18next";
111
- import { jsx as jsx2 } from "react/jsx-runtime";
112
- var ProductBrandRowActions = ({
113
- productBrand
114
- }) => {
115
- const { t } = useTranslation2();
116
- const handleDelete = useDeleteProductBrandAction(
117
- productBrand.id,
118
- productBrand.name
119
- );
120
- return /* @__PURE__ */ jsx2(
121
- ActionMenu,
122
- {
123
- groups: [
124
- {
125
- actions: [
126
- {
127
- label: t("actions.edit"),
128
- icon: /* @__PURE__ */ jsx2(PencilSquare, {}),
129
- to: `/settings/product-brands/${productBrand.id}/edit`
130
- }
131
- ]
132
- },
133
- {
134
- actions: [
135
- {
136
- label: t("actions.delete"),
137
- icon: /* @__PURE__ */ jsx2(Trash, {}),
138
- onClick: handleDelete
139
- }
140
- ]
141
- }
142
- ],
143
- "data-testid": `product-brand-list-table-action-menu-${productBrand.id}`
144
- }
145
- );
146
- };
147
-
148
- // src/pages/product-brands/product-brand-list/components/product-brand-list-view/product-brand-list-data-table.tsx
149
- import { jsx as jsx3 } from "react/jsx-runtime";
150
- var PAGE_SIZE = 20;
151
- var ProductBrandListDataTable = () => {
152
- const { t } = useTranslation3();
153
- const { searchParams, raw } = useProductBrandTableQuery({
154
- pageSize: PAGE_SIZE
155
- });
156
- const { product_brands, count, isLoading, isError, error } = useProductBrands(
157
- searchParams,
158
- {
159
- placeholderData: keepPreviousData
160
- }
161
- );
162
- const filters = useProductBrandTableFilters();
163
- const columns = useColumns();
164
- const { table } = useDataTable({
165
- columns,
166
- data: product_brands,
167
- count,
168
- getRowId: (row) => row.id,
169
- pageSize: PAGE_SIZE
170
- });
171
- if (isError) {
172
- throw error;
173
- }
174
- return /* @__PURE__ */ jsx3(
175
- _DataTable,
176
- {
177
- table,
178
- filters,
179
- isLoading,
180
- columns,
181
- pageSize: PAGE_SIZE,
182
- count,
183
- orderBy: [
184
- { key: "name", label: t("fields.name") },
185
- { key: "handle", label: t("fields.handle") },
186
- { key: "created_at", label: t("fields.createdAt") },
187
- { key: "updated_at", label: t("fields.updatedAt") }
188
- ],
189
- navigateTo: ({ original }) => original.id,
190
- queryObject: raw,
191
- pagination: true,
192
- search: true,
193
- "data-testid": "product-brand-list-table"
194
- }
195
- );
196
- };
197
- var columnHelper2 = createColumnHelper2();
198
- var useColumns = () => {
199
- const base = useProductBrandTableColumns();
200
- return useMemo2(
201
- () => [
202
- ...base,
203
- columnHelper2.display({
204
- id: "actions",
205
- cell: ({ row }) => {
206
- return /* @__PURE__ */ jsx3(ProductBrandRowActions, { productBrand: row.original });
207
- }
208
- })
209
- ],
210
- [base]
211
- );
212
- };
213
-
214
- // src/pages/product-brands/product-brand-list/components/product-brand-list-view/product-brand-list-header.tsx
215
- import { Children } from "react";
216
- import { Button, Heading, Text } from "@medusajs/ui";
217
- import { useTranslation as useTranslation4 } from "react-i18next";
218
- import { Link } from "react-router-dom";
219
- import { Fragment, jsx as jsx4, jsxs } from "react/jsx-runtime";
220
- var ProductBrandListTitle = () => {
221
- const { t } = useTranslation4();
222
- return /* @__PURE__ */ jsxs("div", { children: [
223
- /* @__PURE__ */ jsx4(Heading, { "data-testid": "product-brand-list-table-heading", children: t("productBrands.domain") }),
224
- /* @__PURE__ */ jsx4(
225
- Text,
226
- {
227
- className: "text-ui-fg-subtle",
228
- size: "small",
229
- "data-testid": "product-brand-list-table-subtitle",
230
- children: t("productBrands.subtitle")
231
- }
232
- )
233
- ] });
234
- };
235
- var ProductBrandListActions = ({
236
- children
237
- }) => {
238
- const { t } = useTranslation4();
239
- return /* @__PURE__ */ jsx4("div", { className: "flex items-center justify-center gap-x-2", children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsx4(
240
- Button,
241
- {
242
- size: "small",
243
- variant: "secondary",
244
- asChild: true,
245
- "data-testid": "product-brand-list-table-create-button",
246
- children: /* @__PURE__ */ jsx4(Link, { to: "create", children: t("actions.create") })
247
- }
248
- ) });
249
- };
250
- var ProductBrandListHeader = ({
251
- children
252
- }) => {
253
- return /* @__PURE__ */ jsx4(
254
- "div",
255
- {
256
- className: "flex items-center justify-between px-6 py-4",
257
- "data-testid": "product-brand-list-table-header",
258
- children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
259
- /* @__PURE__ */ jsx4(ProductBrandListTitle, {}),
260
- /* @__PURE__ */ jsx4(ProductBrandListActions, {})
261
- ] })
262
- }
263
- );
264
- };
265
-
266
- // src/pages/product-brands/product-brand-list/components/product-brand-list-view/product-brand-list-view.tsx
267
- import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
268
- var ProductBrandListView = ({
269
- children
270
- }) => {
271
- return /* @__PURE__ */ jsx5(Container, { className: "divide-y p-0", children: Children2.count(children) > 0 ? children : /* @__PURE__ */ jsxs2(Fragment2, { children: [
272
- /* @__PURE__ */ jsx5(ProductBrandListHeader, {}),
273
- /* @__PURE__ */ jsx5(ProductBrandListDataTable, {})
274
- ] }) });
275
- };
276
-
277
- // src/pages/product-brands/product-brand-list/product-brand-list.tsx
278
- import { jsx as jsx6 } from "react/jsx-runtime";
279
- var Root = ({ children }) => {
280
- return /* @__PURE__ */ jsx6(SingleColumnPage, { children: Children3.count(children) > 0 ? children : /* @__PURE__ */ jsx6(ProductBrandListView, {}) });
281
- };
282
- var ProductBrandListPage = Object.assign(Root, {
283
- Table: ProductBrandListView,
284
- Header: ProductBrandListHeader,
285
- HeaderTitle: ProductBrandListTitle,
286
- HeaderActions: ProductBrandListActions,
287
- DataTable: ProductBrandListDataTable
288
- });
289
-
290
- export {
291
- ProductBrandListPage
292
- };
@@ -1,39 +0,0 @@
1
- import {
2
- useDeleteProductBrand
3
- } from "./chunk-ZZ3XFIEM.js";
4
-
5
- // src/pages/product-brands/common/hooks/use-delete-product-brand-action.tsx
6
- import { useNavigate } from "react-router-dom";
7
- import { toast, usePrompt } from "@medusajs/ui";
8
- import { useTranslation } from "react-i18next";
9
- var useDeleteProductBrandAction = (id, name) => {
10
- const { t } = useTranslation();
11
- const prompt = usePrompt();
12
- const navigate = useNavigate();
13
- const { mutateAsync } = useDeleteProductBrand(id);
14
- const handleDelete = async () => {
15
- const result = await prompt({
16
- title: t("general.areYouSure"),
17
- description: t("productBrands.delete.confirmation", { name }),
18
- confirmText: t("actions.delete"),
19
- cancelText: t("actions.cancel")
20
- });
21
- if (!result) {
22
- return;
23
- }
24
- await mutateAsync(void 0, {
25
- onSuccess: () => {
26
- navigate("/settings/product-brands", { replace: true });
27
- toast.success(t("productBrands.delete.successToast", { name }));
28
- },
29
- onError: (e) => {
30
- toast.error(e.message);
31
- }
32
- });
33
- };
34
- return handleDelete;
35
- };
36
-
37
- export {
38
- useDeleteProductBrandAction
39
- };
@@ -1,84 +0,0 @@
1
- import {
2
- queryClient
3
- } from "./chunk-RHKRREUU.js";
4
- import {
5
- queryKeysFactory
6
- } from "./chunk-ZA2KFUFR.js";
7
- import {
8
- sdk
9
- } from "./chunk-ZBWL72TB.js";
10
-
11
- // src/hooks/api/product-brands.tsx
12
- import {
13
- useMutation,
14
- useQuery
15
- } from "@tanstack/react-query";
16
- var PRODUCT_BRANDS_QUERY_KEY = "product_brands";
17
- var productBrandsQueryKeys = queryKeysFactory(PRODUCT_BRANDS_QUERY_KEY);
18
- var useProductBrand = (id, query, options) => {
19
- const { data, ...rest } = useQuery({
20
- queryFn: () => sdk.admin.productBrands.$id.query({ $id: id, ...query }),
21
- queryKey: productBrandsQueryKeys.detail(id),
22
- ...options
23
- });
24
- return { ...data, ...rest };
25
- };
26
- var useProductBrands = (query, options) => {
27
- const { data, ...rest } = useQuery({
28
- queryFn: () => sdk.admin.productBrands.query({ ...query }),
29
- queryKey: productBrandsQueryKeys.list(query),
30
- ...options
31
- });
32
- return { ...data, ...rest };
33
- };
34
- var useCreateProductBrand = (options) => {
35
- return useMutation({
36
- mutationFn: (payload) => sdk.admin.productBrands.mutate(payload),
37
- onSuccess: (data, variables, context) => {
38
- queryClient.invalidateQueries({
39
- queryKey: productBrandsQueryKeys.lists()
40
- });
41
- options?.onSuccess?.(data, variables, context);
42
- },
43
- ...options
44
- });
45
- };
46
- var useUpdateProductBrand = (id, options) => {
47
- return useMutation({
48
- mutationFn: (payload) => sdk.admin.productBrands.$id.mutate({ $id: id, ...payload }),
49
- onSuccess: (data, variables, context) => {
50
- queryClient.invalidateQueries({
51
- queryKey: productBrandsQueryKeys.detail(id)
52
- });
53
- queryClient.invalidateQueries({
54
- queryKey: productBrandsQueryKeys.lists()
55
- });
56
- options?.onSuccess?.(data, variables, context);
57
- },
58
- ...options
59
- });
60
- };
61
- var useDeleteProductBrand = (id, options) => {
62
- return useMutation({
63
- mutationFn: () => sdk.admin.productBrands.$id.delete({ $id: id }),
64
- onSuccess: (data, variables, context) => {
65
- queryClient.invalidateQueries({
66
- queryKey: productBrandsQueryKeys.detail(id)
67
- });
68
- queryClient.invalidateQueries({
69
- queryKey: productBrandsQueryKeys.lists()
70
- });
71
- options?.onSuccess?.(data, variables, context);
72
- },
73
- ...options
74
- });
75
- };
76
-
77
- export {
78
- productBrandsQueryKeys,
79
- useProductBrand,
80
- useProductBrands,
81
- useCreateProductBrand,
82
- useUpdateProductBrand,
83
- useDeleteProductBrand
84
- };
@@ -1,171 +0,0 @@
1
- import {
2
- HandleInput
3
- } from "./chunk-HJ56YXBU.js";
4
- import "./chunk-TKGWSUEI.js";
5
- import {
6
- KeyboundForm
7
- } from "./chunk-U2ZFCAPX.js";
8
- import {
9
- RouteFocusModal,
10
- useRouteModal
11
- } from "./chunk-FWJLS7XD.js";
12
- import {
13
- Form
14
- } from "./chunk-3QSRE5LS.js";
15
- import {
16
- useCreateProductBrand
17
- } from "./chunk-ZZ3XFIEM.js";
18
- import "./chunk-RHKRREUU.js";
19
- import "./chunk-ZA2KFUFR.js";
20
- import "./chunk-ZBWL72TB.js";
21
- import "./chunk-NBMM2TZK.js";
22
-
23
- // src/pages/product-brands/product-brand-create/components/create-product-brand-form/create-product-brand-form.tsx
24
- import { zodResolver } from "@hookform/resolvers/zod";
25
- import { Button, Heading, Input, Text, toast } from "@medusajs/ui";
26
- import { useForm } from "react-hook-form";
27
- import { useTranslation } from "react-i18next";
28
- import { z } from "zod";
29
- import { jsx, jsxs } from "react/jsx-runtime";
30
- var CreateProductBrandSchema = z.object({
31
- name: z.string().min(1),
32
- handle: z.string().optional()
33
- });
34
- var CreateProductBrandForm = () => {
35
- const { t } = useTranslation();
36
- const { handleSuccess } = useRouteModal();
37
- const form = useForm({
38
- defaultValues: {
39
- name: "",
40
- handle: ""
41
- },
42
- resolver: zodResolver(CreateProductBrandSchema)
43
- });
44
- const { mutateAsync, isPending } = useCreateProductBrand();
45
- const handleSubmit = form.handleSubmit(
46
- async (values) => {
47
- await mutateAsync(
48
- {
49
- name: values.name,
50
- handle: values.handle ? values.handle : void 0
51
- },
52
- {
53
- onSuccess: ({ product_brand }) => {
54
- toast.success(
55
- t("productBrands.create.successToast", {
56
- name: product_brand.name.trim()
57
- })
58
- );
59
- handleSuccess(`/settings/product-brands/${product_brand.id}`);
60
- },
61
- onError: (e) => {
62
- toast.error(e.message);
63
- }
64
- }
65
- );
66
- }
67
- );
68
- return /* @__PURE__ */ jsx(RouteFocusModal.Form, { form, "data-testid": "product-brand-create-form", children: /* @__PURE__ */ jsxs(KeyboundForm, { onSubmit: handleSubmit, className: "flex h-full flex-col", children: [
69
- /* @__PURE__ */ jsx(
70
- RouteFocusModal.Body,
71
- {
72
- className: "flex flex-col items-center overflow-auto p-16",
73
- "data-testid": "product-brand-create-form-body",
74
- children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
75
- /* @__PURE__ */ jsxs("div", { "data-testid": "product-brand-create-form-header-section", children: [
76
- /* @__PURE__ */ jsx(Heading, { "data-testid": "product-brand-create-form-heading", children: t("productBrands.create.header") }),
77
- /* @__PURE__ */ jsx(
78
- Text,
79
- {
80
- size: "small",
81
- className: "text-ui-fg-subtle",
82
- "data-testid": "product-brand-create-form-hint",
83
- children: t("productBrands.create.hint")
84
- }
85
- )
86
- ] }),
87
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
88
- /* @__PURE__ */ jsx(
89
- Form.Field,
90
- {
91
- control: form.control,
92
- name: "name",
93
- render: ({ field }) => {
94
- return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "product-brand-create-form-name-item", children: [
95
- /* @__PURE__ */ jsx(Form.Label, { "data-testid": "product-brand-create-form-name-label", children: t("fields.name") }),
96
- /* @__PURE__ */ jsx(Form.Control, { "data-testid": "product-brand-create-form-name-control", children: /* @__PURE__ */ jsx(
97
- Input,
98
- {
99
- ...field,
100
- "data-testid": "product-brand-create-form-name-input"
101
- }
102
- ) }),
103
- /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "product-brand-create-form-name-error" })
104
- ] });
105
- }
106
- }
107
- ),
108
- /* @__PURE__ */ jsx(
109
- Form.Field,
110
- {
111
- control: form.control,
112
- name: "handle",
113
- render: ({ field }) => {
114
- return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "product-brand-create-form-handle-item", children: [
115
- /* @__PURE__ */ jsx(
116
- Form.Label,
117
- {
118
- optional: true,
119
- "data-testid": "product-brand-create-form-handle-label",
120
- children: t("fields.handle")
121
- }
122
- ),
123
- /* @__PURE__ */ jsx(Form.Control, { "data-testid": "product-brand-create-form-handle-control", children: /* @__PURE__ */ jsx(
124
- HandleInput,
125
- {
126
- ...field,
127
- "data-testid": "product-brand-create-form-handle-input"
128
- }
129
- ) }),
130
- /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "product-brand-create-form-handle-error" })
131
- ] });
132
- }
133
- }
134
- )
135
- ] })
136
- ] })
137
- }
138
- ),
139
- /* @__PURE__ */ jsx(RouteFocusModal.Footer, { "data-testid": "product-brand-create-form-footer", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
140
- /* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(
141
- Button,
142
- {
143
- size: "small",
144
- variant: "secondary",
145
- "data-testid": "product-brand-create-form-cancel-button",
146
- children: t("actions.cancel")
147
- }
148
- ) }),
149
- /* @__PURE__ */ jsx(
150
- Button,
151
- {
152
- size: "small",
153
- variant: "primary",
154
- type: "submit",
155
- isLoading: isPending,
156
- "data-testid": "product-brand-create-form-create-button",
157
- children: t("actions.create")
158
- }
159
- )
160
- ] }) })
161
- ] }) });
162
- };
163
-
164
- // src/pages/product-brands/product-brand-create/product-brand-create.tsx
165
- import { jsx as jsx2 } from "react/jsx-runtime";
166
- var ProductBrandCreate = () => {
167
- return /* @__PURE__ */ jsx2(RouteFocusModal, { "data-testid": "product-brand-create-modal", children: /* @__PURE__ */ jsx2(CreateProductBrandForm, {}) });
168
- };
169
- export {
170
- ProductBrandCreate as Component
171
- };
@@ -1,100 +0,0 @@
1
- import {
2
- ProductBrandDetailPage
3
- } from "./chunk-DDANJIE7.js";
4
- import "./chunk-V5XHY5LP.js";
5
- import "./chunk-6NDM5WGE.js";
6
- import "./chunk-UKDC2AQR.js";
7
- import "./chunk-NMFVQDVF.js";
8
- import "./chunk-FWPGOIFA.js";
9
- import "./chunk-LYZDVZWA.js";
10
- import "./chunk-DB6ANJBO.js";
11
- import "./chunk-PHOCVOZ5.js";
12
- import "./chunk-FQERBIVS.js";
13
- import "./chunk-NQEXDLYH.js";
14
- import "./chunk-YN3FGNJM.js";
15
- import "./chunk-KAZ5BYTQ.js";
16
- import "./chunk-634XVU3D.js";
17
- import "./chunk-E74OUNA3.js";
18
- import "./chunk-WIYFXWRI.js";
19
- import "./chunk-H6MYB7GB.js";
20
- import "./chunk-UZWFZMOX.js";
21
- import "./chunk-XQNVC4Q7.js";
22
- import "./chunk-F5H5JZQZ.js";
23
- import "./chunk-THHRRYRS.js";
24
- import "./chunk-46A3QXAL.js";
25
- import "./chunk-OH4AABUT.js";
26
- import "./chunk-AEMDNTW5.js";
27
- import "./chunk-LYD3C73Z.js";
28
- import {
29
- productBrandsQueryKeys,
30
- useProductBrand
31
- } from "./chunk-ZZ3XFIEM.js";
32
- import "./chunk-4RT7P5ZQ.js";
33
- import "./chunk-533GMKEG.js";
34
- import "./chunk-46M463BR.js";
35
- import "./chunk-YFRC6GEN.js";
36
- import "./chunk-JPNPTILP.js";
37
- import "./chunk-DAXXLQKB.js";
38
- import "./chunk-OHOWEMHO.js";
39
- import "./chunk-GKGLVDDV.js";
40
- import "./chunk-ESPLVOFC.js";
41
- import "./chunk-N6SI4IIT.js";
42
- import "./chunk-WJJXUXSO.js";
43
- import "./chunk-LAPEZATU.js";
44
- import "./chunk-2ZRWLCYP.js";
45
- import "./chunk-E5WBU7ZR.js";
46
- import "./chunk-FXWKGNRV.js";
47
- import "./chunk-VDKOJ5WD.js";
48
- import "./chunk-ZN7LWXVC.js";
49
- import "./chunk-5TRY5IMZ.js";
50
- import "./chunk-EPHVGD5Z.js";
51
- import "./chunk-N3BYBEDV.js";
52
- import "./chunk-ZB4SO44T.js";
53
- import "./chunk-VYMODH6P.js";
54
- import "./chunk-LEG67A2R.js";
55
- import "./chunk-PRBE5CM3.js";
56
- import "./chunk-BDGZ4EQO.js";
57
- import "./chunk-FEC24V7X.js";
58
- import "./chunk-EB5QHYKL.js";
59
- import "./chunk-LAVHRER2.js";
60
- import "./chunk-Y7QKP6QU.js";
61
- import "./chunk-INNFZYX2.js";
62
- import "./chunk-ZRFWXNT3.js";
63
- import {
64
- queryClient
65
- } from "./chunk-RHKRREUU.js";
66
- import "./chunk-ZA2KFUFR.js";
67
- import {
68
- sdk
69
- } from "./chunk-ZBWL72TB.js";
70
- import "./chunk-NBMM2TZK.js";
71
-
72
- // src/pages/product-brands/product-brand-detail/breadcrumb.tsx
73
- import { jsx } from "react/jsx-runtime";
74
- var ProductBrandDetailBreadcrumb = (props) => {
75
- const { id } = props.params || {};
76
- const { product_brand } = useProductBrand(id, void 0, {
77
- initialData: props.data,
78
- enabled: Boolean(id)
79
- });
80
- if (!product_brand) {
81
- return null;
82
- }
83
- return /* @__PURE__ */ jsx("span", { children: product_brand.name });
84
- };
85
-
86
- // src/pages/product-brands/product-brand-detail/loader.ts
87
- var productBrandDetailQuery = (id) => ({
88
- queryKey: productBrandsQueryKeys.detail(id),
89
- queryFn: async () => sdk.admin.productBrands.$id.query({ $id: id })
90
- });
91
- var productBrandLoader = async ({ params }) => {
92
- const id = params.id;
93
- const query = productBrandDetailQuery(id);
94
- return queryClient.ensureQueryData(query);
95
- };
96
- export {
97
- ProductBrandDetailBreadcrumb as Breadcrumb,
98
- ProductBrandDetailPage as Component,
99
- productBrandLoader as loader
100
- };