@mercurjs/admin 2.0.0-canary.39 → 2.0.0-canary.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-campaign-promotions-ZUXBF5G3.js → add-campaign-promotions-7TPECJOT.js} +4 -4
- package/dist/{api-key-management-detail-SKJNAZ5L.js → api-key-management-detail-2EFDWJSF.js} +7 -7
- package/dist/{api-key-management-list-2D4WKI6Y.js → api-key-management-list-UZLHSM2R.js} +6 -5
- package/dist/{api-key-management-sales-channels-C7EWPHC2.js → api-key-management-sales-channels-ER5ZINL7.js} +6 -7
- package/dist/{campaign-create-B7XM2FZM.js → campaign-create-AFR3V7P4.js} +3 -3
- package/dist/{campaign-detail-7U4CQHU5.js → campaign-detail-UUNEZUY7.js} +9 -8
- package/dist/{campaign-list-SC7FLTRM.js → campaign-list-2AAGWYEG.js} +6 -5
- package/dist/category-create-LY45Z7YB.js +23 -0
- package/dist/{category-detail-HGHR3R2R.js → category-detail-AGTIMI6P.js} +7 -6
- package/dist/{category-list-QBBFGHQM.js → category-list-ROM7UTA4.js} +6 -5
- package/dist/{chunk-ENMRRG4N.js → chunk-2AWQ4FPA.js} +6 -6
- package/dist/{chunk-VBAAYYCS.js → chunk-2HPZJCAF.js} +6 -6
- package/dist/{chunk-SFG7JTBH.js → chunk-2LAANNMF.js} +111 -48
- package/dist/{chunk-KYUXTS2L.js → chunk-2UN7CNBG.js} +7 -7
- package/dist/chunk-3LTXCGNM.js +204 -0
- package/dist/{chunk-EDQBUWY7.js → chunk-3NIWL75F.js} +6 -6
- package/dist/{product-create-variant-CJPECBV4.js → chunk-4UTK7DZN.js} +63 -69
- package/dist/{chunk-5VEYNZSW.js → chunk-5322X23U.js} +9 -4
- package/dist/{chunk-U3SFHLUA.js → chunk-53IISBJZ.js} +1 -0
- package/dist/{chunk-DGCPYCHU.js → chunk-54RTJBYO.js} +63 -8
- package/dist/{chunk-E2AAYIHS.js → chunk-5EFOVNK2.js} +3 -3
- package/dist/{chunk-NQPAEBSZ.js → chunk-6E3T6CGY.js} +15 -7
- package/dist/{chunk-V2DXJ75C.js → chunk-6OA7JZ5E.js} +1 -1
- package/dist/chunk-72IQIAGX.js +245 -0
- package/dist/{chunk-3IYIS5UZ.js → chunk-7DOPC5GY.js} +4 -4
- package/dist/{chunk-Q6XCCONH.js → chunk-AI6RJGRQ.js} +9 -9
- package/dist/{price-list-create-OK7YYLAB.js → chunk-AJZQBGE4.js} +193 -428
- package/dist/{chunk-XDVS4B7W.js → chunk-BAV6Y7RC.js} +8 -7
- package/dist/{chunk-4WYBW3HK.js → chunk-BCAT7P6B.js} +3 -3
- package/dist/{chunk-LYT3RI4O.js → chunk-BHYDGWZ6.js} +18 -9
- package/dist/{chunk-DK3U2SRA.js → chunk-BIEYPCHL.js} +5 -5
- package/dist/{product-create-NVBKO426.js → chunk-BLG726FI.js} +36 -68
- package/dist/chunk-BVRI7YAR.js +100 -0
- package/dist/{chunk-2IGCU3KP.js → chunk-DOMRLXOI.js} +2 -2
- package/dist/{chunk-K6FXWZ2M.js → chunk-F55UXYYA.js} +10 -0
- package/dist/{chunk-AOVEX4EM.js → chunk-FNXSMFGL.js} +5 -5
- package/dist/{chunk-IXGP2EEN.js → chunk-FYAYHOCN.js} +2 -3
- package/dist/{chunk-QBOXELB5.js → chunk-GJHAVFXL.js} +4 -4
- package/dist/{price-list-prices-add-7PGUONDK.js → chunk-GOVOSXUU.js} +90 -290
- package/dist/{chunk-66IHH2HG.js → chunk-H6W6Q6YE.js} +3 -3
- package/dist/{seller-details-KROISMQC.js → chunk-HVLQFQGD.js} +74 -146
- package/dist/{chunk-QD6KYDYH.js → chunk-I6R4I7EF.js} +6 -6
- package/dist/{chunk-RIMR3ULR.js → chunk-ISYWL6RZ.js} +64 -33
- package/dist/{chunk-HHNJNKCB.js → chunk-KMUEJ3IE.js} +59 -20
- package/dist/{chunk-GJTIHFXG.js → chunk-KOILMFJX.js} +29 -31
- package/dist/{chunk-3SAH3NUS.js → chunk-LIXRNUG5.js} +1 -1
- package/dist/chunk-LOJD5572.js +433 -0
- package/dist/{chunk-T25UE7SS.js → chunk-MD56QRKC.js} +6 -6
- package/dist/{chunk-S4QUEQQK.js → chunk-MSFNMGFD.js} +48 -48
- package/dist/{chunk-YH4VQBAA.js → chunk-MX52GGQO.js} +81 -52
- package/dist/{chunk-O6O22BN4.js → chunk-N7BCAAJC.js} +113 -48
- package/dist/{chunk-JA2XIIIZ.js → chunk-NXKCVD5F.js} +6 -5
- package/dist/{chunk-G4QMLQF2.js → chunk-NZN7PFPB.js} +2 -4
- package/dist/{chunk-KUDLPUWR.js → chunk-OFWYMU6K.js} +8 -8
- package/dist/chunk-OOAY7PAK.js +1155 -0
- package/dist/chunk-PAQH5QQH.js +685 -0
- package/dist/{chunk-3H74EI2D.js → chunk-POCHIWE2.js} +100 -40
- package/dist/chunk-PXBCTPQO.js +248 -0
- package/dist/chunk-QSZ2FIM2.js +223 -0
- package/dist/{chunk-23663A2W.js → chunk-R5VKVG6S.js} +1 -1
- package/dist/{chunk-DP5U3GQU.js → chunk-RXUUBJSZ.js} +1 -1
- package/dist/{chunk-FYB5MS4F.js → chunk-S2GARTQU.js} +6 -6
- package/dist/{chunk-7TLEUIAL.js → chunk-SO6PXIPV.js} +21 -16
- package/dist/{category-create-UWBJGIED.js → chunk-ST74PSEZ.js} +78 -149
- package/dist/{chunk-33FUPXJL.js → chunk-T3OYE2MH.js} +4 -4
- package/dist/{chunk-JRWB7VWP.js → chunk-U4RMXPGI.js} +8 -8
- package/dist/{chunk-YGSM5PVN.js → chunk-UI2BJVP5.js} +1 -1
- package/dist/{chunk-FXU7SL6M.js → chunk-UOIUQC3P.js} +25 -15
- package/dist/{chunk-ZU2RNSCP.js → chunk-UONTDHRH.js} +4 -2
- package/dist/{chunk-J7SR4GW5.js → chunk-V3SHSLK4.js} +4 -4
- package/dist/{chunk-TE5VQBCL.js → chunk-V42ZR4XW.js} +8 -9
- package/dist/chunk-V5J73NPW.js +117 -0
- package/dist/{chunk-QP6XXG6A.js → chunk-VOFAM7HJ.js} +74 -42
- package/dist/{chunk-CR4E2DCR.js → chunk-VT3RBTYK.js} +3 -3
- package/dist/{chunk-AOVJTW7M.js → chunk-VWQYMOBM.js} +9 -9
- package/dist/{chunk-6L2LSIPR.js → chunk-VXAQZ2ZZ.js} +4 -4
- package/dist/{chunk-OSHCUDYY.js → chunk-X3KBQBGW.js} +6 -6
- package/dist/{chunk-WZADCDDE.js → chunk-X56THFPA.js} +2 -1
- package/dist/{chunk-HZKW7HRU.js → chunk-X7NWBH7T.js} +64 -35
- package/dist/{chunk-OFRQZHVQ.js → chunk-XE5ZMNUN.js} +6 -6
- package/dist/{chunk-4GVHNYZR.js → chunk-XHVYNMTA.js} +2 -2
- package/dist/{chunk-U2UCL2VG.js → chunk-XIZLPYEE.js} +3 -111
- package/dist/{chunk-KXPCEVFB.js → chunk-XOKRMMVP.js} +6 -6
- package/dist/{chunk-XVKRTPVM.js → chunk-Y5N26ZC3.js} +41 -15
- package/dist/{chunk-A6Z2Q7D5.js → chunk-Z2MDPTF2.js} +4 -2
- package/dist/{chunk-TKGZBTOS.js → chunk-ZFSZTRZ6.js} +54 -32
- package/dist/{chunk-RV6NZTNP.js → chunk-ZZEAWVFX.js} +27 -27
- package/dist/{collection-detail-YJ3FV2C6.js → collection-detail-SRR3HSIV.js} +7 -6
- package/dist/{collection-list-WDQOBHQN.js → collection-list-MKISW5S4.js} +6 -5
- package/dist/{commission-rate-detail-UQDIIMIK.js → commission-rate-detail-GLB733F3.js} +5 -4
- package/dist/{commission-rate-list-WTDZLKUR.js → commission-rate-list-5V3FQROA.js} +6 -5
- package/dist/{customer-detail-N7CS4IJU.js → customer-detail-SBQF232S.js} +4 -3
- package/dist/customer-group-add-customers-LCNDTLXR.js +1 -1
- package/dist/{customer-group-detail-UCTY4FF7.js → customer-group-detail-QQSNRM2K.js} +6 -5
- package/dist/{customer-group-list-XOQ64CVR.js → customer-group-list-IO7SVK3F.js} +15 -6
- package/dist/{customer-list-BUUO6OF7.js → customer-list-TXBAME4V.js} +4 -3
- package/dist/customers-add-customer-group-BKEV24N2.js +1 -1
- package/dist/index.d.ts +225 -16
- package/dist/index.js +581 -387
- package/dist/inventory-create-Q4JIXZTT.js +56 -0
- package/dist/{inventory-detail-BJT5WEV5.js → inventory-detail-3D37JWQT.js} +7 -6
- package/dist/{inventory-list-3LWBPWVK.js → inventory-list-WH42ADNB.js} +6 -5
- package/dist/{inventory-stock-G3GP4FZX.js → inventory-stock-DTKOGYT7.js} +6 -6
- package/dist/{location-detail-N7J6PEAP.js → location-detail-2SSHXSKL.js} +5 -4
- package/dist/location-fulfillment-providers-BHCY2MYC.js +1 -1
- package/dist/{location-list-UG6B47NP.js → location-list-LPISOSQI.js} +5 -4
- package/dist/{location-sales-channels-3IGHCJEN.js → location-sales-channels-PPH53OHD.js} +6 -7
- package/dist/location-service-zone-shipping-option-create-GSXLVEGO.js +57 -0
- package/dist/{location-service-zone-shipping-option-pricing-7VMPXDWX.js → location-service-zone-shipping-option-pricing-4CTGXBP3.js} +6 -6
- package/dist/marketplace-add-currencies-CIGOPBO6.js +1 -1
- package/dist/{marketplace-detail-7KJMXXAJ.js → marketplace-detail-3CBLIYVK.js} +6 -5
- package/dist/{order-detail-C25NQSZN.js → order-detail-AJV2PE7J.js} +7 -6
- package/dist/{order-edit-billing-address-NVRMPZEU.js → order-edit-billing-address-QQUPIC2H.js} +6 -6
- package/dist/{order-list-7NH7LROU.js → order-list-VPQOG5WE.js} +6 -5
- package/dist/pages/index.d.ts +2608 -82
- package/dist/pages/index.js +238 -156
- package/dist/{payout-detail-MDD5SRK5.js → payout-detail-PMR26YQI.js} +5 -4
- package/dist/{payout-list-XY2A5KYS.js → payout-list-DMG7MQM7.js} +6 -4
- package/dist/price-list-configuration-XK3IZLLX.js +1 -1
- package/dist/price-list-create-QS6CVEWS.js +76 -0
- package/dist/{price-list-detail-IGFSM77P.js → price-list-detail-IO5ZURVW.js} +7 -6
- package/dist/{price-list-list-TBXQ5DOS.js → price-list-list-B3FKB46L.js} +6 -5
- package/dist/price-list-prices-add-NSAQWBT6.js +71 -0
- package/dist/{price-list-prices-edit-QVGBT6AI.js → price-list-prices-edit-UOAIOS5X.js} +6 -6
- package/dist/product-create-UVKMOKRF.js +68 -0
- package/dist/product-create-variant-TCXDJ425.js +53 -0
- package/dist/{product-detail-ZC37BGPC.js → product-detail-273ME23P.js} +4 -4
- package/dist/{product-list-635ZXM2D.js → product-list-2ZHLFSBI.js} +5 -4
- package/dist/{product-media-ZMDAVPGI.js → product-media-YMFP6Q6A.js} +3 -3
- package/dist/{product-prices-WMRIC7WM.js → product-prices-X6JO3Y5A.js} +5 -5
- package/dist/{product-sales-channels-LSN5DVWZ.js → product-sales-channels-2PVBPK6W.js} +2 -3
- package/dist/{product-stock-HF42WRSC.js → product-stock-ARRFHDSU.js} +6 -6
- package/dist/{product-tag-detail-OJLYO3Q5.js → product-tag-detail-545AVFGA.js} +7 -6
- package/dist/{product-tag-list-XFHGJBRF.js → product-tag-list-2Y2Q7K3A.js} +7 -6
- package/dist/{product-type-detail-J4UA4AEM.js → product-type-detail-PBP572AM.js} +7 -6
- package/dist/{product-type-list-H5EQHCXS.js → product-type-list-XWNUKETZ.js} +6 -5
- package/dist/{product-variant-detail-5WKYURFA.js → product-variant-detail-RJUQWBYH.js} +4 -3
- package/dist/{profile-detail-EYNXOHGZ.js → profile-detail-H22ZBNOB.js} +5 -4
- package/dist/{promotion-add-campaign-B5SF72KC.js → promotion-add-campaign-5LCKEU6H.js} +3 -3
- package/dist/promotion-create-KXBEHXPK.js +54 -0
- package/dist/{promotion-detail-MVFOMS4E.js → promotion-detail-NZZ2HII7.js} +7 -6
- package/dist/{promotion-list-IN4VWEQN.js → promotion-list-KARWNOAQ.js} +9 -8
- package/dist/{refund-reason-list-DJZZC7KK.js → refund-reason-list-GTZQBZ7R.js} +3 -2
- package/dist/{region-detail-OFZHX57G.js → region-detail-3OPMLS4V.js} +5 -4
- package/dist/{region-list-L4FKHVJJ.js → region-list-542EMW5C.js} +6 -5
- package/dist/{reservation-detail-LZYEM5NW.js → reservation-detail-IPGIBQW4.js} +5 -4
- package/dist/{reservation-list-OGPDB7WG.js → reservation-list-CEFKMB2G.js} +6 -5
- package/dist/{reset-password-Q7Y4FWRE.js → reset-password-R5ULRWEM.js} +1 -1
- package/dist/{return-reason-list-6ICMSVKF.js → return-reason-list-S7LU655M.js} +5 -4
- package/dist/{sales-channel-detail-RRJG7U7R.js → sales-channel-detail-QCJ6OC3H.js} +7 -6
- package/dist/{sales-channel-list-LUZ4ZXCY.js → sales-channel-list-KYNBWXUD.js} +7 -7
- package/dist/seller-details-A7TYGP67.js +104 -0
- package/dist/{seller-list-664H4SI5.js → seller-list-5KPNNC2B.js} +7 -6
- package/dist/{shipping-option-type-detail-2RY3NHRO.js → shipping-option-type-detail-OBYOZZWS.js} +5 -4
- package/dist/{shipping-option-type-list-IOSOE33S.js → shipping-option-type-list-UGVMQ3DC.js} +6 -5
- package/dist/{shipping-profile-detail-RIIAX7VE.js → shipping-profile-detail-RYOFRMLH.js} +5 -4
- package/dist/{shipping-profiles-list-AL4EJSJY.js → shipping-profiles-list-XJGQ7AVX.js} +5 -4
- package/dist/{tax-region-create-UOTLTCOP.js → tax-region-create-AR2LNF2G.js} +6 -6
- package/dist/{tax-region-detail-CA2W5W6A.js → tax-region-detail-PIGY5JQ7.js} +7 -6
- package/dist/{tax-region-list-JTZ7KZCX.js → tax-region-list-AMGZWUAI.js} +6 -5
- package/dist/{tax-region-province-detail-ZHLX4FF4.js → tax-region-province-detail-D3R4FJT4.js} +6 -5
- package/dist/types-DUhfb5tH.d.ts +30 -0
- package/dist/{user-detail-YNPBC5MN.js → user-detail-H66ZAR7W.js} +5 -4
- package/dist/{user-list-LNTZNT3D.js → user-list-HIUXLIJV.js} +5 -4
- package/package.json +3 -3
- package/dist/chunk-62ZRA6BZ.js +0 -216
- package/dist/chunk-6PNMR6XP.js +0 -192
- package/dist/chunk-7COSFMM7.js +0 -163
- package/dist/chunk-A2KURGQO.js +0 -151
- package/dist/chunk-BHID7W3U.js +0 -78
- package/dist/chunk-UKLRBS4W.js +0 -61
- package/dist/inventory-create-QLEIHESO.js +0 -620
- package/dist/location-service-zone-shipping-option-create-GYPW6SSN.js +0 -811
- package/dist/promotion-create-D77SANLX.js +0 -1262
- package/dist/{adjust-inventory-HZCWL6SC.js → adjust-inventory-WL7D7TQR.js} +3 -3
- package/dist/{campaign-budget-edit-AIXCDGG3.js → campaign-budget-edit-722ECPRI.js} +3 -3
- package/dist/{category-products-XLCG2JR7.js → category-products-H3VFYGOU.js} +2 -2
- package/dist/{chunk-DEKJJ7NG.js → chunk-OFCUTNGV.js} +3 -3
- package/dist/{chunk-KUWNYCGL.js → chunk-U3OWJE7V.js} +0 -0
- package/dist/{collection-add-products-IQ7M63BA.js → collection-add-products-BQ2FZKR4.js} +1 -1
- package/dist/{commission-rate-create-VC72GTV4.js → commission-rate-create-GFQNADQS.js} +9 -9
- package/dist/{commission-rate-edit-AXJKJNFY.js → commission-rate-edit-A2BFZUEI.js} +9 -9
- package/dist/{location-service-zone-shipping-option-edit-E3GN4ZF5.js → location-service-zone-shipping-option-edit-KPECMUYB.js} +3 -3
- package/dist/{order-create-claim-7WW6MXTT.js → order-create-claim-IWTV2HKL.js} +6 -6
- package/dist/{order-create-edit-KAH6ZPLX.js → order-create-edit-H2MHZFIW.js} +5 -5
- package/dist/{order-create-exchange-ELLWF3IY.js → order-create-exchange-PPMRSGLD.js} +6 -6
- package/dist/{order-create-refund-5QZBOSCA.js → order-create-refund-LZOHRL7T.js} +3 -3
- package/dist/{order-create-return-L6DEDPJK.js → order-create-return-WY6R4QMN.js} +6 -6
- package/dist/{order-edit-shipping-address-BPU7OL2N.js → order-edit-shipping-address-XQCSN4YO.js} +3 -3
- package/dist/{order-receive-return-FW5QZJBM.js → order-receive-return-GKMHYD4G.js} +1 -1
- package/dist/{product-edit-LQJDUUVX.js → product-edit-QGRKGJ3H.js} +1 -1
- package/dist/{product-variant-edit-66ZUIIMP.js → product-variant-edit-IQLBIHDE.js} +1 -1
- package/dist/{product-variant-manage-inventory-items-CV2CC2PV.js → product-variant-manage-inventory-items-C77QHYRT.js} +3 -3
- package/dist/{promotion-edit-details-YKS24GBD.js → promotion-edit-details-BFXPUEE6.js} +4 -4
- package/dist/{region-create-UMJK3VGL.js → region-create-ZPY6V77Q.js} +3 -3
- package/dist/{region-edit-ODVSNJHM.js → region-edit-Q2CBVPR2.js} +3 -3
- package/dist/{sales-channel-add-products-EOWFSO35.js → sales-channel-add-products-PIY4PUIW.js} +2 -2
- package/dist/{tax-region-province-create-RFYCUDER.js → tax-region-province-create-7BMYABJ6.js} +3 -3
- package/dist/{tax-region-tax-override-create-WIWUNXW6.js → tax-region-tax-override-create-EBDKSAXG.js} +6 -6
- package/dist/{tax-region-tax-override-edit-SWROFQTP.js → tax-region-tax-override-edit-55ODL7KC.js} +6 -6
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-ULJ3OMWU.js";
|
|
5
5
|
import {
|
|
6
6
|
SingleColumnPage
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XIZLPYEE.js";
|
|
8
8
|
import {
|
|
9
9
|
ActionMenu
|
|
10
10
|
} from "./chunk-BDGZ4EQO.js";
|
|
@@ -17,11 +17,13 @@ import {
|
|
|
17
17
|
} from "./chunk-U2GCSKW3.js";
|
|
18
18
|
|
|
19
19
|
// src/pages/shipping-profiles/shipping-profiles-list/shipping-profile-list.tsx
|
|
20
|
-
import { Children } from "react";
|
|
20
|
+
import { Children as Children3 } from "react";
|
|
21
21
|
|
|
22
|
-
// src/pages/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
22
|
+
// src/pages/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-view/shipping-profile-list-view.tsx
|
|
23
|
+
import { Children as Children2 } from "react";
|
|
24
|
+
import { Container } from "@medusajs/ui";
|
|
25
|
+
|
|
26
|
+
// src/pages/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-view/shipping-profile-list-data-table.tsx
|
|
25
27
|
import { keepPreviousData } from "@tanstack/react-query";
|
|
26
28
|
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
27
29
|
|
|
@@ -163,10 +165,10 @@ var useShippingProfileTableQuery = ({
|
|
|
163
165
|
};
|
|
164
166
|
};
|
|
165
167
|
|
|
166
|
-
// src/pages/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-
|
|
167
|
-
import { jsx as jsx3
|
|
168
|
+
// src/pages/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-view/shipping-profile-list-data-table.tsx
|
|
169
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
168
170
|
var PAGE_SIZE = 20;
|
|
169
|
-
var
|
|
171
|
+
var ShippingProfileListDataTable = () => {
|
|
170
172
|
const { t } = useTranslation4();
|
|
171
173
|
const { raw, searchParams } = useShippingProfileTableQuery({
|
|
172
174
|
pageSize: PAGE_SIZE
|
|
@@ -187,48 +189,106 @@ var ShippingProfileListTable = () => {
|
|
|
187
189
|
if (isError) {
|
|
188
190
|
throw error;
|
|
189
191
|
}
|
|
190
|
-
return /* @__PURE__ */
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
192
|
+
return /* @__PURE__ */ jsx3(
|
|
193
|
+
_DataTable,
|
|
194
|
+
{
|
|
195
|
+
table,
|
|
196
|
+
pageSize: PAGE_SIZE,
|
|
197
|
+
count,
|
|
198
|
+
columns,
|
|
199
|
+
filters,
|
|
200
|
+
orderBy: [
|
|
201
|
+
{ key: "name", label: t("fields.name") },
|
|
202
|
+
{ key: "type", label: t("fields.type") },
|
|
203
|
+
{ key: "created_at", label: t("fields.createdAt") },
|
|
204
|
+
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
205
|
+
],
|
|
206
|
+
isLoading,
|
|
207
|
+
navigateTo: (row) => row.id,
|
|
208
|
+
queryObject: raw,
|
|
209
|
+
search: true,
|
|
210
|
+
pagination: true,
|
|
211
|
+
"data-testid": "shipping-profile-list-table"
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
// src/pages/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-view/shipping-profile-list-header.tsx
|
|
217
|
+
import { Children } from "react";
|
|
218
|
+
import { Button, Heading, Text } from "@medusajs/ui";
|
|
219
|
+
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
220
|
+
import { Link } from "react-router-dom";
|
|
221
|
+
import { Fragment, jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
222
|
+
var ShippingProfileListTitle = () => {
|
|
223
|
+
const { t } = useTranslation5();
|
|
224
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
225
|
+
/* @__PURE__ */ jsx4(Heading, { "data-testid": "shipping-profile-list-table-heading", children: t("shippingProfile.domain") }),
|
|
226
|
+
/* @__PURE__ */ jsx4(
|
|
227
|
+
Text,
|
|
200
228
|
{
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
filters,
|
|
206
|
-
orderBy: [
|
|
207
|
-
{ key: "name", label: t("fields.name") },
|
|
208
|
-
{ key: "type", label: t("fields.type") },
|
|
209
|
-
{ key: "created_at", label: t("fields.createdAt") },
|
|
210
|
-
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
211
|
-
],
|
|
212
|
-
isLoading,
|
|
213
|
-
navigateTo: (row) => row.id,
|
|
214
|
-
queryObject: raw,
|
|
215
|
-
search: true,
|
|
216
|
-
pagination: true,
|
|
217
|
-
"data-testid": "shipping-profile-list-table"
|
|
229
|
+
className: "text-ui-fg-subtle",
|
|
230
|
+
size: "small",
|
|
231
|
+
"data-testid": "shipping-profile-list-table-subtitle",
|
|
232
|
+
children: t("shippingProfile.subtitle")
|
|
218
233
|
}
|
|
219
234
|
)
|
|
220
235
|
] });
|
|
221
236
|
};
|
|
237
|
+
var ShippingProfileListActions = ({
|
|
238
|
+
children
|
|
239
|
+
}) => {
|
|
240
|
+
const { t } = useTranslation5();
|
|
241
|
+
return /* @__PURE__ */ jsx4("div", { className: "flex items-center justify-center gap-x-2", children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsx4(
|
|
242
|
+
Button,
|
|
243
|
+
{
|
|
244
|
+
size: "small",
|
|
245
|
+
variant: "secondary",
|
|
246
|
+
asChild: true,
|
|
247
|
+
"data-testid": "shipping-profile-list-table-create-button",
|
|
248
|
+
children: /* @__PURE__ */ jsx4(Link, { to: "create", children: t("actions.create") })
|
|
249
|
+
}
|
|
250
|
+
) });
|
|
251
|
+
};
|
|
252
|
+
var ShippingProfileListHeader = ({
|
|
253
|
+
children
|
|
254
|
+
}) => {
|
|
255
|
+
return /* @__PURE__ */ jsx4(
|
|
256
|
+
"div",
|
|
257
|
+
{
|
|
258
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
259
|
+
"data-testid": "shipping-profile-list-table-header",
|
|
260
|
+
children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
261
|
+
/* @__PURE__ */ jsx4(ShippingProfileListTitle, {}),
|
|
262
|
+
/* @__PURE__ */ jsx4(ShippingProfileListActions, {})
|
|
263
|
+
] })
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
// src/pages/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-view/shipping-profile-list-view.tsx
|
|
269
|
+
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
270
|
+
var ShippingProfileListView = ({
|
|
271
|
+
children
|
|
272
|
+
}) => {
|
|
273
|
+
return /* @__PURE__ */ jsx5(Container, { className: "divide-y p-0", children: Children2.count(children) > 0 ? children : /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
274
|
+
/* @__PURE__ */ jsx5(ShippingProfileListHeader, {}),
|
|
275
|
+
/* @__PURE__ */ jsx5(ShippingProfileListDataTable, {})
|
|
276
|
+
] }) });
|
|
277
|
+
};
|
|
222
278
|
|
|
223
279
|
// src/pages/shipping-profiles/shipping-profiles-list/shipping-profile-list.tsx
|
|
224
|
-
import { jsx as
|
|
280
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
225
281
|
var Root = ({ children }) => {
|
|
226
|
-
return /* @__PURE__ */
|
|
282
|
+
return /* @__PURE__ */ jsx6(SingleColumnPage, { children: Children3.count(children) > 0 ? children : /* @__PURE__ */ jsx6(ShippingProfileListView, {}) });
|
|
227
283
|
};
|
|
228
|
-
var
|
|
229
|
-
Table:
|
|
284
|
+
var ShippingProfileListPage = Object.assign(Root, {
|
|
285
|
+
Table: ShippingProfileListView,
|
|
286
|
+
Header: ShippingProfileListHeader,
|
|
287
|
+
HeaderTitle: ShippingProfileListTitle,
|
|
288
|
+
HeaderActions: ShippingProfileListActions,
|
|
289
|
+
DataTable: ShippingProfileListDataTable
|
|
230
290
|
});
|
|
231
291
|
|
|
232
292
|
export {
|
|
233
|
-
|
|
293
|
+
ShippingProfileListPage
|
|
234
294
|
};
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import {
|
|
2
|
+
_DataTable,
|
|
3
|
+
useDataTable
|
|
4
|
+
} from "./chunk-ULJ3OMWU.js";
|
|
5
|
+
import {
|
|
6
|
+
SingleColumnPage
|
|
7
|
+
} from "./chunk-XIZLPYEE.js";
|
|
8
|
+
import {
|
|
9
|
+
ActionMenu
|
|
10
|
+
} from "./chunk-BDGZ4EQO.js";
|
|
11
|
+
import {
|
|
12
|
+
useCustomerGroupTableFilters
|
|
13
|
+
} from "./chunk-CMHI2RPL.js";
|
|
14
|
+
import {
|
|
15
|
+
useCustomerGroupTableQuery
|
|
16
|
+
} from "./chunk-VKOE5J66.js";
|
|
17
|
+
import {
|
|
18
|
+
useDate
|
|
19
|
+
} from "./chunk-UZWFZMOX.js";
|
|
20
|
+
import {
|
|
21
|
+
useCustomerGroups,
|
|
22
|
+
useDeleteCustomerGroupLazy
|
|
23
|
+
} from "./chunk-A5XOYSDC.js";
|
|
24
|
+
|
|
25
|
+
// src/pages/customer-groups/customer-group-list/customer-group-list.tsx
|
|
26
|
+
import { Children as Children2 } from "react";
|
|
27
|
+
|
|
28
|
+
// src/pages/customer-groups/customer-group-list/components/customer-group-list-table/customer-group-list-table.tsx
|
|
29
|
+
import { PencilSquare, Trash } from "@medusajs/icons";
|
|
30
|
+
import {
|
|
31
|
+
Button,
|
|
32
|
+
Container,
|
|
33
|
+
Heading,
|
|
34
|
+
toast,
|
|
35
|
+
usePrompt
|
|
36
|
+
} from "@medusajs/ui";
|
|
37
|
+
import { keepPreviousData } from "@tanstack/react-query";
|
|
38
|
+
import { createColumnHelper } from "@tanstack/react-table";
|
|
39
|
+
import { Children, useCallback, useMemo } from "react";
|
|
40
|
+
import { useTranslation } from "react-i18next";
|
|
41
|
+
import { Link } from "react-router-dom";
|
|
42
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
43
|
+
var PAGE_SIZE = 10;
|
|
44
|
+
var CustomerGroupListTitle = () => {
|
|
45
|
+
const { t } = useTranslation();
|
|
46
|
+
return /* @__PURE__ */ jsx(Heading, { "data-testid": "customer-group-list-heading", children: t("customerGroups.domain") });
|
|
47
|
+
};
|
|
48
|
+
var CustomerGroupListCreateButton = () => {
|
|
49
|
+
const { t } = useTranslation();
|
|
50
|
+
return /* @__PURE__ */ jsx(Link, { to: "/customer-groups/create", children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.create") }) });
|
|
51
|
+
};
|
|
52
|
+
var CustomerGroupListActions = ({ children }) => {
|
|
53
|
+
return /* @__PURE__ */ jsx("div", { className: "flex items-center gap-x-2", children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsx(CustomerGroupListCreateButton, {}) });
|
|
54
|
+
};
|
|
55
|
+
var CustomerGroupListHeader = ({ children }) => {
|
|
56
|
+
return /* @__PURE__ */ jsx(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
60
|
+
"data-testid": "customer-group-list-header",
|
|
61
|
+
children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
|
+
/* @__PURE__ */ jsx(CustomerGroupListTitle, {}),
|
|
63
|
+
/* @__PURE__ */ jsx(CustomerGroupListActions, {})
|
|
64
|
+
] })
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
var CustomerGroupListDataTable = () => {
|
|
69
|
+
const { t } = useTranslation();
|
|
70
|
+
const { searchParams, raw } = useCustomerGroupTableQuery({ pageSize: PAGE_SIZE });
|
|
71
|
+
const { customer_groups, count, isPending, isError, error } = useCustomerGroups(
|
|
72
|
+
{
|
|
73
|
+
...searchParams,
|
|
74
|
+
fields: "id,name,created_at,updated_at,customers.id"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
placeholderData: keepPreviousData
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
const filters = useCustomerGroupTableFilters();
|
|
81
|
+
const columns = useColumns();
|
|
82
|
+
const { table } = useDataTable({
|
|
83
|
+
data: customer_groups ?? [],
|
|
84
|
+
columns,
|
|
85
|
+
count,
|
|
86
|
+
enablePagination: true,
|
|
87
|
+
getRowId: (row) => row.id,
|
|
88
|
+
pageSize: PAGE_SIZE
|
|
89
|
+
});
|
|
90
|
+
if (isError) {
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
return /* @__PURE__ */ jsx(
|
|
94
|
+
_DataTable,
|
|
95
|
+
{
|
|
96
|
+
table,
|
|
97
|
+
columns,
|
|
98
|
+
pageSize: PAGE_SIZE,
|
|
99
|
+
count,
|
|
100
|
+
isLoading: isPending,
|
|
101
|
+
navigateTo: (row) => `/customer-groups/${row.original.id}`,
|
|
102
|
+
search: true,
|
|
103
|
+
filters,
|
|
104
|
+
queryObject: raw,
|
|
105
|
+
orderBy: [
|
|
106
|
+
{ key: "name", label: t("fields.name") },
|
|
107
|
+
{ key: "created_at", label: t("fields.createdAt") },
|
|
108
|
+
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
109
|
+
],
|
|
110
|
+
noRecords: {
|
|
111
|
+
message: t("customerGroups.list.empty.heading")
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
var CustomerGroupListTable = ({ children }) => {
|
|
117
|
+
return /* @__PURE__ */ jsx(
|
|
118
|
+
Container,
|
|
119
|
+
{
|
|
120
|
+
className: "divide-y p-0",
|
|
121
|
+
"data-testid": "customer-group-list-container",
|
|
122
|
+
children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
123
|
+
/* @__PURE__ */ jsx(CustomerGroupListHeader, {}),
|
|
124
|
+
/* @__PURE__ */ jsx(CustomerGroupListDataTable, {})
|
|
125
|
+
] })
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
var CustomerGroupActions = ({
|
|
130
|
+
group
|
|
131
|
+
}) => {
|
|
132
|
+
const { t } = useTranslation();
|
|
133
|
+
const prompt = usePrompt();
|
|
134
|
+
const { mutateAsync: deleteCustomerGroup } = useDeleteCustomerGroupLazy();
|
|
135
|
+
const handleDelete = useCallback(async () => {
|
|
136
|
+
const res = await prompt({
|
|
137
|
+
title: t("customerGroups.delete.title"),
|
|
138
|
+
description: t("customerGroups.delete.description", {
|
|
139
|
+
name: group.name
|
|
140
|
+
}),
|
|
141
|
+
verificationText: group.name ?? void 0,
|
|
142
|
+
verificationInstruction: t("general.typeToConfirm"),
|
|
143
|
+
confirmText: t("actions.delete"),
|
|
144
|
+
cancelText: t("actions.cancel")
|
|
145
|
+
});
|
|
146
|
+
if (!res) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
await deleteCustomerGroup(
|
|
150
|
+
{ id: group.id },
|
|
151
|
+
{
|
|
152
|
+
onSuccess: () => {
|
|
153
|
+
toast.success(
|
|
154
|
+
t("customerGroups.delete.successToast", { name: group.name })
|
|
155
|
+
);
|
|
156
|
+
},
|
|
157
|
+
onError: (e) => {
|
|
158
|
+
toast.error(e.message);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}, [t, prompt, deleteCustomerGroup, group]);
|
|
163
|
+
return /* @__PURE__ */ jsx(
|
|
164
|
+
ActionMenu,
|
|
165
|
+
{
|
|
166
|
+
groups: [
|
|
167
|
+
{
|
|
168
|
+
actions: [
|
|
169
|
+
{
|
|
170
|
+
icon: /* @__PURE__ */ jsx(PencilSquare, {}),
|
|
171
|
+
label: t("actions.edit"),
|
|
172
|
+
to: `/customer-groups/${group.id}/edit`
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
actions: [
|
|
178
|
+
{
|
|
179
|
+
icon: /* @__PURE__ */ jsx(Trash, {}),
|
|
180
|
+
label: t("actions.delete"),
|
|
181
|
+
onClick: handleDelete
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
};
|
|
189
|
+
var columnHelper = createColumnHelper();
|
|
190
|
+
var useColumns = () => {
|
|
191
|
+
const { t } = useTranslation();
|
|
192
|
+
const { getFullDate } = useDate();
|
|
193
|
+
return useMemo(
|
|
194
|
+
() => [
|
|
195
|
+
columnHelper.accessor("name", {
|
|
196
|
+
header: t("fields.name")
|
|
197
|
+
}),
|
|
198
|
+
columnHelper.display({
|
|
199
|
+
id: "customers",
|
|
200
|
+
header: t("customers.domain"),
|
|
201
|
+
cell: ({ row }) => {
|
|
202
|
+
return /* @__PURE__ */ jsx("span", { children: row.original.customers?.length ?? 0 });
|
|
203
|
+
}
|
|
204
|
+
}),
|
|
205
|
+
columnHelper.accessor("created_at", {
|
|
206
|
+
header: t("fields.createdAt"),
|
|
207
|
+
cell: ({ row }) => {
|
|
208
|
+
return /* @__PURE__ */ jsx("span", { children: getFullDate({
|
|
209
|
+
date: row.original.created_at,
|
|
210
|
+
includeTime: true
|
|
211
|
+
}) });
|
|
212
|
+
}
|
|
213
|
+
}),
|
|
214
|
+
columnHelper.accessor("updated_at", {
|
|
215
|
+
header: t("fields.updatedAt"),
|
|
216
|
+
cell: ({ row }) => {
|
|
217
|
+
return /* @__PURE__ */ jsx("span", { children: getFullDate({
|
|
218
|
+
date: row.original.updated_at,
|
|
219
|
+
includeTime: true
|
|
220
|
+
}) });
|
|
221
|
+
}
|
|
222
|
+
}),
|
|
223
|
+
columnHelper.display({
|
|
224
|
+
id: "actions",
|
|
225
|
+
cell: ({ row }) => /* @__PURE__ */ jsx(CustomerGroupActions, { group: row.original })
|
|
226
|
+
})
|
|
227
|
+
],
|
|
228
|
+
[t, getFullDate]
|
|
229
|
+
);
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
// src/pages/customer-groups/customer-group-list/customer-group-list.tsx
|
|
233
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
234
|
+
var Root = ({ children }) => {
|
|
235
|
+
return /* @__PURE__ */ jsx2(SingleColumnPage, { children: Children2.count(children) > 0 ? children : /* @__PURE__ */ jsx2(CustomerGroupListTable, {}) });
|
|
236
|
+
};
|
|
237
|
+
var CustomerGroupListPage = Object.assign(Root, {
|
|
238
|
+
Table: CustomerGroupListTable,
|
|
239
|
+
Header: CustomerGroupListHeader,
|
|
240
|
+
HeaderTitle: CustomerGroupListTitle,
|
|
241
|
+
HeaderActions: CustomerGroupListActions,
|
|
242
|
+
HeaderCreateButton: CustomerGroupListCreateButton,
|
|
243
|
+
DataTable: CustomerGroupListDataTable
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
export {
|
|
247
|
+
CustomerGroupListPage
|
|
248
|
+
};
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useDeleteProductTypeAction
|
|
3
|
+
} from "./chunk-GEAI7SDF.js";
|
|
4
|
+
import {
|
|
5
|
+
useProductTypeTableColumns
|
|
6
|
+
} from "./chunk-O5VKW5FL.js";
|
|
7
|
+
import {
|
|
8
|
+
_DataTable,
|
|
9
|
+
useDataTable
|
|
10
|
+
} from "./chunk-ULJ3OMWU.js";
|
|
11
|
+
import {
|
|
12
|
+
SingleColumnPage
|
|
13
|
+
} from "./chunk-XIZLPYEE.js";
|
|
14
|
+
import {
|
|
15
|
+
ActionMenu
|
|
16
|
+
} from "./chunk-BDGZ4EQO.js";
|
|
17
|
+
import {
|
|
18
|
+
useProductTypeTableFilters
|
|
19
|
+
} from "./chunk-2ZFELO2L.js";
|
|
20
|
+
import {
|
|
21
|
+
useProductTypeTableQuery
|
|
22
|
+
} from "./chunk-VOHEQ7B5.js";
|
|
23
|
+
import {
|
|
24
|
+
useProductTypes
|
|
25
|
+
} from "./chunk-E7ZBQO6E.js";
|
|
26
|
+
|
|
27
|
+
// src/pages/product-types/product-type-list/product-type-list.tsx
|
|
28
|
+
import { Children as Children3 } from "react";
|
|
29
|
+
|
|
30
|
+
// src/pages/product-types/product-type-list/components/product-type-list-view/product-type-list-view.tsx
|
|
31
|
+
import { Children as Children2 } from "react";
|
|
32
|
+
import { Container } from "@medusajs/ui";
|
|
33
|
+
|
|
34
|
+
// src/pages/product-types/product-type-list/components/product-type-list-view/product-type-list-data-table.tsx
|
|
35
|
+
import { keepPreviousData } from "@tanstack/react-query";
|
|
36
|
+
import { createColumnHelper } from "@tanstack/react-table";
|
|
37
|
+
import { useMemo } from "react";
|
|
38
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
39
|
+
|
|
40
|
+
// src/pages/product-types/product-type-list/components/product-type-list-table/product-table-row-actions.tsx
|
|
41
|
+
import { PencilSquare, Trash } from "@medusajs/icons";
|
|
42
|
+
import { useTranslation } from "react-i18next";
|
|
43
|
+
import { jsx } from "react/jsx-runtime";
|
|
44
|
+
var ProductTypeRowActions = ({
|
|
45
|
+
productType
|
|
46
|
+
}) => {
|
|
47
|
+
const { t } = useTranslation();
|
|
48
|
+
const handleDelete = useDeleteProductTypeAction(
|
|
49
|
+
productType.id,
|
|
50
|
+
productType.value
|
|
51
|
+
);
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
ActionMenu,
|
|
54
|
+
{
|
|
55
|
+
groups: [
|
|
56
|
+
{
|
|
57
|
+
actions: [
|
|
58
|
+
{
|
|
59
|
+
label: t("actions.edit"),
|
|
60
|
+
icon: /* @__PURE__ */ jsx(PencilSquare, {}),
|
|
61
|
+
to: `/settings/product-types/${productType.id}/edit`
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
actions: [
|
|
67
|
+
{
|
|
68
|
+
label: t("actions.delete"),
|
|
69
|
+
icon: /* @__PURE__ */ jsx(Trash, {}),
|
|
70
|
+
onClick: handleDelete
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"data-testid": `product-type-list-table-action-menu-${productType.id}`
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// src/pages/product-types/product-type-list/components/product-type-list-view/product-type-list-data-table.tsx
|
|
81
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
82
|
+
var PAGE_SIZE = 20;
|
|
83
|
+
var ProductTypeListDataTable = () => {
|
|
84
|
+
const { t } = useTranslation2();
|
|
85
|
+
const { searchParams, raw } = useProductTypeTableQuery({
|
|
86
|
+
pageSize: PAGE_SIZE
|
|
87
|
+
});
|
|
88
|
+
const { product_types, count, isLoading, isError, error } = useProductTypes(
|
|
89
|
+
searchParams,
|
|
90
|
+
{
|
|
91
|
+
placeholderData: keepPreviousData
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
const filters = useProductTypeTableFilters();
|
|
95
|
+
const columns = useColumns();
|
|
96
|
+
const { table } = useDataTable({
|
|
97
|
+
columns,
|
|
98
|
+
data: product_types,
|
|
99
|
+
count,
|
|
100
|
+
getRowId: (row) => row.id,
|
|
101
|
+
pageSize: PAGE_SIZE
|
|
102
|
+
});
|
|
103
|
+
if (isError) {
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
return /* @__PURE__ */ jsx2(
|
|
107
|
+
_DataTable,
|
|
108
|
+
{
|
|
109
|
+
table,
|
|
110
|
+
filters,
|
|
111
|
+
isLoading,
|
|
112
|
+
columns,
|
|
113
|
+
pageSize: PAGE_SIZE,
|
|
114
|
+
count,
|
|
115
|
+
orderBy: [
|
|
116
|
+
{ key: "value", label: t("fields.value") },
|
|
117
|
+
{ key: "created_at", label: t("fields.createdAt") },
|
|
118
|
+
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
119
|
+
],
|
|
120
|
+
navigateTo: ({ original }) => original.id,
|
|
121
|
+
queryObject: raw,
|
|
122
|
+
pagination: true,
|
|
123
|
+
search: true,
|
|
124
|
+
"data-testid": "product-type-list-table"
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
var columnHelper = createColumnHelper();
|
|
129
|
+
var useColumns = () => {
|
|
130
|
+
const base = useProductTypeTableColumns();
|
|
131
|
+
return useMemo(
|
|
132
|
+
() => [
|
|
133
|
+
...base,
|
|
134
|
+
columnHelper.display({
|
|
135
|
+
id: "actions",
|
|
136
|
+
cell: ({ row }) => {
|
|
137
|
+
return /* @__PURE__ */ jsx2(ProductTypeRowActions, { productType: row.original });
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
],
|
|
141
|
+
[base]
|
|
142
|
+
);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// src/pages/product-types/product-type-list/components/product-type-list-view/product-type-list-header.tsx
|
|
146
|
+
import { Children } from "react";
|
|
147
|
+
import { Button, Heading, Text } from "@medusajs/ui";
|
|
148
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
149
|
+
import { Link } from "react-router-dom";
|
|
150
|
+
import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
151
|
+
var ProductTypeListTitle = () => {
|
|
152
|
+
const { t } = useTranslation3();
|
|
153
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
154
|
+
/* @__PURE__ */ jsx3(Heading, { "data-testid": "product-type-list-table-heading", children: t("productTypes.domain") }),
|
|
155
|
+
/* @__PURE__ */ jsx3(
|
|
156
|
+
Text,
|
|
157
|
+
{
|
|
158
|
+
className: "text-ui-fg-subtle",
|
|
159
|
+
size: "small",
|
|
160
|
+
"data-testid": "product-type-list-table-subtitle",
|
|
161
|
+
children: t("productTypes.subtitle")
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
] });
|
|
165
|
+
};
|
|
166
|
+
var ProductTypeListActions = ({
|
|
167
|
+
children
|
|
168
|
+
}) => {
|
|
169
|
+
const { t } = useTranslation3();
|
|
170
|
+
return /* @__PURE__ */ jsx3("div", { className: "flex items-center justify-center gap-x-2", children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsx3(
|
|
171
|
+
Button,
|
|
172
|
+
{
|
|
173
|
+
size: "small",
|
|
174
|
+
variant: "secondary",
|
|
175
|
+
asChild: true,
|
|
176
|
+
"data-testid": "product-type-list-table-create-button",
|
|
177
|
+
children: /* @__PURE__ */ jsx3(Link, { to: "create", children: t("actions.create") })
|
|
178
|
+
}
|
|
179
|
+
) });
|
|
180
|
+
};
|
|
181
|
+
var ProductTypeListHeader = ({
|
|
182
|
+
children
|
|
183
|
+
}) => {
|
|
184
|
+
return /* @__PURE__ */ jsx3(
|
|
185
|
+
"div",
|
|
186
|
+
{
|
|
187
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
188
|
+
"data-testid": "product-type-list-table-header",
|
|
189
|
+
children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
190
|
+
/* @__PURE__ */ jsx3(ProductTypeListTitle, {}),
|
|
191
|
+
/* @__PURE__ */ jsx3(ProductTypeListActions, {})
|
|
192
|
+
] })
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// src/pages/product-types/product-type-list/components/product-type-list-view/product-type-list-view.tsx
|
|
198
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
199
|
+
var ProductTypeListView = ({
|
|
200
|
+
children
|
|
201
|
+
}) => {
|
|
202
|
+
return /* @__PURE__ */ jsx4(Container, { className: "divide-y p-0", children: Children2.count(children) > 0 ? children : /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
203
|
+
/* @__PURE__ */ jsx4(ProductTypeListHeader, {}),
|
|
204
|
+
/* @__PURE__ */ jsx4(ProductTypeListDataTable, {})
|
|
205
|
+
] }) });
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
// src/pages/product-types/product-type-list/product-type-list.tsx
|
|
209
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
210
|
+
var Root = ({ children }) => {
|
|
211
|
+
return /* @__PURE__ */ jsx5(SingleColumnPage, { children: Children3.count(children) > 0 ? children : /* @__PURE__ */ jsx5(ProductTypeListView, {}) });
|
|
212
|
+
};
|
|
213
|
+
var ProductTypeListPage = Object.assign(Root, {
|
|
214
|
+
Table: ProductTypeListView,
|
|
215
|
+
Header: ProductTypeListHeader,
|
|
216
|
+
HeaderTitle: ProductTypeListTitle,
|
|
217
|
+
HeaderActions: ProductTypeListActions,
|
|
218
|
+
DataTable: ProductTypeListDataTable
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
export {
|
|
222
|
+
ProductTypeListPage
|
|
223
|
+
};
|