@open-mercato/core 0.5.1-develop.2949.009dcdd2d5 → 0.5.1-develop.2954.610bab2d08
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/helpers/integration/salesUi.js +25 -23
- package/dist/helpers/integration/salesUi.js.map +2 -2
- package/dist/modules/api_docs/frontend/docs/api/Explorer.js +24 -24
- package/dist/modules/api_docs/frontend/docs/api/Explorer.js.map +2 -2
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js +15 -7
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js.map +2 -2
- package/dist/modules/attachments/fields/attachment.js +4 -6
- package/dist/modules/attachments/fields/attachment.js.map +2 -2
- package/dist/modules/auth/api/users/route.js +63 -23
- package/dist/modules/auth/api/users/route.js.map +2 -2
- package/dist/modules/auth/backend/users/create/page.js +26 -26
- package/dist/modules/auth/backend/users/create/page.js.map +2 -2
- package/dist/modules/business_rules/components/ActionRow.js +36 -25
- package/dist/modules/business_rules/components/ActionRow.js.map +2 -2
- package/dist/modules/business_rules/components/ConditionGroup.js +14 -5
- package/dist/modules/business_rules/components/ConditionGroup.js.map +2 -2
- package/dist/modules/business_rules/components/ConditionRow.js +19 -10
- package/dist/modules/business_rules/components/ConditionRow.js.map +2 -2
- package/dist/modules/business_rules/components/RuleSetMembers.js +16 -10
- package/dist/modules/business_rules/components/RuleSetMembers.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +30 -34
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js +220 -223
- package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
- package/dist/modules/catalog/components/PriceKindSettings.js +20 -19
- package/dist/modules/catalog/components/PriceKindSettings.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductUomSection.js +42 -37
- package/dist/modules/catalog/components/products/ProductUomSection.js.map +2 -2
- package/dist/modules/catalog/components/products/VariantBuilder.js +22 -18
- package/dist/modules/catalog/components/products/VariantBuilder.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +18 -26
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +4 -6
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js +5 -4
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js.map +2 -2
- package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js +19 -7
- package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js +24 -21
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +2 -2
- package/dist/modules/customers/components/AddressEditor.js +24 -7
- package/dist/modules/customers/components/AddressEditor.js.map +2 -2
- package/dist/modules/customers/components/AddressFormatSettings.js +35 -25
- package/dist/modules/customers/components/AddressFormatSettings.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivityForm.js +20 -12
- package/dist/modules/customers/components/detail/ActivityForm.js.map +2 -2
- package/dist/modules/customers/components/detail/AnnualRevenueField.js +2 -2
- package/dist/modules/customers/components/detail/AnnualRevenueField.js.map +2 -2
- package/dist/modules/customers/components/detail/DealForm.js +19 -14
- package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
- package/dist/modules/customers/components/formConfig.js +16 -12
- package/dist/modules/customers/components/formConfig.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js +18 -10
- package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js.map +2 -2
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js +27 -28
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js +14 -6
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js +14 -6
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js +3 -2
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js +3 -2
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js +17 -8
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +40 -23
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/components/IntegrationScheduleTab.js +15 -6
- package/dist/modules/data_sync/components/IntegrationScheduleTab.js.map +2 -2
- package/dist/modules/dictionaries/components/AppearanceSelector.js +4 -4
- package/dist/modules/dictionaries/components/AppearanceSelector.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js +4 -5
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js +22 -14
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js.map +2 -2
- package/dist/modules/dictionaries/fields/dictionary.js +18 -13
- package/dist/modules/dictionaries/fields/dictionary.js.map +2 -2
- package/dist/modules/entities/components/EncryptionManager.js +23 -19
- package/dist/modules/entities/components/EncryptionManager.js.map +2 -2
- package/dist/modules/feature_toggles/components/formConfig.js +17 -9
- package/dist/modules/feature_toggles/components/formConfig.js.map +2 -2
- package/dist/modules/feature_toggles/components/overrideFormConfig.js +17 -9
- package/dist/modules/feature_toggles/components/overrideFormConfig.js.map +2 -2
- package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js +15 -8
- package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js.map +2 -2
- package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js +37 -22
- package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/[id]/page.js +22 -17
- package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js +12 -6
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js.map +2 -2
- package/dist/modules/planner/components/AvailabilityRulesEditor.js +19 -12
- package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
- package/dist/modules/resources/components/ResourceCrudForm.js +15 -10
- package/dist/modules/resources/components/ResourceCrudForm.js.map +3 -3
- package/dist/modules/sales/backend/sales/documents/[id]/page.js +15 -18
- package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
- package/dist/modules/sales/components/ProviderFieldInput.js +23 -20
- package/dist/modules/sales/components/ProviderFieldInput.js.map +2 -2
- package/dist/modules/sales/components/ShippingMethodsSettings.js +25 -17
- package/dist/modules/sales/components/ShippingMethodsSettings.js.map +3 -3
- package/dist/modules/sales/components/channels/ChannelOfferForm.js +35 -42
- package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +2 -2
- package/dist/modules/sales/components/documents/AddressesSection.js +87 -90
- package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
- package/dist/modules/sales/components/documents/AdjustmentDialog.js +17 -6
- package/dist/modules/sales/components/documents/AdjustmentDialog.js.map +3 -3
- package/dist/modules/sales/components/documents/LineItemDialog.js +42 -25
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentForm.js +96 -87
- package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js +20 -11
- package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js +20 -11
- package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js.map +2 -2
- package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js +36 -22
- package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js.map +2 -2
- package/dist/modules/staff/components/TeamMemberForm.js +14 -9
- package/dist/modules/staff/components/TeamMemberForm.js.map +3 -3
- package/dist/modules/workflows/backend/tasks/[id]/page.js +42 -21
- package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
- package/dist/modules/workflows/components/ActivitiesEditor.js +14 -6
- package/dist/modules/workflows/components/ActivitiesEditor.js.map +3 -3
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js +25 -17
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +3 -3
- package/dist/modules/workflows/components/EdgeEditDialog.js +48 -45
- package/dist/modules/workflows/components/EdgeEditDialog.js.map +2 -2
- package/dist/modules/workflows/components/NodeEditDialog.js +90 -90
- package/dist/modules/workflows/components/NodeEditDialog.js.map +2 -2
- package/dist/modules/workflows/components/StepsEditor.js +14 -6
- package/dist/modules/workflows/components/StepsEditor.js.map +3 -3
- package/dist/modules/workflows/components/TransitionsEditor.js +31 -26
- package/dist/modules/workflows/components/TransitionsEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/ActivityArrayEditor.js +19 -11
- package/dist/modules/workflows/components/fields/ActivityArrayEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js +12 -14
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js +24 -16
- package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js +12 -13
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/mobile/MobileTaskForm.js +12 -8
- package/dist/modules/workflows/components/mobile/MobileTaskForm.js.map +2 -2
- package/dist/modules/workflows/frontend/checkout-demo/page.js +43 -46
- package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
- package/package.json +3 -3
- package/src/helpers/integration/salesUi.ts +40 -30
- package/src/modules/api_docs/frontend/docs/api/Explorer.tsx +25 -19
- package/src/modules/attachments/components/AttachmentPartitionSettings.tsx +21 -11
- package/src/modules/attachments/fields/attachment.tsx +4 -6
- package/src/modules/auth/api/users/route.ts +75 -25
- package/src/modules/auth/backend/users/create/page.tsx +16 -20
- package/src/modules/business_rules/components/ActionRow.tsx +51 -32
- package/src/modules/business_rules/components/ConditionGroup.tsx +20 -9
- package/src/modules/business_rules/components/ConditionRow.tsx +24 -15
- package/src/modules/business_rules/components/RuleSetMembers.tsx +23 -13
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +47 -53
- package/src/modules/catalog/backend/catalog/products/create/page.tsx +84 -87
- package/src/modules/catalog/components/PriceKindSettings.tsx +9 -9
- package/src/modules/catalog/components/products/ProductUomSection.tsx +85 -83
- package/src/modules/catalog/components/products/VariantBuilder.tsx +49 -33
- package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +12 -27
- package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +4 -6
- package/src/modules/customer_accounts/widgets/injection/account-status/widget.client.tsx +5 -4
- package/src/modules/customers/backend/config/customers/pipeline-stages/page.tsx +28 -15
- package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +37 -26
- package/src/modules/customers/components/AddressEditor.tsx +30 -16
- package/src/modules/customers/components/AddressFormatSettings.tsx +25 -19
- package/src/modules/customers/components/detail/ActivityForm.tsx +35 -23
- package/src/modules/customers/components/detail/AnnualRevenueField.tsx +2 -2
- package/src/modules/customers/components/detail/DealForm.tsx +33 -20
- package/src/modules/customers/components/formConfig.tsx +25 -17
- package/src/modules/customers/widgets/dashboard/customer-todos/widget.client.tsx +3 -2
- package/src/modules/customers/widgets/dashboard/new-customers/widget.client.tsx +21 -11
- package/src/modules/customers/widgets/dashboard/new-deals/widget.client.tsx +3 -2
- package/src/modules/customers/widgets/dashboard/next-interactions/widget.client.tsx +3 -2
- package/src/modules/dashboards/components/WidgetVisibilityEditor.tsx +17 -22
- package/src/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.tsx +17 -7
- package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.tsx +20 -10
- package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.tsx +3 -2
- package/src/modules/dashboards/widgets/dashboard/top-customers/widget.client.tsx +3 -2
- package/src/modules/dashboards/widgets/dashboard/top-products/widget.client.tsx +20 -9
- package/src/modules/data_sync/backend/data-sync/page.tsx +64 -38
- package/src/modules/data_sync/components/IntegrationScheduleTab.tsx +18 -7
- package/src/modules/dictionaries/components/AppearanceSelector.tsx +4 -4
- package/src/modules/dictionaries/components/DictionaryEntriesEditor.tsx +3 -4
- package/src/modules/dictionaries/components/DictionaryEntrySelect.tsx +27 -21
- package/src/modules/dictionaries/fields/dictionary.tsx +36 -23
- package/src/modules/entities/components/EncryptionManager.tsx +49 -33
- package/src/modules/feature_toggles/components/formConfig.tsx +20 -10
- package/src/modules/feature_toggles/components/overrideFormConfig.tsx +20 -10
- package/src/modules/inbox_ops/backend/inbox-ops/settings/page.tsx +19 -10
- package/src/modules/inbox_ops/components/proposals/EditActionDialog.tsx +49 -26
- package/src/modules/integrations/backend/integrations/[id]/page.tsx +20 -11
- package/src/modules/integrations/backend/integrations/bundle/[id]/page.tsx +19 -9
- package/src/modules/planner/components/AvailabilityRulesEditor.tsx +34 -21
- package/src/modules/resources/components/ResourceCrudForm.tsx +24 -15
- package/src/modules/sales/backend/sales/documents/[id]/page.tsx +12 -15
- package/src/modules/sales/components/ProviderFieldInput.tsx +26 -17
- package/src/modules/sales/components/ShippingMethodsSettings.tsx +28 -20
- package/src/modules/sales/components/channels/ChannelOfferForm.tsx +51 -46
- package/src/modules/sales/components/documents/AddressesSection.tsx +78 -76
- package/src/modules/sales/components/documents/AdjustmentDialog.tsx +27 -15
- package/src/modules/sales/components/documents/LineItemDialog.tsx +69 -51
- package/src/modules/sales/components/documents/SalesDocumentForm.tsx +98 -87
- package/src/modules/sales/widgets/dashboard/new-orders/widget.client.tsx +23 -12
- package/src/modules/sales/widgets/dashboard/new-quotes/widget.client.tsx +23 -12
- package/src/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.tsx +35 -19
- package/src/modules/staff/components/TeamMemberForm.tsx +23 -14
- package/src/modules/workflows/backend/tasks/[id]/page.tsx +51 -23
- package/src/modules/workflows/components/ActivitiesEditor.tsx +20 -10
- package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +28 -18
- package/src/modules/workflows/components/EdgeEditDialog.tsx +51 -40
- package/src/modules/workflows/components/NodeEditDialog.tsx +81 -77
- package/src/modules/workflows/components/StepsEditor.tsx +20 -10
- package/src/modules/workflows/components/TransitionsEditor.tsx +61 -44
- package/src/modules/workflows/components/fields/ActivityArrayEditor.tsx +22 -12
- package/src/modules/workflows/components/fields/BusinessRuleConditionsEditor.tsx +9 -13
- package/src/modules/workflows/components/fields/FormFieldArrayEditor.tsx +27 -17
- package/src/modules/workflows/components/fields/StartPreConditionsEditor.tsx +9 -12
- package/src/modules/workflows/components/mobile/MobileTaskForm.tsx +19 -11
- package/src/modules/workflows/frontend/checkout-demo/page.tsx +71 -60
|
@@ -14,6 +14,14 @@ import { TagsInput } from "@open-mercato/ui/backend/inputs/TagsInput";
|
|
|
14
14
|
import { Button } from "@open-mercato/ui/primitives/button";
|
|
15
15
|
import { Input } from "@open-mercato/ui/primitives/input";
|
|
16
16
|
import { Label } from "@open-mercato/ui/primitives/label";
|
|
17
|
+
import { RadioGroup, Radio } from "@open-mercato/ui/primitives/radio";
|
|
18
|
+
import {
|
|
19
|
+
Select,
|
|
20
|
+
SelectContent,
|
|
21
|
+
SelectItem,
|
|
22
|
+
SelectTrigger,
|
|
23
|
+
SelectValue
|
|
24
|
+
} from "@open-mercato/ui/primitives/select";
|
|
17
25
|
import { cn } from "@open-mercato/shared/lib/utils";
|
|
18
26
|
import {
|
|
19
27
|
Plus,
|
|
@@ -1294,201 +1302,201 @@ function ProductBuilder({
|
|
|
1294
1302
|
) }) : null
|
|
1295
1303
|
] }) : null,
|
|
1296
1304
|
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border", children: [
|
|
1297
|
-
/* @__PURE__ */ jsx(
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
)
|
|
1303
|
-
|
|
1304
|
-
/* @__PURE__ */ jsx("
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
/* @__PURE__ */ jsx("
|
|
1312
|
-
|
|
1313
|
-
"
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
{
|
|
1318
|
-
|
|
1319
|
-
"catalog.
|
|
1320
|
-
"
|
|
1305
|
+
/* @__PURE__ */ jsx(
|
|
1306
|
+
RadioGroup,
|
|
1307
|
+
{
|
|
1308
|
+
className: "contents",
|
|
1309
|
+
name: "defaultVariant",
|
|
1310
|
+
value: (Array.isArray(values.variants) ? values.variants : []).find((v) => v.isDefault)?.id ?? "",
|
|
1311
|
+
onValueChange: (next) => markDefaultVariant(next),
|
|
1312
|
+
children: /* @__PURE__ */ jsx("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full min-w-[900px] table-fixed border-collapse text-sm", children: [
|
|
1313
|
+
/* @__PURE__ */ jsx("thead", { className: "bg-muted/50", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
1314
|
+
/* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left", children: t(
|
|
1315
|
+
"catalog.products.create.variantsBuilder.defaultOption",
|
|
1316
|
+
"Default option"
|
|
1317
|
+
) }),
|
|
1318
|
+
/* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left", children: t("catalog.products.form.variants", "Variant title") }),
|
|
1319
|
+
/* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left", children: t("catalog.products.create.variantsBuilder.sku", "SKU") }),
|
|
1320
|
+
/* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left", children: t(
|
|
1321
|
+
"catalog.products.create.variantsBuilder.vatColumn",
|
|
1322
|
+
"Tax class"
|
|
1323
|
+
) }),
|
|
1324
|
+
priceKinds.map((kind) => /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
1325
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
1326
|
+
/* @__PURE__ */ jsx("span", { children: t(
|
|
1327
|
+
"catalog.products.create.variantsBuilder.priceColumn",
|
|
1328
|
+
"Price {{title}}"
|
|
1329
|
+
).replace("{{title}}", kind.title) }),
|
|
1330
|
+
/* @__PURE__ */ jsx(
|
|
1331
|
+
"small",
|
|
1332
|
+
{
|
|
1333
|
+
title: kind.displayMode === "including-tax" ? t(
|
|
1334
|
+
"catalog.priceKinds.form.displayMode.include",
|
|
1335
|
+
"Including tax"
|
|
1336
|
+
) : t(
|
|
1337
|
+
"catalog.priceKinds.form.displayMode.exclude",
|
|
1338
|
+
"Excluding tax"
|
|
1339
|
+
),
|
|
1340
|
+
className: "text-xs text-muted-foreground",
|
|
1341
|
+
children: kind.displayMode === "including-tax" ? "\u24C9" : "\u24C3"
|
|
1342
|
+
}
|
|
1343
|
+
)
|
|
1344
|
+
] }),
|
|
1345
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: kind.currencyCode?.toUpperCase() ?? t(
|
|
1346
|
+
"catalog.products.create.variantsBuilder.currencyMissing",
|
|
1347
|
+
"Currency missing"
|
|
1348
|
+
) })
|
|
1349
|
+
] }) }, kind.id)),
|
|
1350
|
+
/* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-center", children: t(
|
|
1351
|
+
"catalog.products.create.variantsBuilder.manageInventory",
|
|
1352
|
+
"Managed inventory"
|
|
1353
|
+
) }),
|
|
1354
|
+
/* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-center", children: t(
|
|
1355
|
+
"catalog.products.create.variantsBuilder.allowBackorder",
|
|
1356
|
+
"Allow backorder"
|
|
1357
|
+
) }),
|
|
1358
|
+
/* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-center", children: t(
|
|
1359
|
+
"catalog.products.create.variantsBuilder.inventoryKit",
|
|
1360
|
+
"Has inventory kit"
|
|
1361
|
+
) })
|
|
1362
|
+
] }) }),
|
|
1363
|
+
/* @__PURE__ */ jsx("tbody", { children: (Array.isArray(values.variants) && values.variants.length ? values.variants : [
|
|
1364
|
+
createVariantDraft(values.taxRateId ?? null, {
|
|
1365
|
+
isDefault: true
|
|
1366
|
+
})
|
|
1367
|
+
]).map((variant) => /* @__PURE__ */ jsxs("tr", { className: "border-t", children: [
|
|
1368
|
+
/* @__PURE__ */ jsxs("td", { className: "px-3 py-2", children: [
|
|
1369
|
+
/* @__PURE__ */ jsxs("label", { className: "inline-flex items-center gap-1 text-xs", children: [
|
|
1370
|
+
/* @__PURE__ */ jsx(Radio, { value: variant.id }),
|
|
1371
|
+
variant.isDefault ? t(
|
|
1372
|
+
"catalog.products.create.variantsBuilder.defaultLabel",
|
|
1373
|
+
"Default option value"
|
|
1321
1374
|
) : t(
|
|
1322
|
-
"catalog.
|
|
1323
|
-
"
|
|
1375
|
+
"catalog.products.create.variantsBuilder.makeDefault",
|
|
1376
|
+
"Set as default"
|
|
1377
|
+
)
|
|
1378
|
+
] }),
|
|
1379
|
+
values.hasVariants && variant.optionValues ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: Object.values(variant.optionValues).join(" / ") }) : null
|
|
1380
|
+
] }),
|
|
1381
|
+
/* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx(
|
|
1382
|
+
Input,
|
|
1383
|
+
{
|
|
1384
|
+
value: variant.title,
|
|
1385
|
+
onChange: (event) => setVariantField(
|
|
1386
|
+
variant.id,
|
|
1387
|
+
"title",
|
|
1388
|
+
event.target.value
|
|
1324
1389
|
),
|
|
1325
|
-
|
|
1326
|
-
|
|
1390
|
+
placeholder: t(
|
|
1391
|
+
"catalog.products.create.variantsBuilder.titlePlaceholder",
|
|
1392
|
+
"Variant title"
|
|
1393
|
+
)
|
|
1327
1394
|
}
|
|
1328
|
-
)
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1395
|
+
) }),
|
|
1396
|
+
/* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx(
|
|
1397
|
+
Input,
|
|
1398
|
+
{
|
|
1399
|
+
value: variant.sku,
|
|
1400
|
+
onChange: (event) => setVariantField(
|
|
1401
|
+
variant.id,
|
|
1402
|
+
"sku",
|
|
1403
|
+
event.target.value
|
|
1404
|
+
),
|
|
1405
|
+
placeholder: t(
|
|
1406
|
+
"catalog.products.create.variantsBuilder.skuPlaceholder",
|
|
1407
|
+
"e.g., SKU-001"
|
|
1408
|
+
)
|
|
1409
|
+
}
|
|
1410
|
+
) }),
|
|
1411
|
+
/* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsxs(
|
|
1412
|
+
Select,
|
|
1413
|
+
{
|
|
1414
|
+
value: variant.taxRateId || void 0,
|
|
1415
|
+
onValueChange: (value) => setVariantField(variant.id, "taxRateId", value || null),
|
|
1416
|
+
disabled: !taxRates.length,
|
|
1417
|
+
children: [
|
|
1418
|
+
/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(
|
|
1419
|
+
SelectValue,
|
|
1420
|
+
{
|
|
1421
|
+
placeholder: defaultTaxRateLabel ? t(
|
|
1422
|
+
"catalog.products.create.variantsBuilder.vatOptionDefault",
|
|
1423
|
+
"Use product tax class ({{label}})"
|
|
1424
|
+
).replace("{{label}}", defaultTaxRateLabel) : t(
|
|
1425
|
+
"catalog.products.create.variantsBuilder.vatOptionNone",
|
|
1426
|
+
"No tax class"
|
|
1427
|
+
)
|
|
1428
|
+
}
|
|
1429
|
+
) }),
|
|
1430
|
+
/* @__PURE__ */ jsx(SelectContent, { children: taxRates.map((rate) => /* @__PURE__ */ jsx(SelectItem, { value: rate.id, children: formatTaxRateLabel(rate) }, rate.id)) })
|
|
1431
|
+
]
|
|
1432
|
+
}
|
|
1433
|
+
) }),
|
|
1434
|
+
priceKinds.map((kind) => /* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1435
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: kind.currencyCode ?? "\u2014" }),
|
|
1436
|
+
/* @__PURE__ */ jsx(
|
|
1437
|
+
Input,
|
|
1438
|
+
{
|
|
1439
|
+
type: "number",
|
|
1440
|
+
value: variant.prices?.[kind.id]?.amount ?? "",
|
|
1441
|
+
onChange: (event) => setVariantPrice(
|
|
1442
|
+
variant.id,
|
|
1443
|
+
kind.id,
|
|
1444
|
+
event.target.value
|
|
1445
|
+
),
|
|
1446
|
+
placeholder: "0.00",
|
|
1447
|
+
min: 0
|
|
1448
|
+
}
|
|
1449
|
+
)
|
|
1450
|
+
] }) }, kind.id)),
|
|
1451
|
+
/* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-center", children: /* @__PURE__ */ jsx(
|
|
1356
1452
|
"input",
|
|
1357
1453
|
{
|
|
1358
|
-
type: "
|
|
1359
|
-
|
|
1360
|
-
checked: variant.
|
|
1361
|
-
onChange: () =>
|
|
1454
|
+
type: "checkbox",
|
|
1455
|
+
className: "h-4 w-4 rounded border disabled:cursor-not-allowed disabled:opacity-50",
|
|
1456
|
+
checked: variant.manageInventory,
|
|
1457
|
+
onChange: (event) => setVariantField(
|
|
1458
|
+
variant.id,
|
|
1459
|
+
"manageInventory",
|
|
1460
|
+
event.target.checked
|
|
1461
|
+
),
|
|
1462
|
+
disabled: true,
|
|
1463
|
+
title: inventoryDisabledHint
|
|
1362
1464
|
}
|
|
1363
|
-
),
|
|
1364
|
-
|
|
1365
|
-
"
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
"
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
placeholder: t(
|
|
1399
|
-
"catalog.products.create.variantsBuilder.skuPlaceholder",
|
|
1400
|
-
"e.g., SKU-001"
|
|
1401
|
-
)
|
|
1402
|
-
}
|
|
1403
|
-
) }),
|
|
1404
|
-
/* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsxs(
|
|
1405
|
-
"select",
|
|
1406
|
-
{
|
|
1407
|
-
className: "flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1408
|
-
value: variant.taxRateId ?? "",
|
|
1409
|
-
onChange: (event) => setVariantField(
|
|
1410
|
-
variant.id,
|
|
1411
|
-
"taxRateId",
|
|
1412
|
-
event.target.value || null
|
|
1413
|
-
),
|
|
1414
|
-
disabled: !taxRates.length,
|
|
1415
|
-
children: [
|
|
1416
|
-
/* @__PURE__ */ jsx("option", { value: "", children: defaultTaxRateLabel ? t(
|
|
1417
|
-
"catalog.products.create.variantsBuilder.vatOptionDefault",
|
|
1418
|
-
"Use product tax class ({{label}})"
|
|
1419
|
-
).replace("{{label}}", defaultTaxRateLabel) : t(
|
|
1420
|
-
"catalog.products.create.variantsBuilder.vatOptionNone",
|
|
1421
|
-
"No tax class"
|
|
1422
|
-
) }),
|
|
1423
|
-
taxRates.map((rate) => /* @__PURE__ */ jsx("option", { value: rate.id, children: formatTaxRateLabel(rate) }, rate.id))
|
|
1424
|
-
]
|
|
1425
|
-
}
|
|
1426
|
-
) }),
|
|
1427
|
-
priceKinds.map((kind) => /* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1428
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: kind.currencyCode ?? "\u2014" }),
|
|
1429
|
-
/* @__PURE__ */ jsx(
|
|
1430
|
-
"input",
|
|
1431
|
-
{
|
|
1432
|
-
type: "number",
|
|
1433
|
-
className: "w-full rounded-md border px-2 py-1",
|
|
1434
|
-
value: variant.prices?.[kind.id]?.amount ?? "",
|
|
1435
|
-
onChange: (event) => setVariantPrice(
|
|
1436
|
-
variant.id,
|
|
1437
|
-
kind.id,
|
|
1438
|
-
event.target.value
|
|
1439
|
-
),
|
|
1440
|
-
placeholder: "0.00",
|
|
1441
|
-
min: 0
|
|
1442
|
-
}
|
|
1443
|
-
)
|
|
1444
|
-
] }) }, kind.id)),
|
|
1445
|
-
/* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-center", children: /* @__PURE__ */ jsx(
|
|
1446
|
-
"input",
|
|
1447
|
-
{
|
|
1448
|
-
type: "checkbox",
|
|
1449
|
-
className: "h-4 w-4 rounded border disabled:cursor-not-allowed disabled:opacity-50",
|
|
1450
|
-
checked: variant.manageInventory,
|
|
1451
|
-
onChange: (event) => setVariantField(
|
|
1452
|
-
variant.id,
|
|
1453
|
-
"manageInventory",
|
|
1454
|
-
event.target.checked
|
|
1455
|
-
),
|
|
1456
|
-
disabled: true,
|
|
1457
|
-
title: inventoryDisabledHint
|
|
1458
|
-
}
|
|
1459
|
-
) }),
|
|
1460
|
-
/* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-center", children: /* @__PURE__ */ jsx(
|
|
1461
|
-
"input",
|
|
1462
|
-
{
|
|
1463
|
-
type: "checkbox",
|
|
1464
|
-
className: "h-4 w-4 rounded border disabled:cursor-not-allowed disabled:opacity-50",
|
|
1465
|
-
checked: variant.allowBackorder,
|
|
1466
|
-
onChange: (event) => setVariantField(
|
|
1467
|
-
variant.id,
|
|
1468
|
-
"allowBackorder",
|
|
1469
|
-
event.target.checked
|
|
1470
|
-
),
|
|
1471
|
-
disabled: true,
|
|
1472
|
-
title: inventoryDisabledHint
|
|
1473
|
-
}
|
|
1474
|
-
) }),
|
|
1475
|
-
/* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-center", children: /* @__PURE__ */ jsx(
|
|
1476
|
-
"input",
|
|
1477
|
-
{
|
|
1478
|
-
type: "checkbox",
|
|
1479
|
-
className: "h-4 w-4 rounded border disabled:cursor-not-allowed disabled:opacity-50",
|
|
1480
|
-
checked: variant.hasInventoryKit,
|
|
1481
|
-
onChange: (event) => setVariantField(
|
|
1482
|
-
variant.id,
|
|
1483
|
-
"hasInventoryKit",
|
|
1484
|
-
event.target.checked
|
|
1485
|
-
),
|
|
1486
|
-
disabled: true,
|
|
1487
|
-
title: inventoryDisabledHint
|
|
1488
|
-
}
|
|
1489
|
-
) })
|
|
1490
|
-
] }, variant.id)) })
|
|
1491
|
-
] }) }),
|
|
1465
|
+
) }),
|
|
1466
|
+
/* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-center", children: /* @__PURE__ */ jsx(
|
|
1467
|
+
"input",
|
|
1468
|
+
{
|
|
1469
|
+
type: "checkbox",
|
|
1470
|
+
className: "h-4 w-4 rounded border disabled:cursor-not-allowed disabled:opacity-50",
|
|
1471
|
+
checked: variant.allowBackorder,
|
|
1472
|
+
onChange: (event) => setVariantField(
|
|
1473
|
+
variant.id,
|
|
1474
|
+
"allowBackorder",
|
|
1475
|
+
event.target.checked
|
|
1476
|
+
),
|
|
1477
|
+
disabled: true,
|
|
1478
|
+
title: inventoryDisabledHint
|
|
1479
|
+
}
|
|
1480
|
+
) }),
|
|
1481
|
+
/* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-center", children: /* @__PURE__ */ jsx(
|
|
1482
|
+
"input",
|
|
1483
|
+
{
|
|
1484
|
+
type: "checkbox",
|
|
1485
|
+
className: "h-4 w-4 rounded border disabled:cursor-not-allowed disabled:opacity-50",
|
|
1486
|
+
checked: variant.hasInventoryKit,
|
|
1487
|
+
onChange: (event) => setVariantField(
|
|
1488
|
+
variant.id,
|
|
1489
|
+
"hasInventoryKit",
|
|
1490
|
+
event.target.checked
|
|
1491
|
+
),
|
|
1492
|
+
disabled: true,
|
|
1493
|
+
title: inventoryDisabledHint
|
|
1494
|
+
}
|
|
1495
|
+
) })
|
|
1496
|
+
] }, variant.id)) })
|
|
1497
|
+
] }) })
|
|
1498
|
+
}
|
|
1499
|
+
),
|
|
1492
1500
|
!priceKinds.length ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-t px-4 py-3 text-sm text-muted-foreground", children: [
|
|
1493
1501
|
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" }),
|
|
1494
1502
|
t(
|
|
@@ -1637,13 +1645,12 @@ function ProductMetaSection({
|
|
|
1637
1645
|
] }),
|
|
1638
1646
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
1639
1647
|
/* @__PURE__ */ jsx(Label, { children: t("catalog.products.form.productType", "Product type") }),
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
|
|
1648
|
+
/* @__PURE__ */ jsxs(
|
|
1649
|
+
Select,
|
|
1642
1650
|
{
|
|
1643
|
-
className: "w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
1644
1651
|
value: values.productType || "simple",
|
|
1645
|
-
|
|
1646
|
-
const nextType =
|
|
1652
|
+
onValueChange: (value) => {
|
|
1653
|
+
const nextType = value;
|
|
1647
1654
|
setValue("productType", nextType);
|
|
1648
1655
|
const nextIsConfigurable = isConfigurableProductType(nextType);
|
|
1649
1656
|
if (nextIsConfigurable && !values.hasVariants) {
|
|
@@ -1652,24 +1659,16 @@ function ProductMetaSection({
|
|
|
1652
1659
|
setValue("hasVariants", false);
|
|
1653
1660
|
}
|
|
1654
1661
|
},
|
|
1655
|
-
children:
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
"
|
|
1659
|
-
{
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
type
|
|
1666
|
-
),
|
|
1667
|
-
isDisabled ? ` (${t("common.comingSoon", "Coming soon")})` : ""
|
|
1668
|
-
]
|
|
1669
|
-
},
|
|
1670
|
-
type
|
|
1671
|
-
);
|
|
1672
|
-
})
|
|
1662
|
+
children: [
|
|
1663
|
+
/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
1664
|
+
/* @__PURE__ */ jsx(SelectContent, { children: CATALOG_PRODUCT_TYPES.map((type) => {
|
|
1665
|
+
const isDisabled = type === "bundle" || type === "grouped";
|
|
1666
|
+
return /* @__PURE__ */ jsxs(SelectItem, { value: type, disabled: isDisabled, children: [
|
|
1667
|
+
t(`catalog.products.types.${type}`, type),
|
|
1668
|
+
isDisabled ? ` (${t("common.comingSoon", "Coming soon")})` : ""
|
|
1669
|
+
] }, type);
|
|
1670
|
+
}) })
|
|
1671
|
+
]
|
|
1673
1672
|
}
|
|
1674
1673
|
),
|
|
1675
1674
|
errors.productType ? /* @__PURE__ */ jsx("p", { className: "text-xs text-red-600", children: errors.productType }) : null
|
|
@@ -1708,21 +1707,19 @@ function ProductMetaSection({
|
|
|
1708
1707
|
)
|
|
1709
1708
|
] }),
|
|
1710
1709
|
/* @__PURE__ */ jsxs(
|
|
1711
|
-
|
|
1710
|
+
Select,
|
|
1712
1711
|
{
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
onChange: (event) => setValue("taxRateId", event.target.value || null),
|
|
1712
|
+
value: values.taxRateId || void 0,
|
|
1713
|
+
onValueChange: (value) => setValue("taxRateId", value || null),
|
|
1716
1714
|
disabled: !taxRates.length,
|
|
1717
1715
|
children: [
|
|
1718
|
-
/* @__PURE__ */ jsx(
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
"No tax classes available"
|
|
1716
|
+
/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(
|
|
1717
|
+
SelectValue,
|
|
1718
|
+
{
|
|
1719
|
+
placeholder: taxRates.length ? t("catalog.products.create.taxRates.noneSelected", "No tax class selected") : t("catalog.products.create.taxRates.emptyOption", "No tax classes available")
|
|
1720
|
+
}
|
|
1724
1721
|
) }),
|
|
1725
|
-
taxRates.map((rate) => /* @__PURE__ */ jsx(
|
|
1722
|
+
/* @__PURE__ */ jsx(SelectContent, { children: taxRates.map((rate) => /* @__PURE__ */ jsx(SelectItem, { value: rate.id, children: formatTaxRateLabel(rate) }, rate.id)) })
|
|
1726
1723
|
]
|
|
1727
1724
|
}
|
|
1728
1725
|
),
|