@mercurjs/admin 2.0.0 → 2.0.1
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-CQDZBX3V.js → add-campaign-promotions-TA7QC32P.js} +6 -6
- package/dist/{adjust-inventory-3GPDYI3V.js → adjust-inventory-W4H5F2JA.js} +32 -31
- package/dist/{api-key-management-create-GUNLFGNT.js → api-key-management-create-FPBZMDBI.js} +5 -5
- package/dist/{api-key-management-detail-4IL3BQJW.js → api-key-management-detail-LMKKDTRJ.js} +33 -32
- package/dist/{api-key-management-edit-SIXXFLNP.js → api-key-management-edit-5EM4NJIM.js} +5 -5
- package/dist/{api-key-management-list-XLRD4ASE.js → api-key-management-list-MRKJVQMI.js} +5 -5
- package/dist/{api-key-management-sales-channels-GCUMV6YA.js → api-key-management-sales-channels-AETOWQYM.js} +5 -5
- package/dist/attribute-create-IRJTPQCF.js +996 -0
- package/dist/attribute-create-possible-value-RG4VA2DG.js +437 -0
- package/dist/attribute-detail-7FLCTP3I.js +457 -0
- package/dist/attribute-edit-6YNHG3QV.js +281 -0
- package/dist/attribute-edit-possible-value-IBJA53MJ.js +264 -0
- package/dist/attribute-edit-ranking-BLMESGR5.js +174 -0
- package/dist/attribute-list-C5NS26AD.js +63 -0
- package/dist/{campaign-budget-edit-GAP5KUI3.js → campaign-budget-edit-PL7DTWCM.js} +3 -3
- package/dist/{campaign-configuration-LTHPZGYC.js → campaign-configuration-D6ROERRH.js} +3 -3
- package/dist/{campaign-create-TRNE6L26.js → campaign-create-LABYKFMI.js} +7 -7
- package/dist/{campaign-detail-GYMMDRUV.js → campaign-detail-E37P67AC.js} +35 -34
- package/dist/{campaign-edit-CRQCVEFT.js → campaign-edit-PMJMUUDW.js} +3 -3
- package/dist/{campaign-list-WEKSY62X.js → campaign-list-B42U6XNF.js} +3 -3
- package/dist/{categories-metadata-GESU3DEU.js → categories-metadata-34L5C2TK.js} +33 -32
- package/dist/{category-create-PSAN6SA2.js → category-create-AMHFSXJI.js} +6 -6
- package/dist/{category-detail-67ZTYE5M.js → category-detail-B23F726Q.js} +35 -35
- package/dist/{category-edit-QYKE3GAC.js → category-edit-VZL6ROLF.js} +4 -4
- package/dist/{category-list-ZRDWHPEI.js → category-list-R66T472I.js} +5 -5
- package/dist/{category-organize-D26G234L.js → category-organize-CLCNXQSJ.js} +4 -4
- package/dist/{category-products-XMIZ2KRR.js → category-products-2LKOHEWO.js} +34 -34
- package/dist/{chunk-I5LLMPI2.js → chunk-22XJUSMM.js} +2 -2
- package/dist/{chunk-7OSCNHHQ.js → chunk-25YTS3TI.js} +2 -2
- package/dist/{chunk-P52JGPUG.js → chunk-34VX7KOL.js} +4 -4
- package/dist/{chunk-X6HEEFUW.js → chunk-3FNX54TD.js} +1 -1
- package/dist/{chunk-YAMNPEPW.js → chunk-3MDRW5MA.js} +28 -9
- package/dist/{chunk-5N24A4CX.js → chunk-4ESVWDQK.js} +2 -2
- package/dist/{chunk-HDUVTTOW.js → chunk-4G5FEKRO.js} +1 -1
- package/dist/{chunk-RF7BE47J.js → chunk-4QX7QEWY.js} +9 -9
- package/dist/chunk-4ZTZTIIM.js +69 -0
- package/dist/{chunk-XFKRBJLK.js → chunk-52BRBQMY.js} +2 -2
- package/dist/{chunk-LZO7MWH7.js → chunk-5N6S5K57.js} +2 -2
- package/dist/{chunk-EWFOFSF7.js → chunk-5PUHROK4.js} +1 -1
- package/dist/{chunk-QUNCQMFH.js → chunk-5VBNFLG2.js} +1 -1
- package/dist/{chunk-7ITJ4725.js → chunk-5VMJCLUP.js} +4 -4
- package/dist/{chunk-G4MIA23Y.js → chunk-5WTGRSBC.js} +1 -1
- package/dist/{chunk-64B6RWZI.js → chunk-5XWE6QZ3.js} +3 -3
- package/dist/{chunk-TKSKCH3S.js → chunk-6D5BKKSQ.js} +1 -1
- package/dist/{chunk-OT5X3VOQ.js → chunk-6NVEUQSL.js} +1 -1
- package/dist/{chunk-7JZMCLD3.js → chunk-6OTK5LAS.js} +5 -5
- package/dist/{chunk-ZGEMSYN7.js → chunk-6TFS6ET5.js} +1 -1
- package/dist/{chunk-G2N27VIE.js → chunk-76FXHSMH.js} +2 -2
- package/dist/{chunk-DPH3FG5H.js → chunk-7IPA3CRG.js} +4 -4
- package/dist/{chunk-GYRTURN7.js → chunk-7SJC6BWZ.js} +1 -1
- package/dist/{chunk-BYKTBURG.js → chunk-7STT4ZVP.js} +1 -1
- package/dist/{chunk-6ERRELWD.js → chunk-A2TQNJZP.js} +11 -11
- package/dist/{chunk-QDIPFZLV.js → chunk-AG4ORND4.js} +2 -2
- package/dist/{chunk-BBZ6YISG.js → chunk-AVXOG7CE.js} +4 -4
- package/dist/{chunk-WBNGBRBK.js → chunk-BA2HXHTW.js} +1 -1
- package/dist/{chunk-AJQ6EVLE.js → chunk-BBANQAF4.js} +2 -2
- package/dist/{chunk-YMKZS2HK.js → chunk-BE5QWX5N.js} +25 -6
- package/dist/{chunk-PJTR2MBS.js → chunk-BMC2HG53.js} +2 -2
- package/dist/{chunk-7H2I3TA2.js → chunk-BUI5NC7I.js} +2 -2
- package/dist/chunk-C3WE6EFO.js +33 -0
- package/dist/{chunk-ZJO4DDOP.js → chunk-CA4XLTI7.js} +2 -2
- package/dist/{chunk-J54BZXZX.js → chunk-CBHNHLUZ.js} +2 -2
- package/dist/{chunk-KWW4RDRS.js → chunk-CGVHXNWH.js} +2 -2
- package/dist/{chunk-7SQW55FI.js → chunk-CMX37MSO.js} +6 -6
- package/dist/{chunk-CARSKIPW.js → chunk-DF3OGJAK.js} +1 -1
- package/dist/{chunk-4ZIQGDNH.js → chunk-DKA6GR53.js} +1 -1
- package/dist/{chunk-6HJINLUB.js → chunk-DOZ3NXES.js} +1 -1
- package/dist/{chunk-I6GNV6QA.js → chunk-DTUPDNN3.js} +3 -3
- package/dist/{chunk-R55Q5LAH.js → chunk-DYFB2ZZD.js} +1 -1
- package/dist/{chunk-TK3XKN2P.js → chunk-EG2Y5Z2K.js} +3 -3
- package/dist/{chunk-25DQRKFS.js → chunk-EHQESDH2.js} +1 -1
- package/dist/{chunk-PWMB7ITO.js → chunk-EI6JBJYB.js} +3 -3
- package/dist/{chunk-4JYZU65L.js → chunk-EVGVH6CU.js} +13 -11
- package/dist/{chunk-IUB4C2WJ.js → chunk-F7VTQIU7.js} +7 -7
- package/dist/{chunk-VRGXUUPH.js → chunk-FB4JUZFB.js} +4 -4
- package/dist/{chunk-L74EVHCU.js → chunk-FMGXDDBU.js} +2 -2
- package/dist/{chunk-MO7TNIVQ.js → chunk-FNBKEF54.js} +1 -1
- package/dist/{chunk-OSI3M4M2.js → chunk-G4LGZF5F.js} +5 -5
- package/dist/{chunk-MZCJZRR6.js → chunk-G5WS77NL.js} +4 -4
- package/dist/{chunk-BLHFWBK3.js → chunk-GYKVLGU4.js} +2 -2
- package/dist/{chunk-GCEOEV6P.js → chunk-HAFZQK53.js} +1 -1
- package/dist/{chunk-JJ4XUGHZ.js → chunk-HAZURA7S.js} +2 -2
- package/dist/{chunk-GVXAFQDF.js → chunk-HHEQZTPC.js} +2 -2
- package/dist/{chunk-U5QDMLTR.js → chunk-HS322YUO.js} +3 -3
- package/dist/{chunk-XBFWFGZH.js → chunk-HVLPRHZS.js} +2 -2
- package/dist/{chunk-LGVVX4I6.js → chunk-IAT6UDKU.js} +1 -1
- package/dist/{chunk-PYF5EER5.js → chunk-IJWG755C.js} +1 -1
- package/dist/chunk-J24SOKSP.js +457 -0
- package/dist/{chunk-HGHJRKUC.js → chunk-J555HFHV.js} +2 -2
- package/dist/{chunk-O4LSCHTC.js → chunk-JSBQOQXC.js} +1 -1
- package/dist/{chunk-EEOEIXDA.js → chunk-K4BGK3CO.js} +3 -3
- package/dist/{chunk-XSEF6KRY.js → chunk-KA3VYXNA.js} +1 -1
- package/dist/{chunk-EF47ASFU.js → chunk-KERA6OZN.js} +1 -1
- package/dist/{chunk-7KMDLRLG.js → chunk-KMK4YAS2.js} +1 -1
- package/dist/{chunk-EJY35WBK.js → chunk-LC6TM5OT.js} +2 -2
- package/dist/chunk-LO7XX5M7.js +6 -0
- package/dist/{chunk-O5ZOACVV.js → chunk-LW57KBYK.js} +2 -2
- package/dist/chunk-M3YP3NX4.js +259 -0
- package/dist/{chunk-AZVAL5E5.js → chunk-M4VLYKT5.js} +2 -2
- package/dist/{chunk-VEW7PQ3X.js → chunk-MCEEC3VH.js} +3 -3
- package/dist/{chunk-R325CPYC.js → chunk-MFL2TZ3W.js} +1 -1
- package/dist/{chunk-WW7VLWKJ.js → chunk-MMTCBVUV.js} +4 -4
- package/dist/{chunk-RHYS2TFP.js → chunk-MRFW7VTW.js} +2 -2
- package/dist/{chunk-QUTZUW55.js → chunk-N4JU7GWK.js} +2 -2
- package/dist/{chunk-MMDRMNPE.js → chunk-N7QGYSFB.js} +4 -4
- package/dist/{chunk-S3L6CIN2.js → chunk-NDPTTHBH.js} +2 -2
- package/dist/{chunk-NQ2RDSI3.js → chunk-NJKJAYV2.js} +2 -2
- package/dist/{chunk-TKEAOWBZ.js → chunk-NNI6QKKZ.js} +29 -3
- package/dist/chunk-NRKVFULI.js +886 -0
- package/dist/{chunk-J5SOBS7K.js → chunk-NYWECWZJ.js} +5 -5
- package/dist/{chunk-Q6GUA5VE.js → chunk-O4STPJR2.js} +2 -2
- package/dist/{chunk-YDAJI7WF.js → chunk-O7UECTZO.js} +1 -1
- package/dist/{chunk-VXW3BCN2.js → chunk-OFKUNYQJ.js} +1 -1
- package/dist/{chunk-V6LO4BXB.js → chunk-OV7R2AH5.js} +58 -58
- package/dist/{chunk-CJQRZEZU.js → chunk-OW6XTJ33.js} +3 -3
- package/dist/{chunk-JAJMMPOF.js → chunk-PBMB2LY5.js} +3 -3
- package/dist/{chunk-THYWJQI4.js → chunk-PLDGQ5PO.js} +3 -3
- package/dist/{chunk-SJQ4QAFK.js → chunk-PQGIRNRF.js} +6 -6
- package/dist/{chunk-5HZT54X7.js → chunk-QG3EYUDB.js} +3 -3
- package/dist/{chunk-SDNGZDNK.js → chunk-QIZUNM6F.js} +5 -5
- package/dist/{chunk-3GCRM6UM.js → chunk-QLJKQS6P.js} +6 -6
- package/dist/{chunk-KHXRL3BH.js → chunk-R2KXIBCX.js} +1 -1
- package/dist/{chunk-QVLL4MKH.js → chunk-R74OHYTB.js} +3 -3
- package/dist/{chunk-ZNA2XOGX.js → chunk-RIC6PMBR.js} +7 -7
- package/dist/{chunk-LXZXXOJ3.js → chunk-RIN4CBRB.js} +17 -1
- package/dist/{chunk-2TDFXWGC.js → chunk-RRAIAUBR.js} +8 -8
- package/dist/chunk-RT6L7JXU.js +33 -0
- package/dist/{chunk-7NNA33IY.js → chunk-RVAVU222.js} +9 -9
- package/dist/{chunk-TN4TIT7O.js → chunk-S2Q7PO7I.js} +68 -7
- package/dist/{chunk-WEVK4TBV.js → chunk-SDPR7PGR.js} +1 -1
- package/dist/{chunk-SBH4E5NY.js → chunk-SDQ6V2QY.js} +3 -3
- package/dist/{chunk-5LI2P5VT.js → chunk-SKV7U4GW.js} +5 -5
- package/dist/{chunk-XR2UEF6U.js → chunk-SZVIRQZ2.js} +4 -4
- package/dist/{chunk-RQQ53CQJ.js → chunk-T7MQFDTF.js} +1 -1
- package/dist/{chunk-TKFMOTJK.js → chunk-TBREETGZ.js} +4 -4
- package/dist/{chunk-TP7M43SI.js → chunk-TCA3ZYNO.js} +2 -2
- package/dist/{chunk-PUQSQBZW.js → chunk-TIMWFAPD.js} +1 -1
- package/dist/{chunk-HLL6GLZO.js → chunk-TPPONKYW.js} +3 -3
- package/dist/{chunk-77R2QD4O.js → chunk-UBS6VEGB.js} +3 -92
- package/dist/{chunk-OZMCKYJL.js → chunk-UBTAADSY.js} +4 -4
- package/dist/{chunk-STSW4GDV.js → chunk-UI2KUK3F.js} +2 -2
- package/dist/{chunk-FIVW6L2I.js → chunk-UU2RQMXS.js} +1 -1
- package/dist/{chunk-N3WRPCPT.js → chunk-UYKWOC5A.js} +1 -1
- package/dist/{chunk-JI7HMGMO.js → chunk-VME3CJER.js} +1 -1
- package/dist/{chunk-TOUMBTYI.js → chunk-VXPWOEUS.js} +1 -1
- package/dist/{chunk-VHCDSNXF.js → chunk-W5UPPL3W.js} +2 -2
- package/dist/{chunk-C6OVKRMH.js → chunk-WDASBBB5.js} +1 -1
- package/dist/{chunk-FD7OJEGQ.js → chunk-WHLVH4RN.js} +2 -2
- package/dist/{chunk-6S72GJRI.js → chunk-WSR2ZXAJ.js} +5 -5
- package/dist/{chunk-L7DIEO5B.js → chunk-XDZGOUCR.js} +1 -1
- package/dist/{chunk-QLTN2DIY.js → chunk-XIHVSZ6I.js} +1 -1
- package/dist/{chunk-A2F5MDPU.js → chunk-XKVXLDSJ.js} +1 -1
- package/dist/chunk-XMVTX2EN.js +120 -0
- package/dist/{chunk-R4O667NT.js → chunk-XRDP2SYY.js} +1 -1
- package/dist/chunk-XZQV2OLD.js +93 -0
- package/dist/{chunk-VZEMURY7.js → chunk-YJNCEGX4.js} +2 -2
- package/dist/{chunk-YQYGAFCS.js → chunk-YNIIYGL4.js} +2 -2
- package/dist/{chunk-OJI3SRZ3.js → chunk-YTPCWCA3.js} +1 -1
- package/dist/{chunk-OEDISQ2O.js → chunk-YYTI5JIC.js} +2 -2
- package/dist/{chunk-3CKTAFTR.js → chunk-Z5I2Z6L3.js} +50 -33
- package/dist/{chunk-V7Y7WBGF.js → chunk-ZCLF2O6X.js} +1 -1
- package/dist/{chunk-K6RZE3F7.js → chunk-ZDZYRCVH.js} +1 -1
- package/dist/chunk-ZFEGVWHT.js +324 -0
- package/dist/{chunk-FIYO3KTR.js → chunk-ZJNRM77Y.js} +4 -4
- package/dist/{chunk-JOX3ZSRT.js → chunk-ZLBTDKSI.js} +1 -1
- package/dist/{chunk-NYWESQ6J.js → chunk-ZMDE5HEV.js} +221 -18
- package/dist/{chunk-BPTVQM72.js → chunk-ZZO3INVE.js} +1440 -1305
- package/dist/{collection-add-products-4TTEF6QV.js → collection-add-products-RHIQZ37R.js} +34 -34
- package/dist/{collection-create-SD4GKHFC.js → collection-create-EBAELCA2.js} +4 -4
- package/dist/{collection-detail-64YVMLBU.js → collection-detail-SJ4ZZLWY.js} +34 -34
- package/dist/{collection-edit-Z474HXCJ.js → collection-edit-TGXPOOSX.js} +4 -4
- package/dist/{collection-list-OTSGOEBC.js → collection-list-OFZGXVJA.js} +39 -36
- package/dist/{collection-metadata-FFHA6CQ3.js → collection-metadata-3CDRKSCP.js} +33 -32
- package/dist/{commission-rate-create-7BBUGS2I.js → commission-rate-create-OOVFRTYM.js} +41 -39
- package/dist/{commission-rate-detail-FORKXXJY.js → commission-rate-detail-5XFV6XH2.js} +32 -31
- package/dist/{commission-rate-edit-SAX2DAND.js → commission-rate-edit-6B4P2GOV.js} +41 -39
- package/dist/{commission-rate-list-EESTCCRP.js → commission-rate-list-OLAGFQNJ.js} +3 -3
- package/dist/{customer-create-WA4GYGVD.js → customer-create-DT6MYVMQ.js} +3 -3
- package/dist/{customer-create-address-YBI4KWWH.js → customer-create-address-VIG65ALU.js} +3 -3
- package/dist/{customer-detail-SDE4TDZD.js → customer-detail-Q4K56AZ4.js} +33 -32
- package/dist/{customer-edit-TFR6PVJJ.js → customer-edit-MHNLUNUL.js} +3 -3
- package/dist/{customer-group-add-customers-77BVWLTN.js → customer-group-add-customers-SI5TTT4S.js} +4 -4
- package/dist/{customer-group-create-32UIUO46.js → customer-group-create-W3FV4OEH.js} +3 -3
- package/dist/{customer-group-detail-QRY6BHGI.js → customer-group-detail-NSEFUNCF.js} +33 -32
- package/dist/{customer-group-edit-HFL7LZZZ.js → customer-group-edit-ZANHQ7RS.js} +3 -3
- package/dist/customer-group-list-GCEKCBUE.js +58 -0
- package/dist/{customer-group-metadata-FXI3J6DB.js → customer-group-metadata-LXJK3IMS.js} +33 -32
- package/dist/{customer-list-CXTUBLCK.js → customer-list-CHRZJTNK.js} +4 -4
- package/dist/{customer-metadata-BV4CHHWI.js → customer-metadata-ZZSCYFHY.js} +33 -32
- package/dist/{customers-add-customer-group-SUE2KKJR.js → customers-add-customer-group-TIBDJPYF.js} +32 -31
- package/dist/{edit-inventory-item-DDRUGVSK.js → edit-inventory-item-Y3CIG6L5.js} +32 -31
- package/dist/{edit-inventory-item-attributes-MDL7FSLR.js → edit-inventory-item-attributes-CZNIVWXY.js} +32 -31
- package/dist/{edit-reservation-JWABBNJ6.js → edit-reservation-OQCAZUIS.js} +5 -5
- package/dist/{edit-rules-ECNFIPUC.js → edit-rules-G7GRUQL6.js} +33 -32
- package/dist/index.d.ts +4 -1
- package/dist/index.js +347 -263
- package/dist/inventory-create-MFCGCJFB.js +57 -0
- package/dist/{inventory-detail-OIKNOS5A.js → inventory-detail-6V43ZQDK.js} +32 -31
- package/dist/{inventory-list-XSHWCPO4.js → inventory-list-TAJ4T5JG.js} +4 -4
- package/dist/{inventory-metadata-MHGDNLXT.js → inventory-metadata-PFXMJTSB.js} +33 -32
- package/dist/{inventory-stock-JG5CZWZA.js → inventory-stock-B4FYZAQB.js} +32 -31
- package/dist/{invite-25CGHT4W.js → invite-YRARW3RW.js} +3 -3
- package/dist/{location-create-G3MNWQWB.js → location-create-GXPH4WZI.js} +3 -3
- package/dist/{location-detail-5CGAZMBR.js → location-detail-NOUHQA4M.js} +32 -31
- package/dist/{location-edit-UI6AWCZS.js → location-edit-GNKQAXJG.js} +3 -3
- package/dist/{location-fulfillment-providers-BA2VMZHX.js → location-fulfillment-providers-A27CQMJN.js} +37 -35
- package/dist/location-list-AVCPUKBH.js +54 -0
- package/dist/{location-sales-channels-WXBK4EJO.js → location-sales-channels-U3MVWUAT.js} +5 -5
- package/dist/{location-service-zone-create-647O67PU.js → location-service-zone-create-E4LW45D7.js} +6 -6
- package/dist/{location-service-zone-edit-BUY6HNZM.js → location-service-zone-edit-UIVVQVMW.js} +5 -5
- package/dist/{location-service-zone-manage-areas-X2ZGRHHA.js → location-service-zone-manage-areas-F3SOZGVW.js} +6 -6
- package/dist/location-service-zone-shipping-option-create-DREWJ7SR.js +58 -0
- package/dist/{location-service-zone-shipping-option-edit-IJDU5PTW.js → location-service-zone-shipping-option-edit-3KNW7UBD.js} +4 -4
- package/dist/{location-service-zone-shipping-option-pricing-3T7HLKJC.js → location-service-zone-shipping-option-pricing-35SMJ6XP.js} +8 -8
- package/dist/{login-WU5VB5LW.js → login-QCYKZCZP.js} +31 -30
- package/dist/{manage-locations-IJIPCYAY.js → manage-locations-VIWHIN7B.js} +4 -4
- package/dist/{marketplace-add-currencies-RXLEQ6MZ.js → marketplace-add-currencies-Q4EJAXDN.js} +5 -5
- package/dist/{marketplace-detail-23KSAJVI.js → marketplace-detail-CYMZCRWM.js} +32 -31
- package/dist/{marketplace-edit-XPIEDQYD.js → marketplace-edit-AMRUND2Q.js} +4 -4
- package/dist/{marketplace-metadata-5GEWGH2M.js → marketplace-metadata-LYNL3W6L.js} +33 -32
- package/dist/{order-allocate-items-GYGER65Z.js → order-allocate-items-AZ3FDELU.js} +6 -6
- package/dist/{order-create-claim-RNUFU2MP.js → order-create-claim-HWZI4OEK.js} +35 -34
- package/dist/{order-create-edit-DLH76B2Q.js → order-create-edit-VIIAC2AA.js} +33 -32
- package/dist/{order-create-exchange-FA27FZU7.js → order-create-exchange-KRGBFSCC.js} +35 -34
- package/dist/{order-create-fulfillment-4F5JAUOX.js → order-create-fulfillment-K4LB6U6E.js} +32 -31
- package/dist/{order-create-refund-3LCTQXFD.js → order-create-refund-2OCPOAJS.js} +32 -31
- package/dist/{order-create-return-EO2C5RAA.js → order-create-return-4PREWHB7.js} +9 -9
- package/dist/{order-create-shipment-PIQ43ZSG.js → order-create-shipment-BD3DKSJX.js} +32 -31
- package/dist/{order-detail-2U26JNU2.js → order-detail-GETGE7YJ.js} +37 -36
- package/dist/{order-edit-billing-address-PRXCLUNR.js → order-edit-billing-address-3GN3QU4Y.js} +33 -32
- package/dist/{order-edit-email-GVKVQESG.js → order-edit-email-D6KSNSY4.js} +32 -31
- package/dist/{order-edit-shipping-address-UDNHXO2V.js → order-edit-shipping-address-Z7RP4UBB.js} +32 -31
- package/dist/{order-list-U2HL7VBX.js → order-list-727TI7BS.js} +9 -8
- package/dist/{order-metadata-HPXIR6KI.js → order-metadata-UCAS6KEK.js} +33 -32
- package/dist/{order-receive-return-FMM74XYM.js → order-receive-return-YZGUVELT.js} +33 -32
- package/dist/{order-request-transfer-SI5PSOKA.js → order-request-transfer-DBXAIXEG.js} +32 -31
- package/dist/pages/index.d.ts +65 -20
- package/dist/pages/index.js +168 -159
- package/dist/{payout-detail-L4VYAP53.js → payout-detail-SQKDY2F6.js} +3 -3
- package/dist/{payout-list-4S6MAU4R.js → payout-list-HPMP3CJH.js} +3 -3
- package/dist/{price-list-configuration-F2BZC6QX.js → price-list-configuration-XGX6HV4Q.js} +6 -6
- package/dist/price-list-create-SJBCYSRX.js +76 -0
- package/dist/{price-list-detail-IUJXNM6Y.js → price-list-detail-VA4F6JQJ.js} +35 -35
- package/dist/{price-list-edit-CERYYMC5.js → price-list-edit-OYRI7KZD.js} +5 -5
- package/dist/{price-list-list-RBD2MEZ5.js → price-list-list-27QDRHNY.js} +6 -6
- package/dist/price-list-prices-add-BLORGT25.js +71 -0
- package/dist/{price-list-prices-edit-2NYN6WVJ.js → price-list-prices-edit-7WHKIZHY.js} +33 -32
- package/dist/{product-attributes-EUDG25XA.js → product-attributes-BM54QUBZ.js} +3 -3
- package/dist/product-create-KEJB3U44.js +70 -0
- package/dist/{product-create-option-BG2ZKSFN.js → product-create-option-53CW7HXH.js} +3 -3
- package/dist/product-create-variant-YZODW67L.js +55 -0
- package/dist/{product-detail-F67SLUIA.js → product-detail-Y24FRUWA.js} +33 -32
- package/dist/{product-edit-HFWSBQQI.js → product-edit-AY2UVE3V.js} +3 -3
- package/dist/{product-edit-option-Y46SNVHN.js → product-edit-option-ULBJKDOE.js} +3 -3
- package/dist/{product-export-ABNA6ZTY.js → product-export-4G44DDXA.js} +39 -36
- package/dist/{product-import-SQSXBPK5.js → product-import-TIPIYEJJ.js} +33 -32
- package/dist/{product-list-NWHRQHVJ.js → product-list-BLFQWHIA.js} +34 -34
- package/dist/{product-media-YIQCVDCC.js → product-media-IKMGI2QA.js} +9 -7
- package/dist/{product-metadata-2Z5DIXJH.js → product-metadata-SKNZWKWO.js} +33 -32
- package/dist/{product-organization-L666C2EQ.js → product-organization-KHZQIBDK.js} +5 -5
- package/dist/{product-prices-DPGO4KHT.js → product-prices-XCC26S77.js} +6 -6
- package/dist/{product-sales-channels-6IS6T3EC.js → product-sales-channels-G22VD3VU.js} +4 -4
- package/dist/{product-shipping-profile-LMLRMJ36.js → product-shipping-profile-OPOM33SD.js} +3 -3
- package/dist/{product-stock-AQKD6EQO.js → product-stock-WIPVYJUH.js} +32 -31
- package/dist/{product-tag-create-5CF7JLN5.js → product-tag-create-3QK7MKMI.js} +32 -31
- package/dist/{product-tag-detail-2RJNUUT7.js → product-tag-detail-LSMLNJW6.js} +41 -39
- package/dist/{product-tag-edit-KGT54WP5.js → product-tag-edit-NHRQ55DX.js} +32 -31
- package/dist/{product-tag-list-PJG7ICZE.js → product-tag-list-UHBM6KBT.js} +41 -39
- package/dist/{product-tag-metadata-WU7DVJUM.js → product-tag-metadata-DGH7UF4L.js} +33 -32
- package/dist/{product-type-create-WHYGTCYX.js → product-type-create-X6NFMD2J.js} +3 -3
- package/dist/{product-type-detail-MZ3MAV2B.js → product-type-detail-GNRN4KTB.js} +35 -35
- package/dist/{product-type-edit-A4IE6BSF.js → product-type-edit-K5WDDPEY.js} +3 -3
- package/dist/{product-type-list-ND2IIR6O.js → product-type-list-6CTXFZBZ.js} +4 -4
- package/dist/{product-type-metadata-KX4ETP3Y.js → product-type-metadata-NFMNORIB.js} +33 -32
- package/dist/{product-variant-detail-USZXPSVX.js → product-variant-detail-TGSUSOEB.js} +33 -32
- package/dist/{product-variant-edit-5L2GWAHB.js → product-variant-edit-6OJRQWC6.js} +32 -31
- package/dist/{product-variant-manage-inventory-items-54V2HTA6.js → product-variant-manage-inventory-items-RFKTIM5A.js} +3 -3
- package/dist/{product-variant-metadata-SBYZTEIH.js → product-variant-metadata-4MWJAXYI.js} +33 -32
- package/dist/{profile-detail-OAQD5VJC.js → profile-detail-C5BGWHSQ.js} +3 -3
- package/dist/{profile-edit-DSZCGRY7.js → profile-edit-RXXHWORE.js} +3 -3
- package/dist/{promotion-add-campaign-JC4B53LS.js → promotion-add-campaign-TWE6G4R7.js} +7 -7
- package/dist/promotion-create-CPRWDBDW.js +55 -0
- package/dist/{promotion-detail-XOQTYXTV.js → promotion-detail-KGIX6TA2.js} +34 -33
- package/dist/{promotion-edit-details-KFZ2VVVQ.js → promotion-edit-details-J2JWFT2L.js} +3 -3
- package/dist/{promotion-list-EH7CW4JZ.js → promotion-list-U7PXQLZT.js} +6 -6
- package/dist/{refund-reason-create-EMGCAW5S.js → refund-reason-create-KYM2BCJ2.js} +32 -31
- package/dist/{refund-reason-edit-3D25LGKM.js → refund-reason-edit-JIG7FL7D.js} +32 -31
- package/dist/{refund-reason-list-V7HDVFS2.js → refund-reason-list-IO4INIKF.js} +35 -34
- package/dist/{region-add-countries-ZAQBBXIL.js → region-add-countries-OBJOMTGC.js} +4 -4
- package/dist/{region-create-IMSMEASB.js → region-create-BFA7ATKB.js} +5 -5
- package/dist/{region-detail-RASFBR5O.js → region-detail-TR3IRW6L.js} +4 -4
- package/dist/{region-edit-HGSLB3RU.js → region-edit-75ZVOJ3U.js} +5 -5
- package/dist/{region-list-WEILXVMS.js → region-list-D4VLAQXD.js} +4 -4
- package/dist/{region-metadata-4COKDRZH.js → region-metadata-NJUXGJJZ.js} +33 -32
- package/dist/{reservation-create-CIYW3ZKU.js → reservation-create-3PQ56FKT.js} +5 -5
- package/dist/{reservation-detail-2ARWTBE6.js → reservation-detail-TKILHE26.js} +32 -31
- package/dist/{reservation-list-W6IOXQZK.js → reservation-list-56EFZDRI.js} +5 -5
- package/dist/{reservation-metadata-3ZJ2C5BM.js → reservation-metadata-V7BLDGSJ.js} +33 -32
- package/dist/{reset-password-YQ6HMFFZ.js → reset-password-SXAC55FW.js} +3 -3
- package/dist/{return-reason-create-HHZ3EMCC.js → return-reason-create-2HPI654O.js} +3 -3
- package/dist/{return-reason-edit-5P43JRYC.js → return-reason-edit-NJSTWTP3.js} +3 -3
- package/dist/{return-reason-list-32MCIQMK.js → return-reason-list-RYRELICQ.js} +6 -6
- package/dist/{sales-channel-add-products-U2UTBUKE.js → sales-channel-add-products-27YLUPZP.js} +34 -34
- package/dist/{sales-channel-create-TMRTMLIX.js → sales-channel-create-QJTXOKAM.js} +4 -4
- package/dist/{sales-channel-detail-FRBKGP4X.js → sales-channel-detail-EW2YN7VL.js} +34 -34
- package/dist/{sales-channel-edit-4LE2N6EV.js → sales-channel-edit-CDOQ5WR3.js} +4 -4
- package/dist/sales-channel-list-JOSLAWUO.js +51 -0
- package/dist/{sales-channel-metadata-OKKVLC7G.js → sales-channel-metadata-YABMFKT3.js} +33 -32
- package/dist/{shipping-option-type-create-ZHRADP5E.js → shipping-option-type-create-KXRPACLG.js} +32 -31
- package/dist/{shipping-option-type-detail-ZDEEU3P5.js → shipping-option-type-detail-KHX2BRFP.js} +33 -32
- package/dist/{shipping-option-type-edit-2FCNVHNE.js → shipping-option-type-edit-N3L4TPUK.js} +32 -31
- package/dist/shipping-option-type-list-5A676BZT.js +61 -0
- package/dist/{shipping-profile-create-WLHDFQ4Q.js → shipping-profile-create-T5WADNL2.js} +3 -3
- package/dist/{shipping-profile-detail-AUWRGYYL.js → shipping-profile-detail-3II2GLOC.js} +3 -3
- package/dist/{shipping-profile-metadata-W7CND3IQ.js → shipping-profile-metadata-WDM4Y653.js} +33 -32
- package/dist/{shipping-profiles-list-RZT6HIZV.js → shipping-profiles-list-DY4G7Z3K.js} +3 -3
- package/dist/store-address-edit-7BBZSSIP.js +231 -0
- package/dist/store-closure-edit-CN5JR4F5.js +152 -0
- package/dist/store-create-FUYTHJL5.js +278 -0
- package/dist/store-details-65JQK3M3.js +125 -0
- package/dist/store-edit-IQAVLFU5.js +372 -0
- package/dist/store-list-DWFAFCKV.js +83 -0
- package/dist/store-member-invite-GAWCXSWL.js +338 -0
- package/dist/store-payment-details-edit-Z3GLY4TO.js +218 -0
- package/dist/store-professional-details-edit-7KWQOK46.js +147 -0
- package/dist/{tax-region-create-U5JWJUX4.js → tax-region-create-6VHCIPP7.js} +33 -32
- package/dist/tax-region-detail-AZVNX4QN.js +69 -0
- package/dist/{tax-region-edit-5DOYTPEF.js → tax-region-edit-7A6MZBXC.js} +32 -31
- package/dist/{tax-region-list-MRQ63BL3.js → tax-region-list-52PPICIL.js} +6 -6
- package/dist/{tax-region-metadata-WN3XSWGA.js → tax-region-metadata-UZYHKPTE.js} +33 -32
- package/dist/{tax-region-province-create-3GZUYVBY.js → tax-region-province-create-PU53RZPV.js} +3 -3
- package/dist/{tax-region-province-detail-QTBP47GV.js → tax-region-province-detail-7ERAOT3Y.js} +34 -33
- package/dist/{tax-region-tax-override-create-PRZ3DEZE.js → tax-region-tax-override-create-TIPPPVTR.js} +41 -39
- package/dist/{tax-region-tax-override-edit-YAA6TB6A.js → tax-region-tax-override-edit-HDQ4NS5I.js} +41 -39
- package/dist/{tax-region-tax-rate-create-KHNADBCN.js → tax-region-tax-rate-create-4MTXOD2Z.js} +4 -4
- package/dist/{tax-region-tax-rate-edit-JR5262VW.js → tax-region-tax-rate-edit-VUIEX4DT.js} +4 -4
- package/dist/{user-detail-I66RREWP.js → user-detail-C7ZG3JWC.js} +4 -4
- package/dist/{user-edit-LBJOZ4LG.js → user-edit-LSWGYWV3.js} +3 -3
- package/dist/{user-invite-EUNVBT5W.js → user-invite-XYAU2UIS.js} +3 -3
- package/dist/{user-list-BDJJI33F.js → user-list-YXRP4JU5.js} +3 -3
- package/dist/{user-metadata-4RXAMVDT.js → user-metadata-JGCXU4OO.js} +33 -32
- package/package.json +6 -6
- package/dist/chunk-A26VSQNI.js +0 -530
- package/dist/chunk-G5OVX555.js +0 -26
- package/dist/chunk-HPQG3PEA.js +0 -67
- package/dist/chunk-NHGR2OFE.js +0 -292
- package/dist/customer-group-list-Q3T72VH2.js +0 -57
- package/dist/inventory-create-S6CB4JYN.js +0 -56
- package/dist/location-list-656DEW7L.js +0 -53
- package/dist/location-service-zone-shipping-option-create-IASFWJ2Z.js +0 -57
- package/dist/price-list-create-ZJTDGJSS.js +0 -76
- package/dist/price-list-prices-add-AJJ76VMY.js +0 -71
- package/dist/product-create-XA7UOISW.js +0 -68
- package/dist/product-create-variant-4Z6HSHRE.js +0 -54
- package/dist/promotion-create-A6FMNECA.js +0 -54
- package/dist/sales-channel-list-36UHU63C.js +0 -50
- package/dist/seller-address-edit-VH4X5OIO.js +0 -223
- package/dist/seller-details-P7LPJ2UD.js +0 -104
- package/dist/seller-edit-TU72D5QS.js +0 -331
- package/dist/seller-list-CYNCPXYT.js +0 -80
- package/dist/shipping-option-type-list-OCCZ4DNS.js +0 -60
- package/dist/tax-region-detail-UNGDO64V.js +0 -68
|
@@ -0,0 +1,996 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AttributeUIComponent,
|
|
3
|
+
CreateAttributeSchema,
|
|
4
|
+
UpdateAttributeSchema
|
|
5
|
+
} from "./chunk-4ZTZTIIM.js";
|
|
6
|
+
import {
|
|
7
|
+
RouteFocusModal,
|
|
8
|
+
useRouteModal
|
|
9
|
+
} from "./chunk-OV7R2AH5.js";
|
|
10
|
+
import {
|
|
11
|
+
Form
|
|
12
|
+
} from "./chunk-3QSRE5LS.js";
|
|
13
|
+
import "./chunk-3MDRW5MA.js";
|
|
14
|
+
import "./chunk-MFL2TZ3W.js";
|
|
15
|
+
import "./chunk-YNIIYGL4.js";
|
|
16
|
+
import "./chunk-CBHNHLUZ.js";
|
|
17
|
+
import "./chunk-VME3CJER.js";
|
|
18
|
+
import {
|
|
19
|
+
useCreateAttribute
|
|
20
|
+
} from "./chunk-XMVTX2EN.js";
|
|
21
|
+
import "./chunk-5PUHROK4.js";
|
|
22
|
+
import "./chunk-TPPONKYW.js";
|
|
23
|
+
import "./chunk-DF3OGJAK.js";
|
|
24
|
+
import "./chunk-XRDP2SYY.js";
|
|
25
|
+
import "./chunk-FNBKEF54.js";
|
|
26
|
+
import "./chunk-EHQESDH2.js";
|
|
27
|
+
import "./chunk-XKVXLDSJ.js";
|
|
28
|
+
import "./chunk-XDZGOUCR.js";
|
|
29
|
+
import "./chunk-K4BGK3CO.js";
|
|
30
|
+
import "./chunk-YYTI5JIC.js";
|
|
31
|
+
import "./chunk-HAFZQK53.js";
|
|
32
|
+
import "./chunk-IJWG755C.js";
|
|
33
|
+
import "./chunk-M3YP3NX4.js";
|
|
34
|
+
import "./chunk-UU2RQMXS.js";
|
|
35
|
+
import "./chunk-O4STPJR2.js";
|
|
36
|
+
import "./chunk-R74OHYTB.js";
|
|
37
|
+
import "./chunk-22XJUSMM.js";
|
|
38
|
+
import "./chunk-OFKUNYQJ.js";
|
|
39
|
+
import "./chunk-W5UPPL3W.js";
|
|
40
|
+
import "./chunk-LC6TM5OT.js";
|
|
41
|
+
import "./chunk-7SJC6BWZ.js";
|
|
42
|
+
import "./chunk-N4JU7GWK.js";
|
|
43
|
+
import {
|
|
44
|
+
useProductCategories
|
|
45
|
+
} from "./chunk-52BRBQMY.js";
|
|
46
|
+
import "./chunk-BA2HXHTW.js";
|
|
47
|
+
import "./chunk-RHKRREUU.js";
|
|
48
|
+
import "./chunk-ZA2KFUFR.js";
|
|
49
|
+
import "./chunk-RIN4CBRB.js";
|
|
50
|
+
import "./chunk-NBMM2TZK.js";
|
|
51
|
+
|
|
52
|
+
// src/pages/attributes/attribute-create/attribute-create.tsx
|
|
53
|
+
import { useRef as useRef2, useState as useState3 } from "react";
|
|
54
|
+
import { Button as Button2, Heading, ProgressTabs, Text as Text3, toast } from "@medusajs/ui";
|
|
55
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
56
|
+
|
|
57
|
+
// src/pages/attributes/attribute-edit/components/attribute-form.tsx
|
|
58
|
+
import { forwardRef, useEffect as useEffect2, useMemo, useImperativeHandle, useState as useState2 } from "react";
|
|
59
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
60
|
+
import {
|
|
61
|
+
InlineTip,
|
|
62
|
+
Input as Input2,
|
|
63
|
+
Select,
|
|
64
|
+
Switch,
|
|
65
|
+
Text as Text2,
|
|
66
|
+
Textarea
|
|
67
|
+
} from "@medusajs/ui";
|
|
68
|
+
import { FormProvider, useForm, useWatch } from "react-hook-form";
|
|
69
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
70
|
+
|
|
71
|
+
// src/pages/attributes/attribute-create/components/multi-select-category.tsx
|
|
72
|
+
import { useEffect, useRef, useState } from "react";
|
|
73
|
+
import {
|
|
74
|
+
ArrowUturnLeft,
|
|
75
|
+
TriangleRightMini,
|
|
76
|
+
TrianglesMini,
|
|
77
|
+
XMarkMini
|
|
78
|
+
} from "@medusajs/icons";
|
|
79
|
+
import { Badge, Text } from "@medusajs/ui";
|
|
80
|
+
import { useTranslation } from "react-i18next";
|
|
81
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
82
|
+
var MultiSelectCategory = ({
|
|
83
|
+
categories,
|
|
84
|
+
value,
|
|
85
|
+
onChange
|
|
86
|
+
}) => {
|
|
87
|
+
const { t } = useTranslation();
|
|
88
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
89
|
+
const dropdownRef = useRef(null);
|
|
90
|
+
const triggerRef = useRef(null);
|
|
91
|
+
const [currentParentId, setCurrentParentId] = useState(null);
|
|
92
|
+
const [pathHistory, setPathHistory] = useState([]);
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
const handleClickOutside = (event) => {
|
|
95
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
96
|
+
setIsOpen(false);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
100
|
+
return () => {
|
|
101
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
102
|
+
};
|
|
103
|
+
}, []);
|
|
104
|
+
const handleToggle = () => {
|
|
105
|
+
setIsOpen((prev) => !prev);
|
|
106
|
+
};
|
|
107
|
+
const hasChildren = (categoryId) => {
|
|
108
|
+
return categories.some((cat) => cat.parent_category_id === categoryId);
|
|
109
|
+
};
|
|
110
|
+
const handleDrillDown = (category, event) => {
|
|
111
|
+
event.stopPropagation();
|
|
112
|
+
setPathHistory([...pathHistory, currentParentId]);
|
|
113
|
+
setCurrentParentId(category.id);
|
|
114
|
+
};
|
|
115
|
+
const handleGoBack = () => {
|
|
116
|
+
const newPathHistory = [...pathHistory];
|
|
117
|
+
const previousParentId = newPathHistory.pop();
|
|
118
|
+
setPathHistory(newPathHistory);
|
|
119
|
+
setCurrentParentId(previousParentId || null);
|
|
120
|
+
};
|
|
121
|
+
const handleItemClick = (categoryId) => {
|
|
122
|
+
const isSelected = value.includes(categoryId);
|
|
123
|
+
if (isSelected) {
|
|
124
|
+
onChange(value.filter((id) => id !== categoryId));
|
|
125
|
+
} else {
|
|
126
|
+
onChange([...value, categoryId]);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const currentCategories = categories.filter(
|
|
130
|
+
(cat) => cat.parent_category_id === currentParentId
|
|
131
|
+
);
|
|
132
|
+
const getBackButtonText = () => {
|
|
133
|
+
const parentCategory = categories.find((cat) => cat.id === currentParentId);
|
|
134
|
+
return parentCategory?.name || "";
|
|
135
|
+
};
|
|
136
|
+
return /* @__PURE__ */ jsxs(
|
|
137
|
+
"div",
|
|
138
|
+
{
|
|
139
|
+
className: "relative",
|
|
140
|
+
"data-testid": "attribute-form-category-multiselect",
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ jsxs(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
ref: triggerRef,
|
|
146
|
+
className: "focus-within:ring-ui-ring-interactive relative flex h-10 w-full cursor-pointer items-center justify-between overflow-hidden rounded-md border border-ui-border-base bg-ui-bg-field text-ui-fg-base shadow-sm transition-colors duration-150 ease-in-out focus-within:border-ui-border-interactive focus-within:ring-1 hover:bg-ui-bg-field-hover",
|
|
147
|
+
onClick: handleToggle,
|
|
148
|
+
"data-testid": "attribute-form-category-multiselect-trigger",
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ jsx(
|
|
151
|
+
"div",
|
|
152
|
+
{
|
|
153
|
+
className: "flex items-center gap-2 px-3 py-2",
|
|
154
|
+
"data-testid": "attribute-form-category-multiselect-trigger-content",
|
|
155
|
+
children: value.length > 0 ? /* @__PURE__ */ jsx(
|
|
156
|
+
"button",
|
|
157
|
+
{
|
|
158
|
+
type: "button",
|
|
159
|
+
onClick: (e) => {
|
|
160
|
+
e.stopPropagation();
|
|
161
|
+
onChange([]);
|
|
162
|
+
},
|
|
163
|
+
"data-testid": "attribute-form-category-multiselect-clear-button",
|
|
164
|
+
children: /* @__PURE__ */ jsxs(
|
|
165
|
+
Badge,
|
|
166
|
+
{
|
|
167
|
+
size: "small",
|
|
168
|
+
className: "w-fit",
|
|
169
|
+
"data-testid": "attribute-form-category-multiselect-badge",
|
|
170
|
+
children: [
|
|
171
|
+
value.length,
|
|
172
|
+
/* @__PURE__ */ jsx(XMarkMini, {})
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
) : /* @__PURE__ */ jsx(
|
|
178
|
+
Text,
|
|
179
|
+
{
|
|
180
|
+
className: "text-ui-fg-subtle",
|
|
181
|
+
"data-testid": "attribute-form-category-multiselect-placeholder",
|
|
182
|
+
children: t("attributes.fields.categories", "Select categories")
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
/* @__PURE__ */ jsx(
|
|
188
|
+
"span",
|
|
189
|
+
{
|
|
190
|
+
className: "flex h-full w-10 items-center justify-center border-l border-ui-border-base",
|
|
191
|
+
"data-testid": "attribute-form-category-multiselect-icon",
|
|
192
|
+
children: /* @__PURE__ */ jsx(TrianglesMini, {})
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
isOpen && /* @__PURE__ */ jsxs(
|
|
199
|
+
"div",
|
|
200
|
+
{
|
|
201
|
+
ref: dropdownRef,
|
|
202
|
+
className: "absolute z-10 mt-1 max-h-60 w-full overflow-y-auto rounded-md border border-ui-border-base bg-ui-bg-base shadow-lg",
|
|
203
|
+
"data-testid": "attribute-form-category-multiselect-dropdown",
|
|
204
|
+
children: [
|
|
205
|
+
currentParentId !== null && /* @__PURE__ */ jsxs(
|
|
206
|
+
"div",
|
|
207
|
+
{
|
|
208
|
+
className: "flex cursor-pointer items-center gap-3 border-b border-ui-border-base px-3 py-2 text-ui-fg-subtle hover:bg-ui-bg-base-hover",
|
|
209
|
+
onClick: handleGoBack,
|
|
210
|
+
"data-testid": "attribute-form-category-multiselect-back-button",
|
|
211
|
+
children: [
|
|
212
|
+
/* @__PURE__ */ jsx(ArrowUturnLeft, {}),
|
|
213
|
+
/* @__PURE__ */ jsx(Text, { "data-testid": "attribute-form-category-multiselect-back-text", children: getBackButtonText() })
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
currentCategories.length === 0 ? /* @__PURE__ */ jsx(
|
|
218
|
+
"div",
|
|
219
|
+
{
|
|
220
|
+
className: "p-3 text-ui-fg-subtle",
|
|
221
|
+
"data-testid": "attribute-form-category-multiselect-empty",
|
|
222
|
+
children: t("general.noResultsTitle", "No categories found.")
|
|
223
|
+
}
|
|
224
|
+
) : currentCategories.map((category) => {
|
|
225
|
+
const isSelected = value.includes(category.id);
|
|
226
|
+
const hasChildrenNode = hasChildren(category.id);
|
|
227
|
+
return /* @__PURE__ */ jsxs(
|
|
228
|
+
"div",
|
|
229
|
+
{
|
|
230
|
+
className: "flex cursor-pointer items-center justify-between px-1 py-1",
|
|
231
|
+
onClick: () => handleItemClick(category.id),
|
|
232
|
+
"data-testid": `attribute-form-category-multiselect-item-${category.id}`,
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ jsxs(
|
|
235
|
+
"div",
|
|
236
|
+
{
|
|
237
|
+
className: "relative mr-2 flex flex-1 items-center rounded-md px-2 py-1.5 hover:bg-ui-bg-base-hover",
|
|
238
|
+
"data-testid": `attribute-form-category-multiselect-item-${category.id}-content`,
|
|
239
|
+
children: [
|
|
240
|
+
isSelected && /* @__PURE__ */ jsx(
|
|
241
|
+
"span",
|
|
242
|
+
{
|
|
243
|
+
className: "absolute left-3 top-1/2 h-1 w-1 -translate-y-1/2 rounded-full bg-ui-fg-base",
|
|
244
|
+
"data-testid": `attribute-form-category-multiselect-item-${category.id}-selected-indicator`
|
|
245
|
+
}
|
|
246
|
+
),
|
|
247
|
+
/* @__PURE__ */ jsx(
|
|
248
|
+
Text,
|
|
249
|
+
{
|
|
250
|
+
className: "ml-6",
|
|
251
|
+
"data-testid": `attribute-form-category-multiselect-item-${category.id}-name`,
|
|
252
|
+
children: category.name
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
),
|
|
258
|
+
hasChildrenNode && /* @__PURE__ */ jsx(
|
|
259
|
+
"div",
|
|
260
|
+
{
|
|
261
|
+
onClick: (e) => handleDrillDown(category, e),
|
|
262
|
+
className: "rounded-md p-2 hover:bg-ui-bg-base-hover",
|
|
263
|
+
"data-testid": `attribute-form-category-multiselect-item-${category.id}-drill-down`,
|
|
264
|
+
children: /* @__PURE__ */ jsx(TriangleRightMini, { className: "mr-1" })
|
|
265
|
+
}
|
|
266
|
+
)
|
|
267
|
+
]
|
|
268
|
+
},
|
|
269
|
+
category.id
|
|
270
|
+
);
|
|
271
|
+
})
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
)
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
);
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
// src/pages/attributes/attribute-create/components/possible-values-list.tsx
|
|
281
|
+
import {
|
|
282
|
+
DndContext,
|
|
283
|
+
closestCenter,
|
|
284
|
+
KeyboardSensor,
|
|
285
|
+
PointerSensor,
|
|
286
|
+
useSensor,
|
|
287
|
+
useSensors
|
|
288
|
+
} from "@dnd-kit/core";
|
|
289
|
+
import {
|
|
290
|
+
arrayMove,
|
|
291
|
+
SortableContext,
|
|
292
|
+
sortableKeyboardCoordinates,
|
|
293
|
+
useSortable,
|
|
294
|
+
verticalListSortingStrategy
|
|
295
|
+
} from "@dnd-kit/sortable";
|
|
296
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
297
|
+
import { DotsSix, XMark } from "@medusajs/icons";
|
|
298
|
+
import { Button, Hint, IconButton, Input, Label } from "@medusajs/ui";
|
|
299
|
+
import { useFieldArray, useFormContext } from "react-hook-form";
|
|
300
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
301
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
302
|
+
var SortableItem = ({ id, index, onRemove }) => {
|
|
303
|
+
const {
|
|
304
|
+
register,
|
|
305
|
+
formState: { errors }
|
|
306
|
+
} = useFormContext();
|
|
307
|
+
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id });
|
|
308
|
+
const style = {
|
|
309
|
+
transform: CSS.Transform.toString(transform),
|
|
310
|
+
transition
|
|
311
|
+
};
|
|
312
|
+
const possibleValuesErrors = errors?.possible_values;
|
|
313
|
+
const fieldError = Array.isArray(possibleValuesErrors) ? possibleValuesErrors[index]?.value : void 0;
|
|
314
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
315
|
+
/* @__PURE__ */ jsxs2(
|
|
316
|
+
"div",
|
|
317
|
+
{
|
|
318
|
+
ref: setNodeRef,
|
|
319
|
+
style,
|
|
320
|
+
className: "flex items-center gap-2 p-2 bg-ui-bg-component border border-ui-border-base rounded-xl mb-2",
|
|
321
|
+
"data-testid": `attribute-form-possible-value-item-${index}`,
|
|
322
|
+
children: [
|
|
323
|
+
/* @__PURE__ */ jsx2(
|
|
324
|
+
"button",
|
|
325
|
+
{
|
|
326
|
+
type: "button",
|
|
327
|
+
className: "cursor-grab active:cursor-grabbing",
|
|
328
|
+
...attributes,
|
|
329
|
+
...listeners,
|
|
330
|
+
"data-testid": `attribute-form-possible-value-drag-handle-${index}`,
|
|
331
|
+
children: /* @__PURE__ */ jsx2(DotsSix, { className: "text-ui-fg-subtle" })
|
|
332
|
+
}
|
|
333
|
+
),
|
|
334
|
+
/* @__PURE__ */ jsx2("div", { className: "flex-1", children: /* @__PURE__ */ jsx2(
|
|
335
|
+
Input,
|
|
336
|
+
{
|
|
337
|
+
className: "flex-1",
|
|
338
|
+
"aria-invalid": !!fieldError,
|
|
339
|
+
placeholder: "Enter value",
|
|
340
|
+
...register(`possible_values.${index}.value`),
|
|
341
|
+
"data-testid": `attribute-form-possible-value-input-${index}`
|
|
342
|
+
}
|
|
343
|
+
) }),
|
|
344
|
+
/* @__PURE__ */ jsx2(
|
|
345
|
+
IconButton,
|
|
346
|
+
{
|
|
347
|
+
variant: "transparent",
|
|
348
|
+
size: "small",
|
|
349
|
+
type: "button",
|
|
350
|
+
onClick: onRemove,
|
|
351
|
+
"data-testid": `attribute-form-possible-value-remove-button-${index}`,
|
|
352
|
+
children: /* @__PURE__ */ jsx2(XMark, {})
|
|
353
|
+
}
|
|
354
|
+
)
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
),
|
|
358
|
+
fieldError && /* @__PURE__ */ jsx2(
|
|
359
|
+
Hint,
|
|
360
|
+
{
|
|
361
|
+
variant: "error",
|
|
362
|
+
className: "mb-2",
|
|
363
|
+
"data-testid": `attribute-form-possible-value-error-${index}`,
|
|
364
|
+
children: fieldError.message
|
|
365
|
+
}
|
|
366
|
+
)
|
|
367
|
+
] });
|
|
368
|
+
};
|
|
369
|
+
var PossibleValuesList = () => {
|
|
370
|
+
const { t } = useTranslation2();
|
|
371
|
+
const { control, getValues, formState } = useFormContext();
|
|
372
|
+
const { fields, append, remove, update } = useFieldArray({
|
|
373
|
+
control,
|
|
374
|
+
name: "possible_values"
|
|
375
|
+
});
|
|
376
|
+
const sensors = useSensors(
|
|
377
|
+
useSensor(PointerSensor),
|
|
378
|
+
useSensor(KeyboardSensor, {
|
|
379
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
380
|
+
})
|
|
381
|
+
);
|
|
382
|
+
const handleDragEnd = (event) => {
|
|
383
|
+
const { active, over } = event;
|
|
384
|
+
if (over && active.id !== over.id) {
|
|
385
|
+
const oldIndex = fields.findIndex((field) => field.id === active.id);
|
|
386
|
+
const newIndex = fields.findIndex((field) => field.id === over.id);
|
|
387
|
+
const currentValues = getValues("possible_values");
|
|
388
|
+
const reorderedValues = arrayMove(currentValues, oldIndex, newIndex);
|
|
389
|
+
reorderedValues.forEach((value, index) => {
|
|
390
|
+
update(index, {
|
|
391
|
+
value: value.value,
|
|
392
|
+
rank: index,
|
|
393
|
+
metadata: value.metadata || {}
|
|
394
|
+
});
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
const handleAddValue = (e) => {
|
|
399
|
+
e.preventDefault();
|
|
400
|
+
append({
|
|
401
|
+
value: "",
|
|
402
|
+
rank: fields.length,
|
|
403
|
+
metadata: {}
|
|
404
|
+
});
|
|
405
|
+
};
|
|
406
|
+
const possibleValuesError = formState.errors.possible_values;
|
|
407
|
+
const shouldShowListError = possibleValuesError && !Array.isArray(possibleValuesError);
|
|
408
|
+
return /* @__PURE__ */ jsxs2("div", { className: "space-y-2", "data-testid": "attribute-form-possible-values-list", children: [
|
|
409
|
+
/* @__PURE__ */ jsxs2(
|
|
410
|
+
"div",
|
|
411
|
+
{
|
|
412
|
+
className: "flex items-center justify-between pb-1",
|
|
413
|
+
"data-testid": "attribute-form-possible-values-header",
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ jsx2(Label, { "data-testid": "attribute-form-possible-values-label", children: t("attributes.fields.possibleValues", "Possible Values") }),
|
|
416
|
+
/* @__PURE__ */ jsx2(
|
|
417
|
+
Button,
|
|
418
|
+
{
|
|
419
|
+
type: "button",
|
|
420
|
+
variant: "secondary",
|
|
421
|
+
size: "small",
|
|
422
|
+
onClick: handleAddValue,
|
|
423
|
+
"data-testid": "attribute-form-possible-values-add-button",
|
|
424
|
+
children: t("actions.add", "Add")
|
|
425
|
+
}
|
|
426
|
+
)
|
|
427
|
+
]
|
|
428
|
+
}
|
|
429
|
+
),
|
|
430
|
+
/* @__PURE__ */ jsx2(
|
|
431
|
+
DndContext,
|
|
432
|
+
{
|
|
433
|
+
sensors,
|
|
434
|
+
collisionDetection: closestCenter,
|
|
435
|
+
onDragEnd: handleDragEnd,
|
|
436
|
+
children: /* @__PURE__ */ jsx2(
|
|
437
|
+
SortableContext,
|
|
438
|
+
{
|
|
439
|
+
items: fields.map((field) => field.id),
|
|
440
|
+
strategy: verticalListSortingStrategy,
|
|
441
|
+
children: fields.map((field, index) => /* @__PURE__ */ jsx2(
|
|
442
|
+
SortableItem,
|
|
443
|
+
{
|
|
444
|
+
id: field.id,
|
|
445
|
+
index,
|
|
446
|
+
onRemove: () => remove(index)
|
|
447
|
+
},
|
|
448
|
+
field.id
|
|
449
|
+
))
|
|
450
|
+
}
|
|
451
|
+
)
|
|
452
|
+
}
|
|
453
|
+
),
|
|
454
|
+
shouldShowListError && /* @__PURE__ */ jsx2(
|
|
455
|
+
Hint,
|
|
456
|
+
{
|
|
457
|
+
variant: "error",
|
|
458
|
+
"data-testid": "attribute-form-possible-values-list-error",
|
|
459
|
+
children: possibleValuesError.message
|
|
460
|
+
}
|
|
461
|
+
)
|
|
462
|
+
] });
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
// src/pages/attributes/attribute-edit/components/attribute-form.tsx
|
|
466
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
467
|
+
var UI_COMPONENT_LABELS = {
|
|
468
|
+
select: "Single Select",
|
|
469
|
+
multivalue: "Multi Select",
|
|
470
|
+
unit: "Unit",
|
|
471
|
+
toggle: "Toggle",
|
|
472
|
+
text_area: "Text"
|
|
473
|
+
};
|
|
474
|
+
var AttributeForm = forwardRef(
|
|
475
|
+
({
|
|
476
|
+
initialData,
|
|
477
|
+
onSubmit,
|
|
478
|
+
categories,
|
|
479
|
+
mode = "create",
|
|
480
|
+
activeTab = "details",
|
|
481
|
+
onFormStateChange
|
|
482
|
+
}, ref) => {
|
|
483
|
+
const { t } = useTranslation3();
|
|
484
|
+
const [showCategorySection, setShowCategorySection] = useState2(
|
|
485
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
486
|
+
(initialData?.product_categories?.length || 0) > 0
|
|
487
|
+
);
|
|
488
|
+
const form = useForm({
|
|
489
|
+
resolver: zodResolver(
|
|
490
|
+
mode === "create" ? CreateAttributeSchema : UpdateAttributeSchema
|
|
491
|
+
),
|
|
492
|
+
defaultValues: {
|
|
493
|
+
name: initialData?.name ?? "",
|
|
494
|
+
description: initialData?.description ?? "",
|
|
495
|
+
handle: initialData?.handle ?? "",
|
|
496
|
+
ui_component: initialData?.ui_component ?? AttributeUIComponent.SELECT,
|
|
497
|
+
is_filterable: initialData?.is_filterable ?? false,
|
|
498
|
+
is_required: initialData?.is_required ?? false,
|
|
499
|
+
possible_values: initialData?.possible_values?.map((v) => ({
|
|
500
|
+
id: v.id,
|
|
501
|
+
value: v.value,
|
|
502
|
+
rank: v.rank
|
|
503
|
+
})) ?? [],
|
|
504
|
+
product_category_ids: [],
|
|
505
|
+
metadata: {}
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
const handleSubmit = form.handleSubmit(async (data) => {
|
|
509
|
+
try {
|
|
510
|
+
await onSubmit(data);
|
|
511
|
+
} catch (error) {
|
|
512
|
+
console.error(error);
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
useImperativeHandle(ref, () => ({
|
|
516
|
+
validateFields: async (fields) => {
|
|
517
|
+
const result = await form.trigger(
|
|
518
|
+
fields
|
|
519
|
+
);
|
|
520
|
+
return result;
|
|
521
|
+
}
|
|
522
|
+
}));
|
|
523
|
+
const [name, description, handle, uiComponent, possibleValues] = useWatch({
|
|
524
|
+
control: form.control,
|
|
525
|
+
name: [
|
|
526
|
+
"name",
|
|
527
|
+
"description",
|
|
528
|
+
"handle",
|
|
529
|
+
"ui_component",
|
|
530
|
+
"possible_values"
|
|
531
|
+
]
|
|
532
|
+
});
|
|
533
|
+
const formStateKey = useMemo(() => {
|
|
534
|
+
return JSON.stringify({
|
|
535
|
+
name,
|
|
536
|
+
description,
|
|
537
|
+
handle,
|
|
538
|
+
uiComponent,
|
|
539
|
+
valuesCount: possibleValues?.length ?? 0
|
|
540
|
+
});
|
|
541
|
+
}, [name, description, handle, uiComponent, possibleValues]);
|
|
542
|
+
useEffect2(() => {
|
|
543
|
+
if (!onFormStateChange) return;
|
|
544
|
+
const hasName = name?.trim();
|
|
545
|
+
const hasDetailsData = description?.trim() || handle?.trim();
|
|
546
|
+
const detailsStatus = hasName ? "completed" : hasDetailsData ? "in-progress" : "not-started";
|
|
547
|
+
const hasTypeData = uiComponent && (possibleValues?.length ?? 0) > 0;
|
|
548
|
+
const typeStatus = hasTypeData ? "completed" : "not-started";
|
|
549
|
+
onFormStateChange({
|
|
550
|
+
detailsStatus,
|
|
551
|
+
typeStatus
|
|
552
|
+
});
|
|
553
|
+
}, [formStateKey, onFormStateChange]);
|
|
554
|
+
const renderDetailsTab = () => /* @__PURE__ */ jsxs3("div", { className: "grid gap-6", "data-testid": "attribute-form-details-tab", children: [
|
|
555
|
+
/* @__PURE__ */ jsxs3("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
556
|
+
/* @__PURE__ */ jsx3(
|
|
557
|
+
Form.Field,
|
|
558
|
+
{
|
|
559
|
+
control: form.control,
|
|
560
|
+
name: "name",
|
|
561
|
+
render: ({ field }) => /* @__PURE__ */ jsxs3(Form.Item, { "data-testid": "attribute-form-name-field", children: [
|
|
562
|
+
/* @__PURE__ */ jsx3(Form.Label, { "data-testid": "attribute-form-name-label", children: t("attributes.fields.name", "Name") }),
|
|
563
|
+
/* @__PURE__ */ jsx3(Form.Control, { "data-testid": "attribute-form-name-control", children: /* @__PURE__ */ jsx3(
|
|
564
|
+
Input2,
|
|
565
|
+
{
|
|
566
|
+
...field,
|
|
567
|
+
size: "small",
|
|
568
|
+
"data-testid": "attribute-form-name-input"
|
|
569
|
+
}
|
|
570
|
+
) }),
|
|
571
|
+
/* @__PURE__ */ jsx3(Form.ErrorMessage, { "data-testid": "attribute-form-name-error" })
|
|
572
|
+
] })
|
|
573
|
+
}
|
|
574
|
+
),
|
|
575
|
+
/* @__PURE__ */ jsx3(
|
|
576
|
+
Form.Field,
|
|
577
|
+
{
|
|
578
|
+
control: form.control,
|
|
579
|
+
name: "handle",
|
|
580
|
+
render: ({ field }) => /* @__PURE__ */ jsxs3(Form.Item, { "data-testid": "attribute-form-handle-field", children: [
|
|
581
|
+
/* @__PURE__ */ jsx3(Form.Label, { optional: true, "data-testid": "attribute-form-handle-label", children: t("attributes.fields.handle", "Handle") }),
|
|
582
|
+
/* @__PURE__ */ jsx3(Form.Control, { "data-testid": "attribute-form-handle-control", children: /* @__PURE__ */ jsxs3("div", { className: "relative", children: [
|
|
583
|
+
/* @__PURE__ */ jsx3(
|
|
584
|
+
Input2,
|
|
585
|
+
{
|
|
586
|
+
...field,
|
|
587
|
+
size: "small",
|
|
588
|
+
className: "pl-9",
|
|
589
|
+
"data-testid": "attribute-form-handle-input"
|
|
590
|
+
}
|
|
591
|
+
),
|
|
592
|
+
/* @__PURE__ */ jsx3("div", { className: "z-100 absolute bottom-0 left-0 top-0 flex w-7 items-center justify-center border-r border-ui-border-base px-2 text-ui-fg-muted", children: "/" })
|
|
593
|
+
] }) }),
|
|
594
|
+
/* @__PURE__ */ jsx3(Form.ErrorMessage, { "data-testid": "attribute-form-handle-error" })
|
|
595
|
+
] })
|
|
596
|
+
}
|
|
597
|
+
)
|
|
598
|
+
] }),
|
|
599
|
+
/* @__PURE__ */ jsxs3("div", { className: "grid grid-cols-1 gap-4", children: [
|
|
600
|
+
/* @__PURE__ */ jsx3(
|
|
601
|
+
Form.Field,
|
|
602
|
+
{
|
|
603
|
+
control: form.control,
|
|
604
|
+
name: "description",
|
|
605
|
+
render: ({ field }) => /* @__PURE__ */ jsxs3(Form.Item, { "data-testid": "attribute-form-description-field", children: [
|
|
606
|
+
/* @__PURE__ */ jsx3(
|
|
607
|
+
Form.Label,
|
|
608
|
+
{
|
|
609
|
+
optional: true,
|
|
610
|
+
"data-testid": "attribute-form-description-label",
|
|
611
|
+
children: t("attributes.fields.description", "Description")
|
|
612
|
+
}
|
|
613
|
+
),
|
|
614
|
+
/* @__PURE__ */ jsx3(Form.Control, { "data-testid": "attribute-form-description-control", children: /* @__PURE__ */ jsx3(
|
|
615
|
+
Textarea,
|
|
616
|
+
{
|
|
617
|
+
...field,
|
|
618
|
+
"data-testid": "attribute-form-description-input"
|
|
619
|
+
}
|
|
620
|
+
) }),
|
|
621
|
+
/* @__PURE__ */ jsx3(Form.ErrorMessage, { "data-testid": "attribute-form-description-error" })
|
|
622
|
+
] })
|
|
623
|
+
}
|
|
624
|
+
),
|
|
625
|
+
/* @__PURE__ */ jsx3(
|
|
626
|
+
Form.Field,
|
|
627
|
+
{
|
|
628
|
+
control: form.control,
|
|
629
|
+
name: "is_filterable",
|
|
630
|
+
render: ({ field }) => /* @__PURE__ */ jsx3(Form.Item, { "data-testid": "attribute-form-filterable-field", children: /* @__PURE__ */ jsx3("div", { className: "rounded-lg bg-ui-bg-component p-4 shadow-elevation-card-rest", children: /* @__PURE__ */ jsxs3("div", { className: "flex gap-3", children: [
|
|
631
|
+
/* @__PURE__ */ jsx3(Form.Control, { "data-testid": "attribute-form-filterable-control", children: /* @__PURE__ */ jsx3(
|
|
632
|
+
Switch,
|
|
633
|
+
{
|
|
634
|
+
checked: field.value,
|
|
635
|
+
onCheckedChange: field.onChange,
|
|
636
|
+
className: "mt-1",
|
|
637
|
+
"data-testid": "attribute-form-filterable-switch"
|
|
638
|
+
}
|
|
639
|
+
) }),
|
|
640
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
641
|
+
/* @__PURE__ */ jsx3(Form.Label, { "data-testid": "attribute-form-filterable-label", children: t(
|
|
642
|
+
"attributes.fields.isFilterable",
|
|
643
|
+
"Yes, this is a filterable attribute"
|
|
644
|
+
) }),
|
|
645
|
+
/* @__PURE__ */ jsx3(Text2, { className: "mt-1 text-xs text-ui-fg-subtle", children: t(
|
|
646
|
+
"attributes.fields.isFilterableHint",
|
|
647
|
+
"If checked, buyers will be able to filter products using this attribute."
|
|
648
|
+
) })
|
|
649
|
+
] })
|
|
650
|
+
] }) }) })
|
|
651
|
+
}
|
|
652
|
+
),
|
|
653
|
+
/* @__PURE__ */ jsx3(
|
|
654
|
+
Form.Field,
|
|
655
|
+
{
|
|
656
|
+
control: form.control,
|
|
657
|
+
name: "is_required",
|
|
658
|
+
render: ({ field }) => /* @__PURE__ */ jsx3(Form.Item, { "data-testid": "attribute-form-required-field", children: /* @__PURE__ */ jsx3("div", { className: "rounded-lg bg-ui-bg-component p-4 shadow-elevation-card-rest", children: /* @__PURE__ */ jsxs3("div", { className: "flex gap-3", children: [
|
|
659
|
+
/* @__PURE__ */ jsx3(Form.Control, { "data-testid": "attribute-form-required-control", children: /* @__PURE__ */ jsx3(
|
|
660
|
+
Switch,
|
|
661
|
+
{
|
|
662
|
+
checked: field.value,
|
|
663
|
+
onCheckedChange: field.onChange,
|
|
664
|
+
className: "mt-1",
|
|
665
|
+
"data-testid": "attribute-form-required-switch"
|
|
666
|
+
}
|
|
667
|
+
) }),
|
|
668
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
669
|
+
/* @__PURE__ */ jsx3(Form.Label, { "data-testid": "attribute-form-required-label", children: t(
|
|
670
|
+
"attributes.fields.isRequired",
|
|
671
|
+
"Yes, this is a required attribute"
|
|
672
|
+
) }),
|
|
673
|
+
/* @__PURE__ */ jsx3(Text2, { className: "mt-1 text-xs text-ui-fg-subtle", children: t(
|
|
674
|
+
"attributes.fields.isRequiredHint",
|
|
675
|
+
"If checked, vendors must set a value to this attribute."
|
|
676
|
+
) })
|
|
677
|
+
] })
|
|
678
|
+
] }) }) })
|
|
679
|
+
}
|
|
680
|
+
),
|
|
681
|
+
/* @__PURE__ */ jsx3(
|
|
682
|
+
Form.Field,
|
|
683
|
+
{
|
|
684
|
+
control: form.control,
|
|
685
|
+
name: "product_category_ids",
|
|
686
|
+
render: ({ field }) => {
|
|
687
|
+
const categoryIds = field.value ?? [];
|
|
688
|
+
const isGlobal = categoryIds.length === 0 && !showCategorySection;
|
|
689
|
+
return /* @__PURE__ */ jsxs3(Form.Item, { "data-testid": "attribute-form-global-field", children: [
|
|
690
|
+
/* @__PURE__ */ jsx3("div", { className: "rounded-lg bg-ui-bg-component p-4 shadow-elevation-card-rest", children: /* @__PURE__ */ jsxs3("div", { className: "flex gap-3", children: [
|
|
691
|
+
/* @__PURE__ */ jsx3(Form.Control, { "data-testid": "attribute-form-global-control", children: /* @__PURE__ */ jsx3(
|
|
692
|
+
Switch,
|
|
693
|
+
{
|
|
694
|
+
checked: isGlobal,
|
|
695
|
+
onCheckedChange: (checked) => {
|
|
696
|
+
if (checked) {
|
|
697
|
+
field.onChange([]);
|
|
698
|
+
setShowCategorySection(false);
|
|
699
|
+
} else {
|
|
700
|
+
setShowCategorySection(true);
|
|
701
|
+
}
|
|
702
|
+
},
|
|
703
|
+
className: "mt-1",
|
|
704
|
+
"data-testid": "attribute-form-global-switch"
|
|
705
|
+
}
|
|
706
|
+
) }),
|
|
707
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
708
|
+
/* @__PURE__ */ jsx3(Form.Label, { "data-testid": "attribute-form-global-label", children: t(
|
|
709
|
+
"attributes.fields.global",
|
|
710
|
+
"Yes, this is a global attribute"
|
|
711
|
+
) }),
|
|
712
|
+
/* @__PURE__ */ jsx3(Text2, { className: "mt-1 text-xs text-ui-fg-subtle", children: t(
|
|
713
|
+
"attributes.hints.global",
|
|
714
|
+
"When enabled, this attribute applies to all products regardless of category."
|
|
715
|
+
) })
|
|
716
|
+
] })
|
|
717
|
+
] }) }),
|
|
718
|
+
(showCategorySection || categoryIds.length > 0) && /* @__PURE__ */ jsxs3("div", { className: "mt-4", "data-testid": "attribute-form-category-field", children: [
|
|
719
|
+
/* @__PURE__ */ jsx3(
|
|
720
|
+
Form.Label,
|
|
721
|
+
{
|
|
722
|
+
optional: true,
|
|
723
|
+
"data-testid": "attribute-form-category-label",
|
|
724
|
+
children: t("attributes.fields.categories", "Product Categories")
|
|
725
|
+
}
|
|
726
|
+
),
|
|
727
|
+
/* @__PURE__ */ jsx3("div", { className: "mt-1", children: /* @__PURE__ */ jsx3(
|
|
728
|
+
MultiSelectCategory,
|
|
729
|
+
{
|
|
730
|
+
categories: categories ?? [],
|
|
731
|
+
value: categoryIds,
|
|
732
|
+
onChange: (value) => field.onChange(value)
|
|
733
|
+
}
|
|
734
|
+
) }),
|
|
735
|
+
/* @__PURE__ */ jsx3(Form.ErrorMessage, { "data-testid": "attribute-form-category-error" }),
|
|
736
|
+
/* @__PURE__ */ jsx3("div", { className: "mt-3", children: /* @__PURE__ */ jsx3(InlineTip, { label: "Warning", variant: "warning", children: t(
|
|
737
|
+
"attributes.hints.categoryInheritance",
|
|
738
|
+
"Child categories will inherit this attribute."
|
|
739
|
+
) }) })
|
|
740
|
+
] })
|
|
741
|
+
] });
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
)
|
|
745
|
+
] })
|
|
746
|
+
] });
|
|
747
|
+
const renderTypeTab = () => /* @__PURE__ */ jsxs3(
|
|
748
|
+
"div",
|
|
749
|
+
{
|
|
750
|
+
className: "grid w-full gap-6",
|
|
751
|
+
"data-testid": "attribute-form-type-tab",
|
|
752
|
+
children: [
|
|
753
|
+
/* @__PURE__ */ jsx3(
|
|
754
|
+
Form.Field,
|
|
755
|
+
{
|
|
756
|
+
control: form.control,
|
|
757
|
+
name: "ui_component",
|
|
758
|
+
render: ({ field }) => /* @__PURE__ */ jsxs3(Form.Item, { "data-testid": "attribute-form-ui-component-field", children: [
|
|
759
|
+
/* @__PURE__ */ jsx3(Form.Label, { "data-testid": "attribute-form-ui-component-label", children: t("attributes.fields.type", "Type") }),
|
|
760
|
+
/* @__PURE__ */ jsx3(Form.Control, { "data-testid": "attribute-form-ui-component-control", children: /* @__PURE__ */ jsxs3(
|
|
761
|
+
Select,
|
|
762
|
+
{
|
|
763
|
+
value: field.value,
|
|
764
|
+
onValueChange: field.onChange,
|
|
765
|
+
"data-testid": "attribute-form-ui-component-select",
|
|
766
|
+
children: [
|
|
767
|
+
/* @__PURE__ */ jsx3(
|
|
768
|
+
Select.Trigger,
|
|
769
|
+
{
|
|
770
|
+
className: "mt-1",
|
|
771
|
+
"data-testid": "attribute-form-ui-component-trigger",
|
|
772
|
+
children: /* @__PURE__ */ jsx3(
|
|
773
|
+
Select.Value,
|
|
774
|
+
{
|
|
775
|
+
placeholder: t(
|
|
776
|
+
"attributes.fields.typePlaceholder",
|
|
777
|
+
"Select Type"
|
|
778
|
+
)
|
|
779
|
+
}
|
|
780
|
+
)
|
|
781
|
+
}
|
|
782
|
+
),
|
|
783
|
+
/* @__PURE__ */ jsx3(Select.Content, { "data-testid": "attribute-form-ui-component-content", children: Object.values(AttributeUIComponent).map((component) => /* @__PURE__ */ jsx3(
|
|
784
|
+
Select.Item,
|
|
785
|
+
{
|
|
786
|
+
value: component,
|
|
787
|
+
"data-testid": `attribute-form-ui-component-option-${component}`,
|
|
788
|
+
children: UI_COMPONENT_LABELS[component] ?? component
|
|
789
|
+
},
|
|
790
|
+
component
|
|
791
|
+
)) })
|
|
792
|
+
]
|
|
793
|
+
}
|
|
794
|
+
) }),
|
|
795
|
+
/* @__PURE__ */ jsx3(Form.ErrorMessage, { "data-testid": "attribute-form-ui-component-error" })
|
|
796
|
+
] })
|
|
797
|
+
}
|
|
798
|
+
),
|
|
799
|
+
(uiComponent === AttributeUIComponent.SELECT || uiComponent === AttributeUIComponent.MULTIVALUE) && /* @__PURE__ */ jsx3(InlineTip, { label: "Tip", variant: "info", children: uiComponent === AttributeUIComponent.SELECT ? t(
|
|
800
|
+
"attributes.tips.singleSelect",
|
|
801
|
+
"When creating Single Select vendor will be able to choose only one value. This type of attribute will be good for product specifications."
|
|
802
|
+
) : t(
|
|
803
|
+
"attributes.tips.multiSelect",
|
|
804
|
+
"When creating Multi Select vendor will be able to choose multiple values."
|
|
805
|
+
) }),
|
|
806
|
+
(uiComponent === AttributeUIComponent.SELECT || uiComponent === AttributeUIComponent.MULTIVALUE) && /* @__PURE__ */ jsx3("div", { "data-testid": "attribute-form-possible-values-section", children: /* @__PURE__ */ jsx3(PossibleValuesList, {}) })
|
|
807
|
+
]
|
|
808
|
+
}
|
|
809
|
+
);
|
|
810
|
+
return /* @__PURE__ */ jsx3(FormProvider, { ...form, children: /* @__PURE__ */ jsxs3(
|
|
811
|
+
"form",
|
|
812
|
+
{
|
|
813
|
+
id: "attribute-form",
|
|
814
|
+
onSubmit: handleSubmit,
|
|
815
|
+
"data-testid": "attribute-form",
|
|
816
|
+
children: [
|
|
817
|
+
activeTab === "details" && renderDetailsTab(),
|
|
818
|
+
activeTab === "type" && renderTypeTab()
|
|
819
|
+
]
|
|
820
|
+
}
|
|
821
|
+
) });
|
|
822
|
+
}
|
|
823
|
+
);
|
|
824
|
+
AttributeForm.displayName = "AttributeForm";
|
|
825
|
+
|
|
826
|
+
// src/pages/attributes/attribute-create/attribute-create.tsx
|
|
827
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
828
|
+
var AttributeCreateInner = () => {
|
|
829
|
+
const { t } = useTranslation4();
|
|
830
|
+
const { handleSuccess } = useRouteModal();
|
|
831
|
+
const formRef = useRef2(null);
|
|
832
|
+
const [activeTab, setActiveTab] = useState3("details");
|
|
833
|
+
const [tabStatuses, setTabStatuses] = useState3({
|
|
834
|
+
detailsStatus: "not-started",
|
|
835
|
+
typeStatus: "not-started"
|
|
836
|
+
});
|
|
837
|
+
const { mutateAsync, isPending } = useCreateAttribute();
|
|
838
|
+
const { product_categories: categories = [] } = useProductCategories({
|
|
839
|
+
limit: 999
|
|
840
|
+
});
|
|
841
|
+
const handleSave = async (data) => {
|
|
842
|
+
await mutateAsync(data, {
|
|
843
|
+
onSuccess: () => {
|
|
844
|
+
toast.success(
|
|
845
|
+
t("attributes.create.successToast", {
|
|
846
|
+
name: data.name
|
|
847
|
+
})
|
|
848
|
+
);
|
|
849
|
+
handleSuccess("/settings/attributes");
|
|
850
|
+
},
|
|
851
|
+
onError: (error) => {
|
|
852
|
+
toast.error(error.message);
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
};
|
|
856
|
+
const handleTabChange = (value) => {
|
|
857
|
+
const newTab = value;
|
|
858
|
+
if (newTab === "type" && tabStatuses.detailsStatus === "not-started") {
|
|
859
|
+
toast.warning(
|
|
860
|
+
t(
|
|
861
|
+
"attributes.create.fillNameWarning",
|
|
862
|
+
"Please fill in the name first."
|
|
863
|
+
)
|
|
864
|
+
);
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
setActiveTab(newTab);
|
|
868
|
+
};
|
|
869
|
+
const handleNext = async () => {
|
|
870
|
+
if (formRef.current) {
|
|
871
|
+
const isValid = await formRef.current.validateFields(["name"]);
|
|
872
|
+
if (isValid) {
|
|
873
|
+
setActiveTab("type");
|
|
874
|
+
}
|
|
875
|
+
} else {
|
|
876
|
+
setActiveTab("type");
|
|
877
|
+
}
|
|
878
|
+
};
|
|
879
|
+
return /* @__PURE__ */ jsxs4(
|
|
880
|
+
ProgressTabs,
|
|
881
|
+
{
|
|
882
|
+
value: activeTab,
|
|
883
|
+
onValueChange: handleTabChange,
|
|
884
|
+
className: "flex size-full flex-col overflow-hidden",
|
|
885
|
+
"data-testid": "attribute-create-progress-tabs",
|
|
886
|
+
children: [
|
|
887
|
+
/* @__PURE__ */ jsx4(
|
|
888
|
+
RouteFocusModal.Header,
|
|
889
|
+
{
|
|
890
|
+
"data-testid": "attribute-create-modal-header",
|
|
891
|
+
children: /* @__PURE__ */ jsxs4(
|
|
892
|
+
ProgressTabs.List,
|
|
893
|
+
{
|
|
894
|
+
className: "justify-start flex w-full items-center",
|
|
895
|
+
"data-testid": "attribute-create-progress-tabs-list",
|
|
896
|
+
children: [
|
|
897
|
+
/* @__PURE__ */ jsx4(
|
|
898
|
+
ProgressTabs.Trigger,
|
|
899
|
+
{
|
|
900
|
+
value: "details",
|
|
901
|
+
status: tabStatuses.detailsStatus,
|
|
902
|
+
"data-testid": "attribute-create-details-tab",
|
|
903
|
+
children: t("attributes.create.tabs.details", "Details")
|
|
904
|
+
}
|
|
905
|
+
),
|
|
906
|
+
/* @__PURE__ */ jsx4(
|
|
907
|
+
ProgressTabs.Trigger,
|
|
908
|
+
{
|
|
909
|
+
value: "type",
|
|
910
|
+
status: tabStatuses.typeStatus,
|
|
911
|
+
"data-testid": "attribute-create-type-tab",
|
|
912
|
+
children: t("attributes.create.tabs.type", "Type")
|
|
913
|
+
}
|
|
914
|
+
)
|
|
915
|
+
]
|
|
916
|
+
}
|
|
917
|
+
)
|
|
918
|
+
}
|
|
919
|
+
),
|
|
920
|
+
/* @__PURE__ */ jsx4(
|
|
921
|
+
RouteFocusModal.Body,
|
|
922
|
+
{
|
|
923
|
+
className: "flex flex-1 justify-center overflow-auto px-6 py-16",
|
|
924
|
+
"data-testid": "attribute-create-modal-body",
|
|
925
|
+
children: /* @__PURE__ */ jsxs4("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
|
|
926
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-1", children: [
|
|
927
|
+
/* @__PURE__ */ jsx4(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx4(Heading, { "data-testid": "attribute-create-modal-heading", children: t("attributes.create.header", "Create Attribute") }) }),
|
|
928
|
+
/* @__PURE__ */ jsx4(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx4(
|
|
929
|
+
Text3,
|
|
930
|
+
{
|
|
931
|
+
size: "small",
|
|
932
|
+
className: "text-ui-fg-subtle",
|
|
933
|
+
"data-testid": "attribute-create-modal-subtitle",
|
|
934
|
+
children: t(
|
|
935
|
+
"attributes.create.subtitle",
|
|
936
|
+
"Define a new product attribute."
|
|
937
|
+
)
|
|
938
|
+
}
|
|
939
|
+
) })
|
|
940
|
+
] }),
|
|
941
|
+
/* @__PURE__ */ jsx4(
|
|
942
|
+
AttributeForm,
|
|
943
|
+
{
|
|
944
|
+
ref: formRef,
|
|
945
|
+
onSubmit: handleSave,
|
|
946
|
+
categories,
|
|
947
|
+
mode: "create",
|
|
948
|
+
activeTab,
|
|
949
|
+
onFormStateChange: setTabStatuses
|
|
950
|
+
}
|
|
951
|
+
)
|
|
952
|
+
] })
|
|
953
|
+
}
|
|
954
|
+
),
|
|
955
|
+
/* @__PURE__ */ jsx4(RouteFocusModal.Footer, { "data-testid": "attribute-create-modal-footer", children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-end gap-2", children: [
|
|
956
|
+
/* @__PURE__ */ jsx4(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx4(
|
|
957
|
+
Button2,
|
|
958
|
+
{
|
|
959
|
+
size: "small",
|
|
960
|
+
variant: "secondary",
|
|
961
|
+
type: "button",
|
|
962
|
+
"data-testid": "attribute-create-modal-cancel-button",
|
|
963
|
+
children: t("actions.cancel", "Cancel")
|
|
964
|
+
}
|
|
965
|
+
) }),
|
|
966
|
+
activeTab === "details" ? /* @__PURE__ */ jsx4(
|
|
967
|
+
Button2,
|
|
968
|
+
{
|
|
969
|
+
size: "small",
|
|
970
|
+
type: "button",
|
|
971
|
+
onClick: handleNext,
|
|
972
|
+
"data-testid": "attribute-create-modal-next-button",
|
|
973
|
+
children: t("actions.continue", "Next")
|
|
974
|
+
}
|
|
975
|
+
) : /* @__PURE__ */ jsx4(
|
|
976
|
+
Button2,
|
|
977
|
+
{
|
|
978
|
+
size: "small",
|
|
979
|
+
type: "submit",
|
|
980
|
+
form: "attribute-form",
|
|
981
|
+
isLoading: isPending,
|
|
982
|
+
"data-testid": "attribute-create-modal-save-button",
|
|
983
|
+
children: t("actions.save", "Save")
|
|
984
|
+
}
|
|
985
|
+
)
|
|
986
|
+
] }) })
|
|
987
|
+
]
|
|
988
|
+
}
|
|
989
|
+
);
|
|
990
|
+
};
|
|
991
|
+
var AttributeCreate = () => {
|
|
992
|
+
return /* @__PURE__ */ jsx4(RouteFocusModal, { "data-testid": "attribute-create-modal", children: /* @__PURE__ */ jsx4(AttributeCreateInner, {}) });
|
|
993
|
+
};
|
|
994
|
+
export {
|
|
995
|
+
AttributeCreate as Component
|
|
996
|
+
};
|