@open-mercato/core 0.5.1-develop.2953.6647bb2c43 → 0.5.1-develop.2964.d5ac4a6ebb
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/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/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
|
@@ -5,7 +5,14 @@ import { CrudForm } from "@open-mercato/ui/backend/CrudForm";
|
|
|
5
5
|
import { LookupSelect } from "@open-mercato/ui/backend/inputs";
|
|
6
6
|
import { Input } from "@open-mercato/ui/primitives/input";
|
|
7
7
|
import { Button } from "@open-mercato/ui/primitives/button";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
Select,
|
|
10
|
+
SelectContent,
|
|
11
|
+
SelectItem,
|
|
12
|
+
SelectTrigger,
|
|
13
|
+
SelectValue
|
|
14
|
+
} from "@open-mercato/ui/primitives/select";
|
|
15
|
+
import { SwitchField } from "@open-mercato/ui/primitives/switch-field";
|
|
9
16
|
import {
|
|
10
17
|
Dialog,
|
|
11
18
|
DialogContent,
|
|
@@ -743,30 +750,33 @@ function SalesDocumentForm({ onCreated, isSubmitting = false, initialKind, inbox
|
|
|
743
750
|
/* @__PURE__ */ jsx("p", { className: "text-base font-semibold", children: t("sales.documents.form.shipping.title", "Shipping address") }),
|
|
744
751
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: customerRequired ? t("sales.documents.form.address.customerRequired", "Select customer first or define custom address") : t("sales.documents.form.shipping.hint", "Select an address or define a new one.") })
|
|
745
752
|
] }),
|
|
746
|
-
/* @__PURE__ */
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
] })
|
|
753
|
+
/* @__PURE__ */ jsx(
|
|
754
|
+
SwitchField,
|
|
755
|
+
{
|
|
756
|
+
label: t("sales.documents.form.shipping.custom", "Define new address"),
|
|
757
|
+
flip: true,
|
|
758
|
+
checked: useCustom,
|
|
759
|
+
onCheckedChange: (checked) => updateValue("useCustomShipping", checked)
|
|
760
|
+
}
|
|
761
|
+
)
|
|
756
762
|
] }),
|
|
757
763
|
!useCustom ? /* @__PURE__ */ jsxs(
|
|
758
|
-
|
|
764
|
+
Select,
|
|
759
765
|
{
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
onChange: (evt) => updateValue("shippingAddressId", evt.target.value || null),
|
|
766
|
+
value: selectedId || void 0,
|
|
767
|
+
onValueChange: (value) => updateValue("shippingAddressId", value || null),
|
|
763
768
|
disabled: addressesLoading || customerRequired,
|
|
764
769
|
children: [
|
|
765
|
-
/* @__PURE__ */ jsx(
|
|
766
|
-
|
|
770
|
+
/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(
|
|
771
|
+
SelectValue,
|
|
772
|
+
{
|
|
773
|
+
placeholder: addressesLoading ? t("sales.documents.form.address.loading", "Loading addresses\u2026") : t("sales.documents.form.address.placeholder", "Select address")
|
|
774
|
+
}
|
|
775
|
+
) }),
|
|
776
|
+
/* @__PURE__ */ jsx(SelectContent, { children: addressOptions.map((addr) => {
|
|
767
777
|
const optionLabel = addr.summary ? `${addr.label} \u2014 ${addr.summary}` : addr.label;
|
|
768
|
-
return /* @__PURE__ */ jsx(
|
|
769
|
-
})
|
|
778
|
+
return /* @__PURE__ */ jsx(SelectItem, { value: addr.id, children: optionLabel }, addr.id);
|
|
779
|
+
}) })
|
|
770
780
|
]
|
|
771
781
|
}
|
|
772
782
|
) : null,
|
|
@@ -781,16 +791,16 @@ function SalesDocumentForm({ onCreated, isSubmitting = false, initialKind, inbox
|
|
|
781
791
|
hidePrimaryToggle: true
|
|
782
792
|
}
|
|
783
793
|
),
|
|
784
|
-
/* @__PURE__ */
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
+
/* @__PURE__ */ jsx(
|
|
795
|
+
SwitchField,
|
|
796
|
+
{
|
|
797
|
+
containerClassName: "col-span-2",
|
|
798
|
+
label: t("sales.documents.form.address.saveToCustomer", "Save this address to the customer"),
|
|
799
|
+
flip: true,
|
|
800
|
+
checked: formValues.saveShippingAddress === true,
|
|
801
|
+
onCheckedChange: (checked) => updateValue("saveShippingAddress", checked)
|
|
802
|
+
}
|
|
803
|
+
)
|
|
794
804
|
] }) : null,
|
|
795
805
|
addressesError && customerId ? /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3 rounded border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive", children: [
|
|
796
806
|
/* @__PURE__ */ jsx("span", { className: "flex-1", children: addressesError }),
|
|
@@ -856,52 +866,54 @@ function SalesDocumentForm({ onCreated, isSubmitting = false, initialKind, inbox
|
|
|
856
866
|
/* @__PURE__ */ jsx("p", { className: "text-base font-semibold", children: t("sales.documents.form.billing.title", "Billing address") }),
|
|
857
867
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: sameAsShipping ? t("sales.documents.form.address.sameAsShippingHint", "Billing will mirror the shipping address. Uncheck to edit.") : t("sales.documents.form.billing.hint", "Select an address or define a new one.") })
|
|
858
868
|
] }),
|
|
859
|
-
/* @__PURE__ */
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
869
|
+
/* @__PURE__ */ jsx(
|
|
870
|
+
SwitchField,
|
|
871
|
+
{
|
|
872
|
+
label: t("sales.documents.form.address.sameAsShipping", "Same as shipping"),
|
|
873
|
+
flip: true,
|
|
874
|
+
checked: sameAsShipping,
|
|
875
|
+
onCheckedChange: (checked) => {
|
|
876
|
+
updateValue("sameAsShipping", checked);
|
|
877
|
+
if (checked) {
|
|
878
|
+
updateValue("useCustomBilling", useCustomShipping);
|
|
879
|
+
updateValue("billingAddressId", shippingId);
|
|
880
|
+
updateValue("billingAddressDraft", shippingDraft);
|
|
871
881
|
}
|
|
872
882
|
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
] })
|
|
883
|
+
}
|
|
884
|
+
)
|
|
876
885
|
] }),
|
|
877
886
|
!sameAsShipping ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
878
887
|
!useCustom ? /* @__PURE__ */ jsxs(
|
|
879
|
-
|
|
888
|
+
Select,
|
|
880
889
|
{
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
onChange: (evt) => updateValue("billingAddressId", evt.target.value || null),
|
|
890
|
+
value: selectedId || void 0,
|
|
891
|
+
onValueChange: (value) => updateValue("billingAddressId", value || null),
|
|
884
892
|
disabled: addressesLoading || customerRequired,
|
|
885
893
|
children: [
|
|
886
|
-
/* @__PURE__ */ jsx(
|
|
887
|
-
|
|
894
|
+
/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(
|
|
895
|
+
SelectValue,
|
|
896
|
+
{
|
|
897
|
+
placeholder: addressesLoading ? t("sales.documents.form.address.loading", "Loading addresses\u2026") : t("sales.documents.form.address.placeholder", "Select address")
|
|
898
|
+
}
|
|
899
|
+
) }),
|
|
900
|
+
/* @__PURE__ */ jsx(SelectContent, { children: addressOptions.map((addr) => {
|
|
888
901
|
const optionLabel = addr.summary ? `${addr.label} \u2014 ${addr.summary}` : addr.label;
|
|
889
|
-
return /* @__PURE__ */ jsx(
|
|
890
|
-
})
|
|
902
|
+
return /* @__PURE__ */ jsx(SelectItem, { value: addr.id, children: optionLabel }, addr.id);
|
|
903
|
+
}) })
|
|
891
904
|
]
|
|
892
905
|
}
|
|
893
906
|
) : null,
|
|
894
|
-
/* @__PURE__ */
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
] }),
|
|
907
|
+
/* @__PURE__ */ jsx(
|
|
908
|
+
SwitchField,
|
|
909
|
+
{
|
|
910
|
+
label: t("sales.documents.form.shipping.custom", "Define new address"),
|
|
911
|
+
flip: true,
|
|
912
|
+
checked: useCustom,
|
|
913
|
+
onCheckedChange: (checked) => updateValue("useCustomBilling", checked),
|
|
914
|
+
disabled: false
|
|
915
|
+
}
|
|
916
|
+
),
|
|
905
917
|
useCustom ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
906
918
|
/* @__PURE__ */ jsx(
|
|
907
919
|
AddressEditor,
|
|
@@ -913,16 +925,16 @@ function SalesDocumentForm({ onCreated, isSubmitting = false, initialKind, inbox
|
|
|
913
925
|
hidePrimaryToggle: true
|
|
914
926
|
}
|
|
915
927
|
),
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
928
|
+
/* @__PURE__ */ jsx(
|
|
929
|
+
SwitchField,
|
|
930
|
+
{
|
|
931
|
+
containerClassName: "col-span-2",
|
|
932
|
+
label: t("sales.documents.form.address.saveToCustomer", "Save this address to the customer"),
|
|
933
|
+
flip: true,
|
|
934
|
+
checked: formValues.saveBillingAddress === true,
|
|
935
|
+
onCheckedChange: (checked) => updateValue("saveBillingAddress", checked)
|
|
936
|
+
}
|
|
937
|
+
)
|
|
926
938
|
] }) : null
|
|
927
939
|
] }) : null
|
|
928
940
|
] });
|
|
@@ -1050,20 +1062,17 @@ function SalesDocumentForm({ onCreated, isSubmitting = false, initialKind, inbox
|
|
|
1050
1062
|
}
|
|
1051
1063
|
) }),
|
|
1052
1064
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
1053
|
-
/* @__PURE__ */
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
"
|
|
1057
|
-
{
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
}
|
|
1065
|
-
)
|
|
1066
|
-
] }),
|
|
1065
|
+
/* @__PURE__ */ jsx(
|
|
1066
|
+
Input,
|
|
1067
|
+
{
|
|
1068
|
+
type: "email",
|
|
1069
|
+
leftIcon: /* @__PURE__ */ jsx(Mail, {}),
|
|
1070
|
+
value: emailValue,
|
|
1071
|
+
onChange: (event) => setValue("customerEmail", event.target.value),
|
|
1072
|
+
placeholder: t("sales.documents.form.email.placeholder", "Email used for the document"),
|
|
1073
|
+
spellCheck: false
|
|
1074
|
+
}
|
|
1075
|
+
),
|
|
1067
1076
|
duplicate ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between rounded border bg-muted px-3 py-2 text-xs text-muted-foreground", children: [
|
|
1068
1077
|
/* @__PURE__ */ jsx("span", { children: t("customers.people.form.emailDuplicateNotice", void 0, { name: duplicate.displayName }) }),
|
|
1069
1078
|
/* @__PURE__ */ jsx(
|