@mercurjs/admin 2.2.0-canary.36 → 2.2.0-canary.37
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-26SSHLLG.js} +3 -3
- package/dist/{campaign-detail-GZV2HK2G.js → campaign-detail-VMJQISAE.js} +4 -4
- package/dist/{category-create-7UTOSFO5.js → category-create-AIS2MG7E.js} +2 -2
- package/dist/{category-detail-AYVW7LRB.js → category-detail-I3EEPAQR.js} +2 -2
- package/dist/{category-icon-edit-FMVPTC27.js → category-icon-edit-W2TPCSDC.js} +1 -1
- package/dist/{category-list-B6B3ZANX.js → category-list-QLHQST3D.js} +2 -2
- package/dist/{category-media-4SLUTBZS.js → category-media-PC4V7YU4.js} +1 -1
- package/dist/{category-products-IF33PO5Y.js → category-products-XGLUDL73.js} +1 -0
- package/dist/{chunk-GQUGCSJV.js → chunk-2MRYNLVT.js} +1 -1
- package/dist/{chunk-ZMSQW2M3.js → chunk-3UJQT6UR.js} +93 -45
- package/dist/{chunk-HHW4PPNH.js → chunk-4OCWOY2F.js} +8 -1
- package/dist/{chunk-P4GIBTTG.js → chunk-5BSSIDW6.js} +1 -1
- package/dist/{chunk-IHERG3JP.js → chunk-6YEVK7JJ.js} +12 -4
- package/dist/{chunk-TRXFVQXD.js → chunk-BLR3NTU6.js} +1 -1
- package/dist/{chunk-OB5RWOGA.js → chunk-C6AU3U22.js} +1 -1
- package/dist/{chunk-BW5MMF6W.js → chunk-CMZ4KATG.js} +2 -2
- package/dist/{chunk-R3YD5UOZ.js → chunk-CU4UVEHX.js} +36 -1
- package/dist/{chunk-GJB4UQZI.js → chunk-E32O3DUM.js} +1 -1
- package/dist/{chunk-DP3OBKUP.js → chunk-GX7YQ6GM.js} +1 -1
- package/dist/{chunk-WMVLWFFU.js → chunk-HBT7GVJD.js} +3 -4
- package/dist/{chunk-YAOYZQDK.js → chunk-KUKBV4XN.js} +1 -1
- package/dist/{chunk-CA4K6JDJ.js → chunk-MKNQ6BT6.js} +1 -1
- package/dist/{chunk-PQAQM6SB.js → chunk-NXMD36QG.js} +1 -1
- package/dist/{chunk-3OZRK7TN.js → chunk-OTXOV6YU.js} +1 -1
- package/dist/{chunk-MTOPGOKU.js → chunk-PAUULPNC.js} +1 -1
- package/dist/{chunk-WEWBHUEB.js → chunk-POMQZ6PN.js} +1 -1
- package/dist/{chunk-LECZPR6R.js → chunk-QJCUPZZQ.js} +4 -2
- package/dist/{chunk-HLUWC7C3.js → chunk-RLGMY7JJ.js} +1 -1
- package/dist/{chunk-OLAOEVZE.js → chunk-SWQC5UPD.js} +2 -2
- package/dist/{chunk-T2WVIET2.js → chunk-VM56ZITS.js} +4 -2
- package/dist/{chunk-R6DVBI5F.js → chunk-X3TWPSUM.js} +1 -1
- package/dist/{chunk-NX3YQW2B.js → chunk-XEB5I2KE.js} +2 -2
- package/dist/{chunk-TYXSRH47.js → chunk-ZDEIYWCK.js} +14 -4
- package/dist/{collection-create-T6HBO4LU.js → collection-create-5IGFVQKE.js} +1 -1
- package/dist/{collection-detail-PMSYCWE3.js → collection-detail-AB6HGJDM.js} +2 -2
- package/dist/{collection-icon-edit-VZP3W6AZ.js → collection-icon-edit-WCSKUDXE.js} +1 -1
- package/dist/{collection-list-EK2TBM3J.js → collection-list-UHFUKA5U.js} +3 -3
- 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/{global-commission-edit-AOZ6XLH7.js → global-commission-edit-7ZMMIV7B.js} +19 -12
- package/dist/index.js +51 -51
- package/dist/{inventory-create-HOQVSL2G.js → inventory-create-WJ3CCFTD.js} +2 -2
- package/dist/{inventory-stock-E4U2SS3Z.js → inventory-stock-F2BKMXY3.js} +1 -1
- package/dist/{location-service-zone-shipping-option-create-K6USZASG.js → location-service-zone-shipping-option-create-OLABLTSL.js} +3 -3
- package/dist/{location-service-zone-shipping-option-pricing-ZENGURN3.js → location-service-zone-shipping-option-pricing-TARZ34TW.js} +2 -2
- package/dist/{order-edit-billing-address-WQYQSLDB.js → order-edit-billing-address-IU6W76P3.js} +1 -1
- package/dist/pages/index.js +24 -24
- package/dist/{price-list-create-QEDMB4A6.js → price-list-create-UMA2NB3L.js} +3 -3
- package/dist/{price-list-prices-add-GVOZDWKE.js → price-list-prices-add-XLFLGFVG.js} +3 -3
- package/dist/{price-list-prices-edit-LNSUSN4V.js → price-list-prices-edit-MT6BFF3M.js} +2 -2
- package/dist/{product-bulk-edit-34KKEPJQ.js → product-bulk-edit-3AJGOE6E.js} +1 -1
- package/dist/{product-create-STXNKMAV.js → product-create-2SELD5CI.js} +4 -4
- package/dist/{product-detail-T4FOYZK7.js → product-detail-O7MVTHSN.js} +1 -1
- package/dist/{product-media-JFLRNBPR.js → product-media-S6L3IHUO.js} +2 -2
- package/dist/{product-organization-SGLOMAKK.js → product-organization-BYPV5QSZ.js} +1 -1
- package/dist/{product-tag-detail-ZV7V7UW3.js → product-tag-detail-SVDEVPMA.js} +2 -2
- package/dist/{product-tag-list-SZHBD5FA.js → product-tag-list-4ECQFBOA.js} +2 -2
- package/dist/{promotion-detail-AWVF7JHY.js → promotion-detail-25JCCLU2.js} +3 -3
- package/dist/{promotion-list-INBZ3OG3.js → promotion-list-RXLVU4G2.js} +4 -4
- package/dist/{refund-reason-list-UCZC5ASP.js → refund-reason-list-XMDZO34F.js} +2 -2
- package/dist/{reset-password-ZJW3AHYT.js → reset-password-GBVMOKXP.js} +1 -1
- package/dist/{return-reason-list-AJ4E3A56.js → return-reason-list-AW6MMUKD.js} +2 -2
- package/dist/{store-bulk-edit-5DZ7RZS3.js → store-bulk-edit-I6QHGMEC.js} +1 -1
- package/dist/{store-edit-6KKEQZRH.js → store-edit-BBOEDZNV.js} +2 -2
- package/dist/{tax-region-create-GAXLHDV5.js → tax-region-create-7432IFN5.js} +1 -1
- package/dist/{tax-region-tax-override-create-XOBU6DOL.js → tax-region-tax-override-create-WRUNCP67.js} +2 -2
- package/dist/{tax-region-tax-override-edit-PEQJFCOU.js → tax-region-tax-override-edit-EOIDY4LX.js} +2 -2
- package/package.json +6 -6
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePromotionTableColumns,
|
|
3
3
|
usePromotionTableQuery
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NXMD36QG.js";
|
|
5
5
|
import {
|
|
6
6
|
usePromotionTableFilters
|
|
7
7
|
} from "./chunk-S2WEYEQR.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-C6AU3U22.js";
|
|
9
9
|
import "./chunk-JHIMVLB2.js";
|
|
10
10
|
import "./chunk-FMFVTERD.js";
|
|
11
11
|
import "./chunk-DB6ANJBO.js";
|
|
12
12
|
import "./chunk-PHOCVOZ5.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-6YEVK7JJ.js";
|
|
14
14
|
import "./chunk-TKGWSUEI.js";
|
|
15
15
|
import {
|
|
16
16
|
KeyboundForm
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CAMPAIGN_DETAIL_FIELDS,
|
|
3
3
|
CampaignDetailPage
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-PAUULPNC.js";
|
|
5
|
+
import "./chunk-NXMD36QG.js";
|
|
6
6
|
import "./chunk-S2WEYEQR.js";
|
|
7
7
|
import "./chunk-RK5N3XIX.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-C6AU3U22.js";
|
|
9
9
|
import "./chunk-JHIMVLB2.js";
|
|
10
10
|
import "./chunk-FMFVTERD.js";
|
|
11
11
|
import "./chunk-DB6ANJBO.js";
|
|
12
12
|
import "./chunk-PHOCVOZ5.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-6YEVK7JJ.js";
|
|
14
14
|
import "./chunk-IQPN4PZJ.js";
|
|
15
15
|
import "./chunk-E74OUNA3.js";
|
|
16
16
|
import "./chunk-FQERBIVS.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CategoryCreate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BLR3NTU6.js";
|
|
4
4
|
import "./chunk-XLA2CNCW.js";
|
|
5
5
|
import "./chunk-BW7BDHZV.js";
|
|
6
6
|
import "./chunk-Y456KVIN.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-QJCUPZZQ.js";
|
|
8
8
|
import "./chunk-7RPRNVBS.js";
|
|
9
9
|
import "./chunk-HJ56YXBU.js";
|
|
10
10
|
import "./chunk-SMQT3ZNO.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CategoryDetailPage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GX7YQ6GM.js";
|
|
4
4
|
import "./chunk-7AV5EJJ5.js";
|
|
5
5
|
import "./chunk-CW3HYGS5.js";
|
|
6
6
|
import "./chunk-Y456KVIN.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-QJCUPZZQ.js";
|
|
8
8
|
import "./chunk-O53E5U52.js";
|
|
9
9
|
import "./chunk-WBSUHLO7.js";
|
|
10
10
|
import "./chunk-P4LTLPTK.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CategoryListPage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-POMQZ6PN.js";
|
|
4
4
|
import "./chunk-CW3HYGS5.js";
|
|
5
5
|
import "./chunk-JHIMVLB2.js";
|
|
6
6
|
import "./chunk-Y456KVIN.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-QJCUPZZQ.js";
|
|
8
8
|
import "./chunk-DB6ANJBO.js";
|
|
9
9
|
import "./chunk-PHOCVOZ5.js";
|
|
10
10
|
import "./chunk-VSLHL2AZ.js";
|
|
@@ -197,6 +197,7 @@ var EditCategoryProductsForm = ({
|
|
|
197
197
|
{ key: "created_at", label: t("fields.createdAt") },
|
|
198
198
|
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
199
199
|
],
|
|
200
|
+
defaultOrder: searchParams.order,
|
|
200
201
|
prefix: PREFIX,
|
|
201
202
|
isLoading: isPending,
|
|
202
203
|
layout: "fill",
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
decorateVariantsWithDefaultValues,
|
|
11
11
|
generateVariantsFromAttributes,
|
|
12
12
|
normalizeProductFormValues
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZDEIYWCK.js";
|
|
14
14
|
import {
|
|
15
15
|
HandleInput
|
|
16
16
|
} from "./chunk-HJ56YXBU.js";
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
import {
|
|
47
47
|
DataGrid,
|
|
48
48
|
createDataGridHelper
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-4OCWOY2F.js";
|
|
50
50
|
import {
|
|
51
51
|
RouteFocusModal,
|
|
52
52
|
StackedFocusModal,
|
|
@@ -99,6 +99,7 @@ var import_types = __toESM(require_dist(), 1);
|
|
|
99
99
|
import { XMarkMini } from "@medusajs/icons";
|
|
100
100
|
import {
|
|
101
101
|
Button as Button2,
|
|
102
|
+
clx,
|
|
102
103
|
Heading,
|
|
103
104
|
Hint,
|
|
104
105
|
IconButton,
|
|
@@ -641,7 +642,7 @@ var SelectedAttributes = ({
|
|
|
641
642
|
Select.Value,
|
|
642
643
|
{
|
|
643
644
|
placeholder: t(
|
|
644
|
-
"products.create.attributes.
|
|
645
|
+
"products.create.attributes.selectValuePlaceholder"
|
|
645
646
|
)
|
|
646
647
|
}
|
|
647
648
|
) }),
|
|
@@ -663,7 +664,7 @@ var SelectedAttributes = ({
|
|
|
663
664
|
value: typeof value === "string" ? value : value?.[0] ?? "",
|
|
664
665
|
onChange: (e) => onChange(e.target.value),
|
|
665
666
|
placeholder: t(
|
|
666
|
-
"products.create.attributes.
|
|
667
|
+
"products.create.attributes.enterValuePlaceholder"
|
|
667
668
|
)
|
|
668
669
|
}
|
|
669
670
|
)
|
|
@@ -684,7 +685,7 @@ var SelectedAttributes = ({
|
|
|
684
685
|
Select.Value,
|
|
685
686
|
{
|
|
686
687
|
placeholder: t(
|
|
687
|
-
"products.create.attributes.
|
|
688
|
+
"products.create.attributes.selectValuePlaceholder"
|
|
688
689
|
)
|
|
689
690
|
}
|
|
690
691
|
) }),
|
|
@@ -708,7 +709,7 @@ var SelectedAttributes = ({
|
|
|
708
709
|
value: typeof value === "string" ? value : value?.[0] ?? "",
|
|
709
710
|
onChange: (e) => onChange(e.target.value),
|
|
710
711
|
placeholder: t(
|
|
711
|
-
"products.create.attributes.
|
|
712
|
+
"products.create.attributes.enterValuePlaceholder"
|
|
712
713
|
)
|
|
713
714
|
}
|
|
714
715
|
)
|
|
@@ -716,7 +717,7 @@ var SelectedAttributes = ({
|
|
|
716
717
|
),
|
|
717
718
|
field.use_for_variants && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
718
719
|
/* @__PURE__ */ jsx2("div", {}),
|
|
719
|
-
/* @__PURE__ */ jsx2(VariantAxisTip, {})
|
|
720
|
+
/* @__PURE__ */ jsx2(VariantAxisTip, { className: "border-none" })
|
|
720
721
|
] })
|
|
721
722
|
] }),
|
|
722
723
|
/* @__PURE__ */ jsx2(
|
|
@@ -833,7 +834,7 @@ var RequiredAttributeField = ({
|
|
|
833
834
|
Select.Value,
|
|
834
835
|
{
|
|
835
836
|
placeholder: t(
|
|
836
|
-
"products.create.attributes.
|
|
837
|
+
"products.create.attributes.selectValuePlaceholder"
|
|
837
838
|
)
|
|
838
839
|
}
|
|
839
840
|
) }),
|
|
@@ -863,7 +864,7 @@ var RequiredAttributeField = ({
|
|
|
863
864
|
value: typeof value === "string" ? value : value?.[0] ?? "",
|
|
864
865
|
onChange: (e) => onChange(e.target.value),
|
|
865
866
|
placeholder: t(
|
|
866
|
-
"products.create.attributes.
|
|
867
|
+
"products.create.attributes.enterValuePlaceholder"
|
|
867
868
|
)
|
|
868
869
|
}
|
|
869
870
|
) : attribute.type === import_types.AttributeType.TOGGLE ? /* @__PURE__ */ jsx2(
|
|
@@ -882,7 +883,7 @@ var RequiredAttributeField = ({
|
|
|
882
883
|
value: typeof value === "string" ? value : value?.[0] ?? "",
|
|
883
884
|
onChange: (e) => onChange(e.target.value),
|
|
884
885
|
placeholder: t(
|
|
885
|
-
"products.create.attributes.
|
|
886
|
+
"products.create.attributes.enterValuePlaceholder"
|
|
886
887
|
)
|
|
887
888
|
}
|
|
888
889
|
) }),
|
|
@@ -892,9 +893,16 @@ var RequiredAttributeField = ({
|
|
|
892
893
|
}
|
|
893
894
|
);
|
|
894
895
|
};
|
|
895
|
-
var VariantAxisTip = () => {
|
|
896
|
+
var VariantAxisTip = ({ className }) => {
|
|
896
897
|
const { t } = useTranslation2();
|
|
897
|
-
return /* @__PURE__ */ jsx2(
|
|
898
|
+
return /* @__PURE__ */ jsx2(
|
|
899
|
+
InlineTip,
|
|
900
|
+
{
|
|
901
|
+
className: clx("border-none", className),
|
|
902
|
+
label: t("products.create.attributes.tip"),
|
|
903
|
+
children: t("products.create.attributes.variantAxisTip")
|
|
904
|
+
}
|
|
905
|
+
);
|
|
898
906
|
};
|
|
899
907
|
Root._tabMeta = defineTabMeta({
|
|
900
908
|
id: "attributes",
|
|
@@ -924,7 +932,8 @@ var ProductCreateGeneralSection = () => {
|
|
|
924
932
|
render: ({ field }) => {
|
|
925
933
|
return /* @__PURE__ */ jsxs3(Form.Item, { "data-testid": "product-create-general-section-title-item", children: [
|
|
926
934
|
/* @__PURE__ */ jsx3(Form.Label, { "data-testid": "product-create-general-section-title-label", children: t("products.fields.title.label") }),
|
|
927
|
-
/* @__PURE__ */ jsx3(Form.Control, { "data-testid": "product-create-general-section-title-control", children: /* @__PURE__ */ jsx3(Input2, { ...field, placeholder: t("products.fields.title.placeholder"), "data-testid": "product-create-general-section-title-input" }) })
|
|
935
|
+
/* @__PURE__ */ jsx3(Form.Control, { "data-testid": "product-create-general-section-title-control", children: /* @__PURE__ */ jsx3(Input2, { ...field, placeholder: t("products.fields.title.placeholder"), "data-testid": "product-create-general-section-title-input" }) }),
|
|
936
|
+
/* @__PURE__ */ jsx3(Form.ErrorMessage, { "data-testid": "product-create-general-section-title-error" })
|
|
928
937
|
] });
|
|
929
938
|
}
|
|
930
939
|
}
|
|
@@ -1278,7 +1287,7 @@ function formatFileSize(bytes, decimalPlaces = 2) {
|
|
|
1278
1287
|
import {
|
|
1279
1288
|
Alert,
|
|
1280
1289
|
Checkbox,
|
|
1281
|
-
clx,
|
|
1290
|
+
clx as clx2,
|
|
1282
1291
|
Heading as Heading2,
|
|
1283
1292
|
Hint as Hint2,
|
|
1284
1293
|
InlineTip as InlineTip2,
|
|
@@ -1405,7 +1414,7 @@ var ProductCreateVariantsSection = () => {
|
|
|
1405
1414
|
SortableList.Item,
|
|
1406
1415
|
{
|
|
1407
1416
|
id: item.id,
|
|
1408
|
-
className:
|
|
1417
|
+
className: clx2("bg-ui-bg-base border-b", {
|
|
1409
1418
|
"border-b-0": index === variants.fields.length - 1
|
|
1410
1419
|
}),
|
|
1411
1420
|
children: /* @__PURE__ */ jsxs5(
|
|
@@ -1645,28 +1654,30 @@ var ProductCreateOrganizationSection = () => {
|
|
|
1645
1654
|
}
|
|
1646
1655
|
)
|
|
1647
1656
|
] }),
|
|
1648
|
-
/* @__PURE__ */
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1657
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-y-4", children: [
|
|
1658
|
+
/* @__PURE__ */ jsx7(
|
|
1659
|
+
SwitchBox,
|
|
1660
|
+
{
|
|
1661
|
+
control: form.control,
|
|
1662
|
+
name: "discountable",
|
|
1663
|
+
label: t("products.fields.discountable.label"),
|
|
1664
|
+
description: t("products.fields.discountable.hint"),
|
|
1665
|
+
optional: true,
|
|
1666
|
+
"data-testid": "product-create-organize-section-discountable-switch"
|
|
1667
|
+
}
|
|
1668
|
+
),
|
|
1669
|
+
/* @__PURE__ */ jsx7(
|
|
1670
|
+
SwitchBox,
|
|
1671
|
+
{
|
|
1672
|
+
control: form.control,
|
|
1673
|
+
name: "globally_available",
|
|
1674
|
+
label: t("products.fields.globally_available.label"),
|
|
1675
|
+
description: t("products.fields.globally_available.hint"),
|
|
1676
|
+
optional: true,
|
|
1677
|
+
"data-testid": "product-create-organize-section-globally-available-switch"
|
|
1678
|
+
}
|
|
1679
|
+
)
|
|
1680
|
+
] }),
|
|
1670
1681
|
!isGloballyAvailable && /* @__PURE__ */ jsx7(
|
|
1671
1682
|
Form.Field,
|
|
1672
1683
|
{
|
|
@@ -1737,13 +1748,16 @@ Root3._tabMeta = defineTabMeta({
|
|
|
1737
1748
|
var ProductCreateOrganizeForm = Root3;
|
|
1738
1749
|
|
|
1739
1750
|
// src/pages/products/product-create/components/product-create-variants-form/product-create-variants-form.tsx
|
|
1740
|
-
import {
|
|
1751
|
+
import { Input as Input3 } from "@medusajs/ui";
|
|
1752
|
+
import { useMemo as useMemo3, useState as useState3 } from "react";
|
|
1741
1753
|
import { useWatch as useWatch3 } from "react-hook-form";
|
|
1742
1754
|
import { useTranslation as useTranslation8 } from "react-i18next";
|
|
1743
1755
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1744
1756
|
var Root4 = () => {
|
|
1757
|
+
const { t } = useTranslation8();
|
|
1745
1758
|
const form = useTabbedForm();
|
|
1746
1759
|
const { setCloseOnEscape } = useRouteModal();
|
|
1760
|
+
const [search, setSearch] = useState3("");
|
|
1747
1761
|
const variants = useWatch3({
|
|
1748
1762
|
control: form.control,
|
|
1749
1763
|
name: "variants",
|
|
@@ -1771,20 +1785,54 @@ var Root4 = () => {
|
|
|
1771
1785
|
});
|
|
1772
1786
|
return ret;
|
|
1773
1787
|
}, [variants]);
|
|
1788
|
+
const filteredVariantData = useMemo3(() => {
|
|
1789
|
+
const query = search.trim().toLowerCase();
|
|
1790
|
+
if (!query) {
|
|
1791
|
+
return variantData;
|
|
1792
|
+
}
|
|
1793
|
+
return variantData.filter((variant) => {
|
|
1794
|
+
const haystack = [
|
|
1795
|
+
variant.title,
|
|
1796
|
+
variant.sku,
|
|
1797
|
+
...Object.values(variant.options ?? {})
|
|
1798
|
+
];
|
|
1799
|
+
return haystack.some((value) => value?.toLowerCase().includes(query));
|
|
1800
|
+
});
|
|
1801
|
+
}, [variantData, search]);
|
|
1802
|
+
const headerContent = /* @__PURE__ */ jsx9(
|
|
1803
|
+
Input3,
|
|
1804
|
+
{
|
|
1805
|
+
type: "search",
|
|
1806
|
+
size: "small",
|
|
1807
|
+
autoComplete: "off",
|
|
1808
|
+
value: search,
|
|
1809
|
+
onChange: (event) => setSearch(event.target.value),
|
|
1810
|
+
placeholder: t("general.search"),
|
|
1811
|
+
"data-testid": "product-create-variants-search-input"
|
|
1812
|
+
}
|
|
1813
|
+
);
|
|
1774
1814
|
return /* @__PURE__ */ jsx9(
|
|
1775
1815
|
"div",
|
|
1776
1816
|
{
|
|
1777
1817
|
className: "flex size-full flex-col divide-y overflow-hidden",
|
|
1778
1818
|
"data-testid": "product-create-variants-form",
|
|
1779
|
-
children: /* @__PURE__ */ jsx9(
|
|
1780
|
-
|
|
1819
|
+
children: /* @__PURE__ */ jsx9(
|
|
1820
|
+
"div",
|
|
1781
1821
|
{
|
|
1782
|
-
|
|
1783
|
-
data:
|
|
1784
|
-
|
|
1785
|
-
|
|
1822
|
+
className: "min-h-0 flex-1 overflow-hidden",
|
|
1823
|
+
"data-testid": "product-create-variants-form-datagrid",
|
|
1824
|
+
children: /* @__PURE__ */ jsx9(
|
|
1825
|
+
DataGrid,
|
|
1826
|
+
{
|
|
1827
|
+
columns,
|
|
1828
|
+
data: filteredVariantData,
|
|
1829
|
+
state: form,
|
|
1830
|
+
onEditingChange: (editing) => setCloseOnEscape(!editing),
|
|
1831
|
+
headerContent
|
|
1832
|
+
}
|
|
1833
|
+
)
|
|
1786
1834
|
}
|
|
1787
|
-
)
|
|
1835
|
+
)
|
|
1788
1836
|
}
|
|
1789
1837
|
);
|
|
1790
1838
|
};
|
|
@@ -3373,7 +3373,14 @@ var DataGridHeader = ({
|
|
|
3373
3373
|
}
|
|
3374
3374
|
)
|
|
3375
3375
|
] }),
|
|
3376
|
-
headerContent
|
|
3376
|
+
headerContent && /* @__PURE__ */ jsx9(
|
|
3377
|
+
"div",
|
|
3378
|
+
{
|
|
3379
|
+
className: "flex items-center",
|
|
3380
|
+
onFocusCapture: () => onHeaderInteractionChange(true),
|
|
3381
|
+
children: headerContent
|
|
3382
|
+
}
|
|
3383
|
+
),
|
|
3377
3384
|
/* @__PURE__ */ jsxs6("div", { className: "ml-auto flex items-center gap-x-2", children: [
|
|
3378
3385
|
errorCount > 0 && /* @__PURE__ */ jsxs6(
|
|
3379
3386
|
Button2,
|
|
@@ -9261,7 +9261,12 @@ var en_default = {
|
|
|
9261
9261
|
options: "Please create at least one option.",
|
|
9262
9262
|
uniqueSku: "SKU must be unique.",
|
|
9263
9263
|
requiredAttribute: "This attribute is required.",
|
|
9264
|
-
|
|
9264
|
+
requiredAttributeSelect: "This attribute is required by the marketplace. Please select value.",
|
|
9265
|
+
requiredAttributeEnter: "This attribute is required by the marketplace. Please enter value.",
|
|
9266
|
+
requiredAttributeMultiSelect: "This attribute is required by the marketplace. Please select at least one value.",
|
|
9267
|
+
requiredStore: "Please select at least one store",
|
|
9268
|
+
requiredTitle: "Please enter a title",
|
|
9269
|
+
requiredCategory: "Please select a category"
|
|
9265
9270
|
},
|
|
9266
9271
|
inventory: {
|
|
9267
9272
|
heading: "Inventory kits",
|
|
@@ -9271,7 +9276,7 @@ var en_default = {
|
|
|
9271
9276
|
},
|
|
9272
9277
|
attributes: {
|
|
9273
9278
|
header: "Attributes",
|
|
9274
|
-
description: "Manage attributes and variations for your product, e.g. color, size, brand etc.\nSelect from attributes defined by the
|
|
9279
|
+
description: "Manage attributes and variations for your product, e.g. color, size, brand etc.\nSelect from attributes defined by the marketplace or create your own.",
|
|
9275
9280
|
addExisting: "Add existing",
|
|
9276
9281
|
createNew: "Create new",
|
|
9277
9282
|
title: "Title",
|
|
@@ -9279,8 +9284,10 @@ var en_default = {
|
|
|
9279
9284
|
values: "Values",
|
|
9280
9285
|
selectValues: "Select values",
|
|
9281
9286
|
valuePlaceholder: "Enter values",
|
|
9287
|
+
enterValuePlaceholder: "Enter value",
|
|
9288
|
+
selectValuePlaceholder: "Select value",
|
|
9282
9289
|
requiredAttributes: "Required attributes",
|
|
9283
|
-
requiredAttributesHint: "These attributes are required by the
|
|
9290
|
+
requiredAttributesHint: "These attributes are required by the marketplace. Select them before proceeding.",
|
|
9284
9291
|
useForVariants: "Use for Variations",
|
|
9285
9292
|
useForVariantsDescription: "If checked, you will be able to create variants using this attribute. If not, the attribute will be used for informational purposes only.",
|
|
9286
9293
|
tip: "Tip",
|
|
@@ -9367,7 +9374,8 @@ var en_default = {
|
|
|
9367
9374
|
}
|
|
9368
9375
|
},
|
|
9369
9376
|
attributes: "Attributes",
|
|
9370
|
-
|
|
9377
|
+
attributeVariations: "Variations",
|
|
9378
|
+
attributeVariantsDescription: "Attributes used for variants",
|
|
9371
9379
|
attributeProductInformation: "Product Information",
|
|
9372
9380
|
attributeProductInformationDescription: "Attributes used for informational purposes",
|
|
9373
9381
|
attributeRequiredByMarketplace: "This attribute is required by the Marketplace",
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
PriceListCreateProductsSchema,
|
|
3
3
|
usePriceListCurrencyData,
|
|
4
4
|
usePriceListGridColumns
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OTXOV6YU.js";
|
|
6
6
|
import {
|
|
7
7
|
exctractPricesFromProducts,
|
|
8
8
|
isProductRow
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-FREUYHMS.js";
|
|
24
24
|
import {
|
|
25
25
|
DataGrid
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4OCWOY2F.js";
|
|
27
27
|
import {
|
|
28
28
|
RouteFocusModal,
|
|
29
29
|
useRouteModal
|
|
@@ -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
|
};
|
|
@@ -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,
|
|
@@ -613,12 +612,12 @@ var ProductAttributeSection = ({
|
|
|
613
612
|
{
|
|
614
613
|
label: t("products.create.attributes.addExisting"),
|
|
615
614
|
to: "attributes/add",
|
|
616
|
-
icon: /* @__PURE__ */ jsx4(
|
|
615
|
+
icon: /* @__PURE__ */ jsx4(Plus, {})
|
|
617
616
|
},
|
|
618
617
|
{
|
|
619
618
|
label: t("products.create.attributes.createNew"),
|
|
620
619
|
to: "attributes/create",
|
|
621
|
-
icon: /* @__PURE__ */ jsx4(
|
|
620
|
+
icon: /* @__PURE__ */ jsx4(PencilSquare, {})
|
|
622
621
|
}
|
|
623
622
|
]
|
|
624
623
|
}
|
|
@@ -632,7 +631,7 @@ var ProductAttributeSection = ({
|
|
|
632
631
|
AttributeGroup,
|
|
633
632
|
{
|
|
634
633
|
icon: /* @__PURE__ */ jsx4(Swatch, {}),
|
|
635
|
-
title: t("products.
|
|
634
|
+
title: t("products.attributeVariations"),
|
|
636
635
|
description: t("products.attributeVariantsDescription"),
|
|
637
636
|
attributes: variantAttributes,
|
|
638
637
|
productId: product.id
|