@mercurjs/admin 2.2.0-canary.36 → 2.2.0-canary.38
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-OTLO4M5C.js → add-campaign-promotions-FWYK3JCR.js} +4 -4
- package/dist/{api-key-management-list-RLATJRDL.js → api-key-management-list-SXHZJUJB.js} +2 -2
- package/dist/{attribute-detail-G6APXXFT.js → attribute-detail-7EBAQ26V.js} +1 -1
- package/dist/{attribute-list-42GDF2PV.js → attribute-list-G73VHMFA.js} +2 -2
- package/dist/{campaign-detail-GZV2HK2G.js → campaign-detail-I6KGCHUL.js} +5 -5
- package/dist/{campaign-list-W2YZAPUI.js → campaign-list-FFGRXEVJ.js} +2 -2
- package/dist/{category-create-7UTOSFO5.js → category-create-AIS2MG7E.js} +2 -2
- package/dist/{category-detail-AYVW7LRB.js → category-detail-ZEOXQF7F.js} +3 -3
- package/dist/{category-icon-edit-FMVPTC27.js → category-icon-edit-W2TPCSDC.js} +1 -1
- package/dist/{category-list-B6B3ZANX.js → category-list-7ILXI55P.js} +3 -3
- package/dist/{category-media-4SLUTBZS.js → category-media-PC4V7YU4.js} +1 -1
- package/dist/{category-products-IF33PO5Y.js → category-products-UFKHB7YL.js} +2 -1
- package/dist/{chunk-QM343PBJ.js → chunk-23OLYWMR.js} +1 -1
- package/dist/{chunk-E6VCLJNF.js → chunk-2DSCC2VR.js} +1 -1
- package/dist/{chunk-BW5MMF6W.js → chunk-2S2SBRZP.js} +3 -3
- package/dist/{chunk-L4KT5CLI.js → chunk-2YAVXVET.js} +1 -1
- package/dist/{chunk-PPMWEQP3.js → chunk-3OD3YOA3.js} +71 -34
- package/dist/{chunk-XQCG2ORD.js → chunk-45O5MFCT.js} +1 -1
- package/dist/{chunk-C4N5EJAD.js → chunk-4BCUGMOR.js} +0 -13
- package/dist/{chunk-P4GIBTTG.js → chunk-5BSSIDW6.js} +1 -1
- package/dist/{chunk-BWRQJXHB.js → chunk-5DQED4UT.js} +1 -1
- package/dist/{chunk-U725ING6.js → chunk-5NC6SI6J.js} +1 -1
- package/dist/{chunk-OLAOEVZE.js → chunk-6FNIEKSN.js} +4 -4
- package/dist/{chunk-CA4K6JDJ.js → chunk-72SDBLWQ.js} +1 -1
- package/dist/{chunk-57MFJ2HE.js → chunk-74WEDBZ7.js} +1 -1
- package/dist/{chunk-57GNGL6K.js → chunk-7RWFRMQG.js} +1 -1
- package/dist/{chunk-TRXFVQXD.js → chunk-BLR3NTU6.js} +1 -1
- package/dist/{chunk-FU3QYH6H.js → chunk-CB7DBYH4.js} +1 -13
- package/dist/{chunk-6YEU2ZAD.js → chunk-CE2WRTS7.js} +1 -1
- package/dist/{chunk-TYXSRH47.js → chunk-CIKPTKSX.js} +14 -4
- package/dist/{chunk-R3YD5UOZ.js → chunk-CU4UVEHX.js} +36 -1
- package/dist/{chunk-HLUWC7C3.js → chunk-CY263OE4.js} +1 -1
- package/dist/{chunk-YAOYZQDK.js → chunk-CYACZXMQ.js} +2 -2
- package/dist/{chunk-YAJDG3W7.js → chunk-DI2KBXVH.js} +1 -1
- package/dist/{chunk-YLQCULOV.js → chunk-DISTPZNS.js} +1 -1
- package/dist/{chunk-V7YJ53P5.js → chunk-EJYLSQVT.js} +1 -1
- package/dist/{chunk-GQUGCSJV.js → chunk-F6NPDZHW.js} +1 -1
- package/dist/{chunk-N5H2J6HE.js → chunk-FBDAKD4B.js} +1 -1
- package/dist/{chunk-WEWBHUEB.js → chunk-GUDWUAMT.js} +2 -2
- package/dist/{chunk-SJHBNENS.js → chunk-HSL5IICN.js} +15 -6
- package/dist/{chunk-MHCIHDGF.js → chunk-HWWET5ZP.js} +1 -1
- package/dist/{chunk-5YWQDIVG.js → chunk-I3ARNGRC.js} +1 -1
- package/dist/{chunk-EMW5WXXR.js → chunk-IQDZZ5EQ.js} +1 -1
- package/dist/{chunk-HMKXCYCJ.js → chunk-IRX6RBTE.js} +7 -2
- package/dist/{chunk-YRGPQ2C4.js → chunk-JUMT5GX7.js} +1 -1
- package/dist/{chunk-HHW4PPNH.js → chunk-JXSXBSV6.js} +8 -1
- package/dist/{chunk-AQIW7R4Y.js → chunk-KC4J2WOM.js} +1 -1
- package/dist/{chunk-WMVLWFFU.js → chunk-KRECA22N.js} +59 -52
- package/dist/{chunk-DP3OBKUP.js → chunk-LRJNSCMR.js} +2 -2
- package/dist/{chunk-U5MDOZS7.js → chunk-MANRAV52.js} +1 -1
- package/dist/{chunk-4NE4EIHO.js → chunk-MYJJMHR5.js} +1 -1
- package/dist/{chunk-3OZRK7TN.js → chunk-NEGOGYEO.js} +1 -1
- package/dist/{chunk-MIKJRLQI.js → chunk-NKV5XPNS.js} +1 -1
- package/dist/{chunk-ENSI7NL7.js → chunk-O5MW4WPZ.js} +1 -1
- package/dist/{chunk-RZ43M34Q.js → chunk-PNZI5C5A.js} +2 -2
- package/dist/{chunk-4X4MNAXL.js → chunk-PWLDTJJX.js} +1 -1
- package/dist/{chunk-NX3YQW2B.js → chunk-Q4R2O7XF.js} +2 -2
- package/dist/{chunk-GJB4UQZI.js → chunk-QAWWIM4I.js} +2 -2
- package/dist/{chunk-AHUVAYZD.js → chunk-QH34LF36.js} +1 -1
- package/dist/{chunk-LECZPR6R.js → chunk-QJCUPZZQ.js} +4 -2
- package/dist/{chunk-GML7DINQ.js → chunk-RDUSAVT3.js} +1 -1
- package/dist/{chunk-LRKN7IQH.js → chunk-RNDDYLHV.js} +1 -1
- package/dist/{chunk-EA3XMVOS.js → chunk-S22SK4KO.js} +1 -1
- package/dist/{chunk-PQAQM6SB.js → chunk-SIOKPEVN.js} +1 -1
- package/dist/{chunk-QEXIOKNZ.js → chunk-SLKOHWKT.js} +1 -1
- package/dist/{chunk-AIEPAHO5.js → chunk-TAM24IMD.js} +1 -1
- package/dist/{chunk-T2WVIET2.js → chunk-VM56ZITS.js} +4 -2
- package/dist/{chunk-IHERG3JP.js → chunk-VPPUFVFJ.js} +21 -20
- package/dist/{chunk-GCYUOP4W.js → chunk-VSKHV5QF.js} +1 -1
- package/dist/{chunk-DUVTXDNA.js → chunk-XFKDDRB6.js} +1 -1
- package/dist/{chunk-ZMSQW2M3.js → chunk-Y5JQAKX7.js} +90 -43
- package/dist/{chunk-R6DVBI5F.js → chunk-Y62TJJ3P.js} +2 -2
- package/dist/{chunk-CDVQK7JZ.js → chunk-YNK25LVO.js} +1 -1
- package/dist/{chunk-MTOPGOKU.js → chunk-ZHT3Y47H.js} +2 -2
- package/dist/{chunk-OB5RWOGA.js → chunk-ZPEMWHUW.js} +1 -1
- package/dist/{collection-add-products-2G37ZL2J.js → collection-add-products-MJYMPNLP.js} +1 -1
- package/dist/{collection-create-T6HBO4LU.js → collection-create-5IGFVQKE.js} +1 -1
- package/dist/{collection-detail-PMSYCWE3.js → collection-detail-C4ZCH55B.js} +3 -3
- package/dist/{collection-icon-edit-VZP3W6AZ.js → collection-icon-edit-WCSKUDXE.js} +1 -1
- package/dist/{collection-list-EK2TBM3J.js → collection-list-4UX2LLQV.js} +5 -5
- package/dist/{collection-media-3Z2RJDVG.js → collection-media-YIV5BV3Y.js} +1 -1
- package/dist/{commission-rule-commission-edit-6675TZCZ.js → commission-rule-commission-edit-EXLLNUKM.js} +19 -4
- package/dist/{commission-rule-create-PEYCFGCW.js → commission-rule-create-3MCNOSWN.js} +9 -28
- package/dist/{commission-rule-edit-GCI67KZU.js → commission-rule-edit-X45EQ6BK.js} +24 -1
- package/dist/{commissions-list-KQ2TUJAW.js → commissions-list-MZY7KOP5.js} +2 -2
- package/dist/{customer-detail-ZYJDB47Y.js → customer-detail-FRGVVWTZ.js} +3 -3
- package/dist/{customer-group-add-customers-GSEUGBTJ.js → customer-group-add-customers-QBRVKXGO.js} +1 -1
- package/dist/{customer-group-detail-5VSUJTR3.js → customer-group-detail-KIC2TWZ3.js} +2 -2
- package/dist/{customer-group-list-BRQRKORR.js → customer-group-list-BRH6SWRD.js} +2 -2
- package/dist/{customer-list-6PRFTWMO.js → customer-list-276YPXTE.js} +2 -2
- package/dist/{customers-add-customer-group-56GS7TR7.js → customers-add-customer-group-C4Y6P45C.js} +1 -1
- package/dist/{global-commission-edit-AOZ6XLH7.js → global-commission-edit-7ZMMIV7B.js} +19 -12
- package/dist/index.css +5184 -3
- package/dist/index.d.ts +7 -1
- package/dist/index.js +111 -111
- package/dist/{inventory-create-HOQVSL2G.js → inventory-create-M3YBQVNG.js} +2 -2
- package/dist/{inventory-detail-QY56I2KX.js → inventory-detail-6PAVKSOK.js} +2 -2
- package/dist/{inventory-list-AB4OHYMU.js → inventory-list-U4W4AP4E.js} +2 -2
- package/dist/{inventory-stock-E4U2SS3Z.js → inventory-stock-XQWWFVQ3.js} +1 -1
- package/dist/{location-fulfillment-providers-VVJGPYJI.js → location-fulfillment-providers-Z3PR4MQI.js} +2 -2
- package/dist/{location-service-zone-create-WPSYG3NX.js → location-service-zone-create-U77V3ROT.js} +2 -2
- package/dist/{location-service-zone-manage-areas-ZH2ICSC7.js → location-service-zone-manage-areas-FUUAAIDJ.js} +2 -2
- package/dist/{location-service-zone-shipping-option-create-K6USZASG.js → location-service-zone-shipping-option-create-NFKZT2HM.js} +3 -3
- package/dist/{location-service-zone-shipping-option-pricing-ZENGURN3.js → location-service-zone-shipping-option-pricing-UZ577SNK.js} +2 -2
- package/dist/{marketplace-add-currencies-FPDYEYCL.js → marketplace-add-currencies-KDNMN57C.js} +1 -1
- package/dist/{marketplace-detail-7WGPHRQM.js → marketplace-detail-X5AQWO7P.js} +2 -2
- package/dist/{offer-detail-page-3RAFKFK4.js → offer-detail-page-4GNU35AH.js} +2 -2
- package/dist/{offer-variant-detail-page-5FS6D46I.js → offer-variant-detail-page-FFPV7N7Y.js} +2 -2
- package/dist/{offers-T4ARWA47.js → offers-3HP7SICL.js} +1 -1
- package/dist/{order-create-claim-GOP565XH.js → order-create-claim-MEXSDGHW.js} +1 -1
- package/dist/{order-create-edit-DK4QG2CR.js → order-create-edit-M2F6CG3M.js} +1 -1
- package/dist/{order-create-exchange-ZHJ3T5QJ.js → order-create-exchange-HTWFKJOM.js} +1 -1
- package/dist/{order-create-return-63X5PUTT.js → order-create-return-DDOYLDT7.js} +1 -1
- package/dist/{order-detail-6UAWPZI2.js → order-detail-QYZGM7OO.js} +2 -2
- package/dist/{order-edit-billing-address-WQYQSLDB.js → order-edit-billing-address-JHJ7PCPC.js} +1 -1
- package/dist/{order-list-FFPY5OGR.js → order-list-5PVFAFJT.js} +3 -3
- package/dist/pages/index.js +59 -59
- package/dist/{payout-list-A2KQTZMZ.js → payout-list-SOWVPSFQ.js} +2 -2
- package/dist/{price-list-configuration-2NFE4MNW.js → price-list-configuration-BIHWXMYS.js} +2 -2
- package/dist/{price-list-create-QEDMB4A6.js → price-list-create-XV6OY4A2.js} +5 -5
- package/dist/{price-list-detail-7ANY3XOC.js → price-list-detail-IUZU5OA7.js} +2 -2
- package/dist/{price-list-list-6II3XYUA.js → price-list-list-A42VGE3L.js} +2 -2
- package/dist/{price-list-prices-add-GVOZDWKE.js → price-list-prices-add-KUBO4DCC.js} +4 -4
- package/dist/{price-list-prices-edit-LNSUSN4V.js → price-list-prices-edit-PJ4CPB5I.js} +2 -2
- package/dist/{product-bulk-edit-34KKEPJQ.js → product-bulk-edit-TRI2KKHW.js} +1 -1
- package/dist/{product-create-STXNKMAV.js → product-create-EGL6UJKX.js} +4 -4
- package/dist/{product-detail-T4FOYZK7.js → product-detail-SNS2DQ6Q.js} +2 -2
- package/dist/{product-list-SIQDX4AT.js → product-list-LGS3O2OJ.js} +2 -2
- package/dist/{product-media-JFLRNBPR.js → product-media-JKUDYI32.js} +2 -2
- package/dist/{product-organization-SGLOMAKK.js → product-organization-AIM3LNQ6.js} +1 -1
- package/dist/{product-tag-detail-ZV7V7UW3.js → product-tag-detail-MI7B2MPH.js} +5 -5
- package/dist/{product-tag-list-SZHBD5FA.js → product-tag-list-7CE4KJ3G.js} +5 -5
- package/dist/{product-type-detail-WSHUE56F.js → product-type-detail-O2WGGFRT.js} +2 -2
- package/dist/{product-type-list-EP2YCYLK.js → product-type-list-XTVTT7ZA.js} +2 -2
- package/dist/{promotion-detail-AWVF7JHY.js → promotion-detail-WFB2ZFPH.js} +3 -3
- package/dist/{promotion-list-INBZ3OG3.js → promotion-list-VLCRCI2K.js} +5 -5
- package/dist/{refund-reason-list-UCZC5ASP.js → refund-reason-list-XMDZO34F.js} +2 -2
- package/dist/{region-add-countries-NFJYG4JA.js → region-add-countries-IIHNNE76.js} +1 -1
- package/dist/{region-create-RW42MXKY.js → region-create-PHZNUCJR.js} +1 -1
- package/dist/{region-detail-S7GNXX5B.js → region-detail-AECQQ62I.js} +2 -2
- package/dist/{region-list-ZP7QIWQ3.js → region-list-IBQW5J3R.js} +2 -2
- package/dist/{reservation-list-UGXB2P7K.js → reservation-list-IUYMT4U6.js} +2 -2
- package/dist/{reset-password-ZJW3AHYT.js → reset-password-OL6EA5F2.js} +1 -1
- package/dist/{return-reason-list-AJ4E3A56.js → return-reason-list-FRHFRNKK.js} +4 -4
- package/dist/{sales-channel-add-products-LRANEISZ.js → sales-channel-add-products-ZZPVF5CH.js} +1 -1
- package/dist/{sales-channel-detail-5XXO3BXP.js → sales-channel-detail-DNZXUBSN.js} +2 -2
- package/dist/{shipping-option-type-list-UCTCZPAM.js → shipping-option-type-list-AW2ZA4V5.js} +2 -2
- package/dist/{shipping-profiles-list-CBTZYI33.js → shipping-profiles-list-4VHKTKIL.js} +2 -2
- package/dist/{store-bulk-edit-5DZ7RZS3.js → store-bulk-edit-SZ3UEDWJ.js} +1 -1
- package/dist/{store-details-XNBFIWDL.js → store-details-4XVEWNIX.js} +3 -3
- package/dist/{store-edit-6KKEQZRH.js → store-edit-KJTO3ZUP.js} +2 -2
- package/dist/{store-list-RVZG3UD3.js → store-list-LSADPRI2.js} +3 -3
- package/dist/{tax-region-create-GAXLHDV5.js → tax-region-create-MPKY5KXL.js} +1 -1
- package/dist/{tax-region-tax-override-create-XOBU6DOL.js → tax-region-tax-override-create-X3WQVHYV.js} +5 -5
- package/dist/{tax-region-tax-override-edit-PEQJFCOU.js → tax-region-tax-override-edit-SYK2O5BK.js} +5 -5
- package/dist/{user-invite-WIHSREOW.js → user-invite-UN6NCCII.js} +1 -1
- package/dist/{user-list-3C6GRWMJ.js → user-list-27ZKEJXN.js} +2 -2
- package/package.json +9 -6
|
@@ -43,7 +43,7 @@ var useOrderGroupTableFilters = () => {
|
|
|
43
43
|
if (sellers?.length) {
|
|
44
44
|
filters.push({
|
|
45
45
|
key: "seller_id",
|
|
46
|
-
label: "
|
|
46
|
+
label: t("fields.store"),
|
|
47
47
|
type: "select",
|
|
48
48
|
multiple: true,
|
|
49
49
|
searchable: true,
|
|
@@ -78,18 +78,6 @@ var useOrderGroupTableFilters = () => {
|
|
|
78
78
|
{ label: "Requires action", value: "requires_action" }
|
|
79
79
|
]
|
|
80
80
|
});
|
|
81
|
-
filters.push({
|
|
82
|
-
key: "request",
|
|
83
|
-
label: t("orders.filters.request.label"),
|
|
84
|
-
type: "select",
|
|
85
|
-
multiple: true,
|
|
86
|
-
options: [
|
|
87
|
-
{ label: t("orders.filters.request.edit"), value: "edit" },
|
|
88
|
-
{ label: t("orders.filters.request.return"), value: "return" },
|
|
89
|
-
{ label: t("orders.filters.request.exchange"), value: "exchange" },
|
|
90
|
-
{ label: t("orders.filters.request.claim"), value: "claim" }
|
|
91
|
-
]
|
|
92
|
-
});
|
|
93
81
|
filters.push(
|
|
94
82
|
{
|
|
95
83
|
key: "created_at",
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-AJLGY3LQ.js";
|
|
4
4
|
import {
|
|
5
5
|
i18n
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VPPUFVFJ.js";
|
|
7
7
|
import {
|
|
8
8
|
require_dist
|
|
9
9
|
} from "./chunk-YZBEJ3CY.js";
|
|
@@ -220,7 +220,9 @@ var ProductCreateVariantSchema = z.object({
|
|
|
220
220
|
variant_rank: z.number()
|
|
221
221
|
});
|
|
222
222
|
var ProductCreateSchema = z.object({
|
|
223
|
-
title: z.string().min(1
|
|
223
|
+
title: z.string().min(1, {
|
|
224
|
+
message: i18n.t("products.create.errors.requiredTitle")
|
|
225
|
+
}),
|
|
224
226
|
subtitle: z.string().optional(),
|
|
225
227
|
handle: z.string().optional(),
|
|
226
228
|
description: z.string().optional(),
|
|
@@ -228,7 +230,7 @@ var ProductCreateSchema = z.object({
|
|
|
228
230
|
globally_available: z.boolean(),
|
|
229
231
|
type_id: z.string().optional(),
|
|
230
232
|
collection_id: z.string().optional(),
|
|
231
|
-
category_id: z.string().min(1),
|
|
233
|
+
category_id: z.string().min(1, i18n.t("products.create.errors.requiredCategory")),
|
|
232
234
|
seller_ids: z.array(z.string()).optional(),
|
|
233
235
|
tags: z.array(z.string()).optional(),
|
|
234
236
|
origin_country: z.string().optional(),
|
|
@@ -266,10 +268,18 @@ var ProductCreateSchema = z.object({
|
|
|
266
268
|
if (!attr.is_required) return;
|
|
267
269
|
const isEmpty = attr.values === void 0 || attr.values === "" || Array.isArray(attr.values) && attr.values.length === 0;
|
|
268
270
|
if (isEmpty) {
|
|
271
|
+
let messageKey = "products.create.errors.requiredAttribute";
|
|
272
|
+
if (attr.type === "single_select" || attr.type === "toggle") {
|
|
273
|
+
messageKey = "products.create.errors.requiredAttributeSelect";
|
|
274
|
+
} else if (attr.type === "multi_select") {
|
|
275
|
+
messageKey = "products.create.errors.requiredAttributeMultiSelect";
|
|
276
|
+
} else if (attr.type === "text" || attr.type === "unit") {
|
|
277
|
+
messageKey = "products.create.errors.requiredAttributeEnter";
|
|
278
|
+
}
|
|
269
279
|
ctx.addIssue({
|
|
270
280
|
code: z.ZodIssueCode.custom,
|
|
271
281
|
path: [`attributes.${index}.values`],
|
|
272
|
-
message: i18n.t(
|
|
282
|
+
message: i18n.t(messageKey)
|
|
273
283
|
});
|
|
274
284
|
}
|
|
275
285
|
});
|
|
@@ -80,7 +80,42 @@ var CommissionValueFields = ({
|
|
|
80
80
|
] });
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
// src/pages/commissions/common/schema.ts
|
|
84
|
+
import i18n from "i18next";
|
|
85
|
+
import * as zod from "zod";
|
|
86
|
+
var optionalAmount = zod.preprocess((val) => {
|
|
87
|
+
if (val === "" || val === null || val === void 0) {
|
|
88
|
+
return void 0;
|
|
89
|
+
}
|
|
90
|
+
const parsed = typeof val === "number" ? val : Number(val);
|
|
91
|
+
return Number.isNaN(parsed) ? void 0 : parsed;
|
|
92
|
+
}, zod.number().optional());
|
|
93
|
+
var addCommissionValueIssues = (ctx, { type, value, fixedValues, currencies = [] }) => {
|
|
94
|
+
if (type === "percentage") {
|
|
95
|
+
if (value === void 0 || Number.isNaN(value)) {
|
|
96
|
+
ctx.addIssue({
|
|
97
|
+
code: zod.ZodIssueCode.custom,
|
|
98
|
+
path: ["value"],
|
|
99
|
+
message: i18n.t("commissions.validation.value")
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
currencies.forEach((code) => {
|
|
105
|
+
const amount = fixedValues?.[code];
|
|
106
|
+
if (amount === void 0 || Number.isNaN(amount)) {
|
|
107
|
+
ctx.addIssue({
|
|
108
|
+
code: zod.ZodIssueCode.custom,
|
|
109
|
+
path: ["fixed_values", code],
|
|
110
|
+
message: i18n.t("commissions.validation.value")
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
|
|
83
116
|
export {
|
|
84
117
|
useStoreCurrencies,
|
|
85
|
-
CommissionValueFields
|
|
118
|
+
CommissionValueFields,
|
|
119
|
+
optionalAmount,
|
|
120
|
+
addCommissionValueIssues
|
|
86
121
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCollectionTableColumns
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5BSSIDW6.js";
|
|
4
4
|
import {
|
|
5
5
|
useCollectionTableFilters
|
|
6
6
|
} from "./chunk-KOURHC2N.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
_DataTable,
|
|
12
12
|
useDataTable
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-HSL5IICN.js";
|
|
14
14
|
import {
|
|
15
15
|
SingleColumnPage
|
|
16
16
|
} from "./chunk-H6MYB7GB.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-Y456KVIN.js";
|
|
13
13
|
import {
|
|
14
14
|
getCategoryGallery
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QJCUPZZQ.js";
|
|
16
16
|
import {
|
|
17
17
|
StatusCell
|
|
18
18
|
} from "./chunk-DB6ANJBO.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
_DataTable,
|
|
24
24
|
useDataTable
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-HSL5IICN.js";
|
|
26
26
|
import {
|
|
27
27
|
SingleColumnPage
|
|
28
28
|
} from "./chunk-H6MYB7GB.js";
|
|
@@ -1113,9 +1113,10 @@ var DataTableQuery = ({
|
|
|
1113
1113
|
orderBy,
|
|
1114
1114
|
defaultOrder,
|
|
1115
1115
|
filters,
|
|
1116
|
-
prefix
|
|
1116
|
+
prefix,
|
|
1117
|
+
toolbarActions
|
|
1117
1118
|
}) => {
|
|
1118
|
-
return (search || orderBy || filters || prefix) && /* @__PURE__ */ jsxs7("div", { className: "flex items-start justify-between gap-x-4 px-6 py-4", children: [
|
|
1119
|
+
return (search || orderBy || filters || prefix || toolbarActions) && /* @__PURE__ */ jsxs7("div", { className: "flex items-start justify-between gap-x-4 px-6 py-4", children: [
|
|
1119
1120
|
/* @__PURE__ */ jsx7("div", { className: "w-full max-w-[60%]", children: filters && filters.length > 0 && /* @__PURE__ */ jsx7(DataTableFilter, { filters, prefix }) }),
|
|
1120
1121
|
/* @__PURE__ */ jsxs7("div", { className: "flex shrink-0 items-center gap-x-2", children: [
|
|
1121
1122
|
search && /* @__PURE__ */ jsx7(
|
|
@@ -1132,7 +1133,8 @@ var DataTableQuery = ({
|
|
|
1132
1133
|
prefix,
|
|
1133
1134
|
defaultOrder
|
|
1134
1135
|
}
|
|
1135
|
-
)
|
|
1136
|
+
),
|
|
1137
|
+
toolbarActions
|
|
1136
1138
|
] })
|
|
1137
1139
|
] });
|
|
1138
1140
|
};
|
|
@@ -1156,6 +1158,7 @@ var DataTableRoot = ({
|
|
|
1156
1158
|
columns,
|
|
1157
1159
|
pagination,
|
|
1158
1160
|
navigateTo,
|
|
1161
|
+
onRowClick,
|
|
1159
1162
|
commands,
|
|
1160
1163
|
count = 0,
|
|
1161
1164
|
noResults = false,
|
|
@@ -1248,6 +1251,7 @@ var DataTableRoot = ({
|
|
|
1248
1251
|
}) }),
|
|
1249
1252
|
/* @__PURE__ */ jsx8(Table.Body, { className: "border-b-0", children: table.getRowModel().rows.map((row) => {
|
|
1250
1253
|
const to = navigateTo ? navigateTo(row) : void 0;
|
|
1254
|
+
const handleRowClick = !to && onRowClick ? () => onRowClick(row) : void 0;
|
|
1251
1255
|
const isRowDisabled = hasSelect && !row.getCanSelect();
|
|
1252
1256
|
const isOdd = row.depth % 2 !== 0;
|
|
1253
1257
|
const cells = row.getVisibleCells();
|
|
@@ -1255,12 +1259,13 @@ var DataTableRoot = ({
|
|
|
1255
1259
|
Table.Row,
|
|
1256
1260
|
{
|
|
1257
1261
|
"data-selected": row.getIsSelected(),
|
|
1262
|
+
onClick: handleRowClick,
|
|
1258
1263
|
className: clx7(
|
|
1259
1264
|
"transition-fg group/row group relative [&_td:last-of-type]:w-[1%] [&_td:last-of-type]:whitespace-nowrap",
|
|
1260
1265
|
"has-[[data-row-link]:focus-visible]:bg-ui-bg-base-hover",
|
|
1261
1266
|
{
|
|
1262
1267
|
"bg-ui-bg-subtle hover:bg-ui-bg-subtle-hover": isOdd,
|
|
1263
|
-
"cursor-pointer": !!to,
|
|
1268
|
+
"cursor-pointer": !!to || !!handleRowClick,
|
|
1264
1269
|
"bg-ui-bg-highlight hover:bg-ui-bg-highlight-hover": row.getIsSelected(),
|
|
1265
1270
|
"!bg-ui-bg-disabled !hover:bg-ui-bg-disabled": isRowDisabled
|
|
1266
1271
|
}
|
|
@@ -1390,6 +1395,7 @@ var _DataTable = ({
|
|
|
1390
1395
|
columns,
|
|
1391
1396
|
pagination,
|
|
1392
1397
|
navigateTo,
|
|
1398
|
+
onRowClick,
|
|
1393
1399
|
commands,
|
|
1394
1400
|
count = 0,
|
|
1395
1401
|
search = false,
|
|
@@ -1402,7 +1408,8 @@ var _DataTable = ({
|
|
|
1402
1408
|
isLoading = false,
|
|
1403
1409
|
noHeader = false,
|
|
1404
1410
|
layout = "fit",
|
|
1405
|
-
noRecords: noRecordsProps = {}
|
|
1411
|
+
noRecords: noRecordsProps = {},
|
|
1412
|
+
toolbarActions
|
|
1406
1413
|
}) => {
|
|
1407
1414
|
if (isLoading) {
|
|
1408
1415
|
return /* @__PURE__ */ jsx9(
|
|
@@ -1445,7 +1452,8 @@ var _DataTable = ({
|
|
|
1445
1452
|
orderBy,
|
|
1446
1453
|
defaultOrder,
|
|
1447
1454
|
filters,
|
|
1448
|
-
prefix
|
|
1455
|
+
prefix,
|
|
1456
|
+
toolbarActions
|
|
1449
1457
|
}
|
|
1450
1458
|
),
|
|
1451
1459
|
/* @__PURE__ */ jsx9(
|
|
@@ -1456,6 +1464,7 @@ var _DataTable = ({
|
|
|
1456
1464
|
columns,
|
|
1457
1465
|
pagination: true,
|
|
1458
1466
|
navigateTo,
|
|
1467
|
+
onRowClick,
|
|
1459
1468
|
commands,
|
|
1460
1469
|
noResults,
|
|
1461
1470
|
noHeader,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-OI4DJXUL.js";
|
|
7
7
|
import {
|
|
8
8
|
useOrderGroupTableFilters
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CB7DBYH4.js";
|
|
10
10
|
import {
|
|
11
11
|
useOrderTableQuery
|
|
12
12
|
} from "./chunk-QUHSHIAC.js";
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
import {
|
|
37
37
|
_DataTable,
|
|
38
38
|
useDataTable
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-HSL5IICN.js";
|
|
40
40
|
import {
|
|
41
41
|
NoRecords
|
|
42
42
|
} from "./chunk-PAYQJPGK.js";
|
|
@@ -626,6 +626,11 @@ var CustomerOrderSection = ({
|
|
|
626
626
|
table,
|
|
627
627
|
pagination: true,
|
|
628
628
|
navigateTo: (row) => row.original._type === "order" ? `/orders/${row.original.id}` : "",
|
|
629
|
+
onRowClick: (row) => {
|
|
630
|
+
if (row.getCanExpand()) {
|
|
631
|
+
row.toggleExpanded();
|
|
632
|
+
}
|
|
633
|
+
},
|
|
629
634
|
count,
|
|
630
635
|
isLoading,
|
|
631
636
|
pageSize: PAGE_SIZE2,
|
|
@@ -3373,8 +3373,15 @@ var DataGridHeader = ({
|
|
|
3373
3373
|
}
|
|
3374
3374
|
)
|
|
3375
3375
|
] }),
|
|
3376
|
-
headerContent,
|
|
3377
3376
|
/* @__PURE__ */ jsxs6("div", { className: "ml-auto flex items-center gap-x-2", children: [
|
|
3377
|
+
headerContent && /* @__PURE__ */ jsx9(
|
|
3378
|
+
"div",
|
|
3379
|
+
{
|
|
3380
|
+
className: "flex items-center",
|
|
3381
|
+
onFocusCapture: () => onHeaderInteractionChange(true),
|
|
3382
|
+
children: headerContent
|
|
3383
|
+
}
|
|
3384
|
+
),
|
|
3378
3385
|
errorCount > 0 && /* @__PURE__ */ jsxs6(
|
|
3379
3386
|
Button2,
|
|
3380
3387
|
{
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
_DataTable,
|
|
18
18
|
useDataTable
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-HSL5IICN.js";
|
|
20
20
|
import {
|
|
21
21
|
useQueryParams
|
|
22
22
|
} from "./chunk-THHRRYRS.js";
|
|
@@ -459,7 +459,6 @@ var ProductActiveRequestSection = ({
|
|
|
459
459
|
|
|
460
460
|
// src/pages/products/product-detail/components/product-attribute-section/product-attribute-section.tsx
|
|
461
461
|
import {
|
|
462
|
-
ListBullet,
|
|
463
462
|
Plus,
|
|
464
463
|
Trash,
|
|
465
464
|
Swatch,
|
|
@@ -531,6 +530,33 @@ var AttributeActions = ({
|
|
|
531
530
|
}
|
|
532
531
|
);
|
|
533
532
|
};
|
|
533
|
+
var AttributeValue = ({
|
|
534
|
+
attribute
|
|
535
|
+
}) => {
|
|
536
|
+
const { t } = useTranslation4();
|
|
537
|
+
const values = attribute.values?.map((v) => v.name) ?? [];
|
|
538
|
+
if (["single_select", "multi_select"].includes(attribute.type)) {
|
|
539
|
+
return /* @__PURE__ */ jsx4("div", { className: "flex flex-wrap gap-1", children: values.map((val) => /* @__PURE__ */ jsx4(
|
|
540
|
+
Badge,
|
|
541
|
+
{
|
|
542
|
+
size: "2xsmall",
|
|
543
|
+
className: "flex min-w-[20px] items-center justify-center",
|
|
544
|
+
children: val
|
|
545
|
+
},
|
|
546
|
+
val
|
|
547
|
+
)) });
|
|
548
|
+
}
|
|
549
|
+
const textValue = attribute.type === "toggle" ? values.map((val) => val === "true" ? t("general.yes") : t("general.no")).join(", ") || "-" : values.join(", ") || "-";
|
|
550
|
+
return /* @__PURE__ */ jsx4(Tooltip, { content: /* @__PURE__ */ jsx4("span", { className: "break-all", children: textValue }), children: /* @__PURE__ */ jsx4(
|
|
551
|
+
Text3,
|
|
552
|
+
{
|
|
553
|
+
size: "small",
|
|
554
|
+
leading: "compact",
|
|
555
|
+
className: "line-clamp-3 min-w-0 break-words text-ui-fg-subtle",
|
|
556
|
+
children: textValue
|
|
557
|
+
}
|
|
558
|
+
) });
|
|
559
|
+
};
|
|
534
560
|
var AttributeGroup = ({
|
|
535
561
|
icon,
|
|
536
562
|
title,
|
|
@@ -551,36 +577,17 @@ var AttributeGroup = ({
|
|
|
551
577
|
] })
|
|
552
578
|
] }),
|
|
553
579
|
/* @__PURE__ */ jsx4("div", { className: "flex flex-col gap-y-0", children: /* @__PURE__ */ jsx4("div", { className: "overflow-hidden rounded-xl border border-ui-border-base", children: attributes.map((attr, index) => {
|
|
554
|
-
const values = attr.values?.map((v) => v.name) ?? [];
|
|
555
580
|
return /* @__PURE__ */ jsx4(
|
|
556
581
|
"div",
|
|
557
582
|
{
|
|
558
583
|
className: index < attributes.length - 1 ? "border-b border-ui-border-base" : "",
|
|
559
|
-
children: /* @__PURE__ */ jsxs4("div", { className: "grid grid-cols-[
|
|
584
|
+
children: /* @__PURE__ */ jsxs4("div", { className: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_28px] items-center gap-4 px-4 py-3 bg-ui-bg-component", children: [
|
|
560
585
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-x-2 text-ui-fg-subtle", children: [
|
|
561
586
|
/* @__PURE__ */ jsx4(Text3, { size: "small", weight: "plus", leading: "compact", children: attr.name }),
|
|
562
587
|
attr.description && /* @__PURE__ */ jsx4(Tooltip, { content: attr.description, children: /* @__PURE__ */ jsx4("span", { className: "text-ui-fg-muted flex items-center", children: /* @__PURE__ */ jsx4(InformationCircleSolid, {}) }) }),
|
|
563
588
|
attr.is_required && /* @__PURE__ */ jsx4(Tooltip, { content: t("products.attributeRequiredByMarketplace"), children: /* @__PURE__ */ jsx4("span", { className: "text-ui-fg-muted flex items-center", children: /* @__PURE__ */ jsx4(InformationCircleSolid, {}) }) })
|
|
564
589
|
] }),
|
|
565
|
-
/* @__PURE__ */ jsx4(
|
|
566
|
-
Badge,
|
|
567
|
-
{
|
|
568
|
-
size: "2xsmall",
|
|
569
|
-
className: "flex min-w-[20px] items-center justify-center",
|
|
570
|
-
children: val
|
|
571
|
-
},
|
|
572
|
-
val
|
|
573
|
-
)) : /* @__PURE__ */ jsx4(
|
|
574
|
-
Text3,
|
|
575
|
-
{
|
|
576
|
-
size: "small",
|
|
577
|
-
leading: "compact",
|
|
578
|
-
className: "text-ui-fg-subtle",
|
|
579
|
-
children: attr.type === "toggle" ? values.map(
|
|
580
|
-
(val) => val === "true" ? t("general.yes") : t("general.no")
|
|
581
|
-
).join(", ") || "-" : values.join(", ") || "-"
|
|
582
|
-
}
|
|
583
|
-
) }),
|
|
590
|
+
/* @__PURE__ */ jsx4(AttributeValue, { attribute: attr }),
|
|
584
591
|
/* @__PURE__ */ jsx4(AttributeActions, { productId, attribute: attr })
|
|
585
592
|
] })
|
|
586
593
|
},
|
|
@@ -613,12 +620,12 @@ var ProductAttributeSection = ({
|
|
|
613
620
|
{
|
|
614
621
|
label: t("products.create.attributes.addExisting"),
|
|
615
622
|
to: "attributes/add",
|
|
616
|
-
icon: /* @__PURE__ */ jsx4(
|
|
623
|
+
icon: /* @__PURE__ */ jsx4(Plus, {})
|
|
617
624
|
},
|
|
618
625
|
{
|
|
619
626
|
label: t("products.create.attributes.createNew"),
|
|
620
627
|
to: "attributes/create",
|
|
621
|
-
icon: /* @__PURE__ */ jsx4(
|
|
628
|
+
icon: /* @__PURE__ */ jsx4(PencilSquare, {})
|
|
622
629
|
}
|
|
623
630
|
]
|
|
624
631
|
}
|
|
@@ -632,7 +639,7 @@ var ProductAttributeSection = ({
|
|
|
632
639
|
AttributeGroup,
|
|
633
640
|
{
|
|
634
641
|
icon: /* @__PURE__ */ jsx4(Swatch, {}),
|
|
635
|
-
title: t("products.
|
|
642
|
+
title: t("products.attributeVariations"),
|
|
636
643
|
description: t("products.attributeVariantsDescription"),
|
|
637
644
|
attributes: variantAttributes,
|
|
638
645
|
productId: product.id
|
|
@@ -832,30 +839,16 @@ var ProductOrganizationSection = ({
|
|
|
832
839
|
/* @__PURE__ */ jsx6(
|
|
833
840
|
SectionRow,
|
|
834
841
|
{
|
|
835
|
-
title: t("fields.
|
|
836
|
-
value: product.
|
|
842
|
+
title: t("fields.category"),
|
|
843
|
+
value: product.categories?.length ? product.categories.map((pcat) => /* @__PURE__ */ jsx6(
|
|
837
844
|
OrganizationTag,
|
|
838
845
|
{
|
|
839
|
-
label:
|
|
840
|
-
to: `/
|
|
846
|
+
label: pcat.name,
|
|
847
|
+
to: `/categories/${pcat.id}`
|
|
841
848
|
},
|
|
842
|
-
|
|
849
|
+
pcat.id
|
|
843
850
|
)) : void 0,
|
|
844
|
-
"data-testid": "product-
|
|
845
|
-
}
|
|
846
|
-
),
|
|
847
|
-
/* @__PURE__ */ jsx6(
|
|
848
|
-
SectionRow,
|
|
849
|
-
{
|
|
850
|
-
title: t("fields.type"),
|
|
851
|
-
value: product.type ? /* @__PURE__ */ jsx6(
|
|
852
|
-
OrganizationTag,
|
|
853
|
-
{
|
|
854
|
-
label: product.type.value,
|
|
855
|
-
to: `/settings/product-types/${product.type_id}`
|
|
856
|
-
}
|
|
857
|
-
) : void 0,
|
|
858
|
-
"data-testid": "product-type-row"
|
|
851
|
+
"data-testid": "product-categories-row"
|
|
859
852
|
}
|
|
860
853
|
),
|
|
861
854
|
/* @__PURE__ */ jsx6(
|
|
@@ -875,16 +868,30 @@ var ProductOrganizationSection = ({
|
|
|
875
868
|
/* @__PURE__ */ jsx6(
|
|
876
869
|
SectionRow,
|
|
877
870
|
{
|
|
878
|
-
title: t("fields.
|
|
879
|
-
value: product.
|
|
871
|
+
title: t("fields.tags"),
|
|
872
|
+
value: product.tags?.length ? product.tags.map((tag) => /* @__PURE__ */ jsx6(
|
|
880
873
|
OrganizationTag,
|
|
881
874
|
{
|
|
882
|
-
label:
|
|
883
|
-
to: `/
|
|
875
|
+
label: tag.value,
|
|
876
|
+
to: `/settings/product-tags/${tag.id}`
|
|
884
877
|
},
|
|
885
|
-
|
|
878
|
+
tag.id
|
|
886
879
|
)) : void 0,
|
|
887
|
-
"data-testid": "product-
|
|
880
|
+
"data-testid": "product-tags-row"
|
|
881
|
+
}
|
|
882
|
+
),
|
|
883
|
+
/* @__PURE__ */ jsx6(
|
|
884
|
+
SectionRow,
|
|
885
|
+
{
|
|
886
|
+
title: t("fields.type"),
|
|
887
|
+
value: product.type ? /* @__PURE__ */ jsx6(
|
|
888
|
+
OrganizationTag,
|
|
889
|
+
{
|
|
890
|
+
label: product.type.value,
|
|
891
|
+
to: `/settings/product-types/${product.type_id}`
|
|
892
|
+
}
|
|
893
|
+
) : void 0,
|
|
894
|
+
"data-testid": "product-type-row"
|
|
888
895
|
}
|
|
889
896
|
)
|
|
890
897
|
]
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
getCategoryGallery,
|
|
15
15
|
getCategoryIcon
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-QJCUPZZQ.js";
|
|
17
17
|
import {
|
|
18
18
|
useProductTableColumns
|
|
19
19
|
} from "./chunk-O53E5U52.js";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
import {
|
|
30
30
|
_DataTable,
|
|
31
31
|
useDataTable
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-HSL5IICN.js";
|
|
33
33
|
import {
|
|
34
34
|
ActionMenu
|
|
35
35
|
} from "./chunk-BDGZ4EQO.js";
|