@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.
Files changed (226) hide show
  1. package/dist/helpers/integration/salesUi.js +25 -23
  2. package/dist/helpers/integration/salesUi.js.map +2 -2
  3. package/dist/modules/api_docs/frontend/docs/api/Explorer.js +24 -24
  4. package/dist/modules/api_docs/frontend/docs/api/Explorer.js.map +2 -2
  5. package/dist/modules/attachments/components/AttachmentPartitionSettings.js +15 -7
  6. package/dist/modules/attachments/components/AttachmentPartitionSettings.js.map +2 -2
  7. package/dist/modules/attachments/fields/attachment.js +4 -6
  8. package/dist/modules/attachments/fields/attachment.js.map +2 -2
  9. package/dist/modules/auth/backend/users/create/page.js +26 -26
  10. package/dist/modules/auth/backend/users/create/page.js.map +2 -2
  11. package/dist/modules/business_rules/components/ActionRow.js +36 -25
  12. package/dist/modules/business_rules/components/ActionRow.js.map +2 -2
  13. package/dist/modules/business_rules/components/ConditionGroup.js +14 -5
  14. package/dist/modules/business_rules/components/ConditionGroup.js.map +2 -2
  15. package/dist/modules/business_rules/components/ConditionRow.js +19 -10
  16. package/dist/modules/business_rules/components/ConditionRow.js.map +2 -2
  17. package/dist/modules/business_rules/components/RuleSetMembers.js +16 -10
  18. package/dist/modules/business_rules/components/RuleSetMembers.js.map +2 -2
  19. package/dist/modules/catalog/backend/catalog/products/[id]/page.js +30 -34
  20. package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
  21. package/dist/modules/catalog/backend/catalog/products/create/page.js +220 -223
  22. package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
  23. package/dist/modules/catalog/components/PriceKindSettings.js +20 -19
  24. package/dist/modules/catalog/components/PriceKindSettings.js.map +2 -2
  25. package/dist/modules/catalog/components/products/ProductUomSection.js +42 -37
  26. package/dist/modules/catalog/components/products/ProductUomSection.js.map +2 -2
  27. package/dist/modules/catalog/components/products/VariantBuilder.js +22 -18
  28. package/dist/modules/catalog/components/products/VariantBuilder.js.map +2 -2
  29. package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +18 -26
  30. package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
  31. package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +4 -6
  32. package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
  33. package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js +5 -4
  34. package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js.map +2 -2
  35. package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js +19 -7
  36. package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js.map +2 -2
  37. package/dist/modules/customers/backend/customers/deals/pipeline/page.js +24 -21
  38. package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +2 -2
  39. package/dist/modules/customers/components/AddressEditor.js +24 -7
  40. package/dist/modules/customers/components/AddressEditor.js.map +2 -2
  41. package/dist/modules/customers/components/AddressFormatSettings.js +35 -25
  42. package/dist/modules/customers/components/AddressFormatSettings.js.map +2 -2
  43. package/dist/modules/customers/components/detail/ActivityForm.js +20 -12
  44. package/dist/modules/customers/components/detail/ActivityForm.js.map +2 -2
  45. package/dist/modules/customers/components/detail/AnnualRevenueField.js +2 -2
  46. package/dist/modules/customers/components/detail/AnnualRevenueField.js.map +2 -2
  47. package/dist/modules/customers/components/detail/DealForm.js +19 -14
  48. package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
  49. package/dist/modules/customers/components/formConfig.js +16 -12
  50. package/dist/modules/customers/components/formConfig.js.map +2 -2
  51. package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js +3 -2
  52. package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js.map +2 -2
  53. package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js +18 -10
  54. package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js.map +2 -2
  55. package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js +3 -2
  56. package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js.map +2 -2
  57. package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js +3 -2
  58. package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js.map +2 -2
  59. package/dist/modules/dashboards/components/WidgetVisibilityEditor.js +27 -28
  60. package/dist/modules/dashboards/components/WidgetVisibilityEditor.js.map +2 -2
  61. package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js +14 -6
  62. package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js.map +2 -2
  63. package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js +14 -6
  64. package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js.map +2 -2
  65. package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js +3 -2
  66. package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js.map +2 -2
  67. package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js +3 -2
  68. package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js.map +2 -2
  69. package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js +17 -8
  70. package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js.map +2 -2
  71. package/dist/modules/data_sync/backend/data-sync/page.js +40 -23
  72. package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
  73. package/dist/modules/data_sync/components/IntegrationScheduleTab.js +15 -6
  74. package/dist/modules/data_sync/components/IntegrationScheduleTab.js.map +2 -2
  75. package/dist/modules/dictionaries/components/AppearanceSelector.js +4 -4
  76. package/dist/modules/dictionaries/components/AppearanceSelector.js.map +2 -2
  77. package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js +4 -5
  78. package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js.map +2 -2
  79. package/dist/modules/dictionaries/components/DictionaryEntrySelect.js +22 -14
  80. package/dist/modules/dictionaries/components/DictionaryEntrySelect.js.map +2 -2
  81. package/dist/modules/dictionaries/fields/dictionary.js +18 -13
  82. package/dist/modules/dictionaries/fields/dictionary.js.map +2 -2
  83. package/dist/modules/entities/components/EncryptionManager.js +23 -19
  84. package/dist/modules/entities/components/EncryptionManager.js.map +2 -2
  85. package/dist/modules/feature_toggles/components/formConfig.js +17 -9
  86. package/dist/modules/feature_toggles/components/formConfig.js.map +2 -2
  87. package/dist/modules/feature_toggles/components/overrideFormConfig.js +17 -9
  88. package/dist/modules/feature_toggles/components/overrideFormConfig.js.map +2 -2
  89. package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js +15 -8
  90. package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js.map +2 -2
  91. package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js +37 -22
  92. package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js.map +2 -2
  93. package/dist/modules/integrations/backend/integrations/[id]/page.js +22 -17
  94. package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
  95. package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js +12 -6
  96. package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js.map +2 -2
  97. package/dist/modules/planner/components/AvailabilityRulesEditor.js +19 -12
  98. package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
  99. package/dist/modules/resources/components/ResourceCrudForm.js +15 -10
  100. package/dist/modules/resources/components/ResourceCrudForm.js.map +3 -3
  101. package/dist/modules/sales/backend/sales/documents/[id]/page.js +15 -18
  102. package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
  103. package/dist/modules/sales/components/ProviderFieldInput.js +23 -20
  104. package/dist/modules/sales/components/ProviderFieldInput.js.map +2 -2
  105. package/dist/modules/sales/components/ShippingMethodsSettings.js +25 -17
  106. package/dist/modules/sales/components/ShippingMethodsSettings.js.map +3 -3
  107. package/dist/modules/sales/components/channels/ChannelOfferForm.js +35 -42
  108. package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +2 -2
  109. package/dist/modules/sales/components/documents/AddressesSection.js +87 -90
  110. package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
  111. package/dist/modules/sales/components/documents/AdjustmentDialog.js +17 -6
  112. package/dist/modules/sales/components/documents/AdjustmentDialog.js.map +3 -3
  113. package/dist/modules/sales/components/documents/LineItemDialog.js +42 -25
  114. package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
  115. package/dist/modules/sales/components/documents/SalesDocumentForm.js +96 -87
  116. package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
  117. package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js +20 -11
  118. package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js.map +2 -2
  119. package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js +20 -11
  120. package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js.map +2 -2
  121. package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js +36 -22
  122. package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js.map +2 -2
  123. package/dist/modules/staff/components/TeamMemberForm.js +14 -9
  124. package/dist/modules/staff/components/TeamMemberForm.js.map +3 -3
  125. package/dist/modules/workflows/backend/tasks/[id]/page.js +42 -21
  126. package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
  127. package/dist/modules/workflows/components/ActivitiesEditor.js +14 -6
  128. package/dist/modules/workflows/components/ActivitiesEditor.js.map +3 -3
  129. package/dist/modules/workflows/components/DefinitionTriggersEditor.js +25 -17
  130. package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +3 -3
  131. package/dist/modules/workflows/components/EdgeEditDialog.js +48 -45
  132. package/dist/modules/workflows/components/EdgeEditDialog.js.map +2 -2
  133. package/dist/modules/workflows/components/NodeEditDialog.js +90 -90
  134. package/dist/modules/workflows/components/NodeEditDialog.js.map +2 -2
  135. package/dist/modules/workflows/components/StepsEditor.js +14 -6
  136. package/dist/modules/workflows/components/StepsEditor.js.map +3 -3
  137. package/dist/modules/workflows/components/TransitionsEditor.js +31 -26
  138. package/dist/modules/workflows/components/TransitionsEditor.js.map +3 -3
  139. package/dist/modules/workflows/components/fields/ActivityArrayEditor.js +19 -11
  140. package/dist/modules/workflows/components/fields/ActivityArrayEditor.js.map +3 -3
  141. package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js +12 -14
  142. package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js.map +2 -2
  143. package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js +24 -16
  144. package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js.map +3 -3
  145. package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js +12 -13
  146. package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js.map +2 -2
  147. package/dist/modules/workflows/components/mobile/MobileTaskForm.js +12 -8
  148. package/dist/modules/workflows/components/mobile/MobileTaskForm.js.map +2 -2
  149. package/dist/modules/workflows/frontend/checkout-demo/page.js +43 -46
  150. package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
  151. package/package.json +3 -3
  152. package/src/helpers/integration/salesUi.ts +40 -30
  153. package/src/modules/api_docs/frontend/docs/api/Explorer.tsx +25 -19
  154. package/src/modules/attachments/components/AttachmentPartitionSettings.tsx +21 -11
  155. package/src/modules/attachments/fields/attachment.tsx +4 -6
  156. package/src/modules/auth/backend/users/create/page.tsx +16 -20
  157. package/src/modules/business_rules/components/ActionRow.tsx +51 -32
  158. package/src/modules/business_rules/components/ConditionGroup.tsx +20 -9
  159. package/src/modules/business_rules/components/ConditionRow.tsx +24 -15
  160. package/src/modules/business_rules/components/RuleSetMembers.tsx +23 -13
  161. package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +47 -53
  162. package/src/modules/catalog/backend/catalog/products/create/page.tsx +84 -87
  163. package/src/modules/catalog/components/PriceKindSettings.tsx +9 -9
  164. package/src/modules/catalog/components/products/ProductUomSection.tsx +85 -83
  165. package/src/modules/catalog/components/products/VariantBuilder.tsx +49 -33
  166. package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +12 -27
  167. package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +4 -6
  168. package/src/modules/customer_accounts/widgets/injection/account-status/widget.client.tsx +5 -4
  169. package/src/modules/customers/backend/config/customers/pipeline-stages/page.tsx +28 -15
  170. package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +37 -26
  171. package/src/modules/customers/components/AddressEditor.tsx +30 -16
  172. package/src/modules/customers/components/AddressFormatSettings.tsx +25 -19
  173. package/src/modules/customers/components/detail/ActivityForm.tsx +35 -23
  174. package/src/modules/customers/components/detail/AnnualRevenueField.tsx +2 -2
  175. package/src/modules/customers/components/detail/DealForm.tsx +33 -20
  176. package/src/modules/customers/components/formConfig.tsx +25 -17
  177. package/src/modules/customers/widgets/dashboard/customer-todos/widget.client.tsx +3 -2
  178. package/src/modules/customers/widgets/dashboard/new-customers/widget.client.tsx +21 -11
  179. package/src/modules/customers/widgets/dashboard/new-deals/widget.client.tsx +3 -2
  180. package/src/modules/customers/widgets/dashboard/next-interactions/widget.client.tsx +3 -2
  181. package/src/modules/dashboards/components/WidgetVisibilityEditor.tsx +17 -22
  182. package/src/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.tsx +17 -7
  183. package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.tsx +20 -10
  184. package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.tsx +3 -2
  185. package/src/modules/dashboards/widgets/dashboard/top-customers/widget.client.tsx +3 -2
  186. package/src/modules/dashboards/widgets/dashboard/top-products/widget.client.tsx +20 -9
  187. package/src/modules/data_sync/backend/data-sync/page.tsx +64 -38
  188. package/src/modules/data_sync/components/IntegrationScheduleTab.tsx +18 -7
  189. package/src/modules/dictionaries/components/AppearanceSelector.tsx +4 -4
  190. package/src/modules/dictionaries/components/DictionaryEntriesEditor.tsx +3 -4
  191. package/src/modules/dictionaries/components/DictionaryEntrySelect.tsx +27 -21
  192. package/src/modules/dictionaries/fields/dictionary.tsx +36 -23
  193. package/src/modules/entities/components/EncryptionManager.tsx +49 -33
  194. package/src/modules/feature_toggles/components/formConfig.tsx +20 -10
  195. package/src/modules/feature_toggles/components/overrideFormConfig.tsx +20 -10
  196. package/src/modules/inbox_ops/backend/inbox-ops/settings/page.tsx +19 -10
  197. package/src/modules/inbox_ops/components/proposals/EditActionDialog.tsx +49 -26
  198. package/src/modules/integrations/backend/integrations/[id]/page.tsx +20 -11
  199. package/src/modules/integrations/backend/integrations/bundle/[id]/page.tsx +19 -9
  200. package/src/modules/planner/components/AvailabilityRulesEditor.tsx +34 -21
  201. package/src/modules/resources/components/ResourceCrudForm.tsx +24 -15
  202. package/src/modules/sales/backend/sales/documents/[id]/page.tsx +12 -15
  203. package/src/modules/sales/components/ProviderFieldInput.tsx +26 -17
  204. package/src/modules/sales/components/ShippingMethodsSettings.tsx +28 -20
  205. package/src/modules/sales/components/channels/ChannelOfferForm.tsx +51 -46
  206. package/src/modules/sales/components/documents/AddressesSection.tsx +78 -76
  207. package/src/modules/sales/components/documents/AdjustmentDialog.tsx +27 -15
  208. package/src/modules/sales/components/documents/LineItemDialog.tsx +69 -51
  209. package/src/modules/sales/components/documents/SalesDocumentForm.tsx +98 -87
  210. package/src/modules/sales/widgets/dashboard/new-orders/widget.client.tsx +23 -12
  211. package/src/modules/sales/widgets/dashboard/new-quotes/widget.client.tsx +23 -12
  212. package/src/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.tsx +35 -19
  213. package/src/modules/staff/components/TeamMemberForm.tsx +23 -14
  214. package/src/modules/workflows/backend/tasks/[id]/page.tsx +51 -23
  215. package/src/modules/workflows/components/ActivitiesEditor.tsx +20 -10
  216. package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +28 -18
  217. package/src/modules/workflows/components/EdgeEditDialog.tsx +51 -40
  218. package/src/modules/workflows/components/NodeEditDialog.tsx +81 -77
  219. package/src/modules/workflows/components/StepsEditor.tsx +20 -10
  220. package/src/modules/workflows/components/TransitionsEditor.tsx +61 -44
  221. package/src/modules/workflows/components/fields/ActivityArrayEditor.tsx +22 -12
  222. package/src/modules/workflows/components/fields/BusinessRuleConditionsEditor.tsx +9 -13
  223. package/src/modules/workflows/components/fields/FormFieldArrayEditor.tsx +27 -17
  224. package/src/modules/workflows/components/fields/StartPreConditionsEditor.tsx +9 -12
  225. package/src/modules/workflows/components/mobile/MobileTaskForm.tsx +19 -11
  226. package/src/modules/workflows/frontend/checkout-demo/page.tsx +71 -60
@@ -7,7 +7,14 @@ import { createCrud } from "@open-mercato/ui/backend/utils/crud";
7
7
  import { useGuardedMutation } from "@open-mercato/ui/backend/injection/useGuardedMutation";
8
8
  import { ErrorMessage, LoadingMessage, TabEmptyState } from "@open-mercato/ui/backend/detail";
9
9
  import { Button } from "@open-mercato/ui/primitives/button";
10
- import { Switch } from "@open-mercato/ui/primitives/switch";
10
+ import {
11
+ Select,
12
+ SelectContent,
13
+ SelectItem,
14
+ SelectTrigger,
15
+ SelectValue
16
+ } from "@open-mercato/ui/primitives/select";
17
+ import { SwitchField } from "@open-mercato/ui/primitives/switch-field";
11
18
  import { useT } from "@open-mercato/shared/lib/i18n/context";
12
19
  import { useConfirmDialog } from "@open-mercato/ui/backend/confirm-dialog";
13
20
  import { AddressEditor } from "@open-mercato/core/modules/customers/components/AddressEditor";
@@ -767,22 +774,18 @@ function SalesDocumentAddressesSection({
767
774
  useCustomBilling,
768
775
  useCustomShipping
769
776
  ]);
770
- const renderAddressSelect = (value, options, onChange, disabled) => /* @__PURE__ */ jsxs(
771
- "select",
772
- {
773
- className: "w-full rounded border px-2 py-2 text-sm",
774
- value,
775
- onChange: (evt) => onChange(evt.target.value || null),
776
- disabled,
777
- children: [
778
- /* @__PURE__ */ jsx("option", { value: "", children: addressesLoading ? t("sales.documents.form.address.loading", "Loading addresses\u2026") : t("sales.documents.form.address.placeholder", "Select address") }),
779
- options.map((addr) => {
780
- const optionLabel = addr.summary ? `${addr.label} \u2014 ${addr.summary}` : addr.label;
781
- return /* @__PURE__ */ jsx("option", { value: addr.id, children: optionLabel }, addr.id);
782
- })
783
- ]
784
- }
785
- );
777
+ const renderAddressSelect = (value, options, onChange, disabled) => /* @__PURE__ */ jsxs(Select, { value: value || void 0, onValueChange: (next) => onChange(next || null), disabled, children: [
778
+ /* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(
779
+ SelectValue,
780
+ {
781
+ placeholder: addressesLoading ? t("sales.documents.form.address.loading", "Loading addresses\u2026") : t("sales.documents.form.address.placeholder", "Select address")
782
+ }
783
+ ) }),
784
+ /* @__PURE__ */ jsx(SelectContent, { children: options.map((addr) => {
785
+ const optionLabel = addr.summary ? `${addr.label} \u2014 ${addr.summary}` : addr.label;
786
+ return /* @__PURE__ */ jsx(SelectItem, { value: addr.id, children: optionLabel }, addr.id);
787
+ }) })
788
+ ] });
786
789
  return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
787
790
  /* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-2", children: [
788
791
  lockedReason ? /* @__PURE__ */ jsx(
@@ -807,17 +810,16 @@ function SalesDocumentAddressesSection({
807
810
  /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold", children: t("sales.documents.form.shipping.title", "Shipping address") }),
808
811
  /* @__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.") })
809
812
  ] }),
810
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-sm", children: [
811
- /* @__PURE__ */ jsx(
812
- Switch,
813
- {
814
- checked: useCustomShipping,
815
- onCheckedChange: (checked) => setUseCustomShipping(checked),
816
- disabled: customerRequired || locked
817
- }
818
- ),
819
- /* @__PURE__ */ jsx("span", { children: t("sales.documents.form.shipping.custom", "Define new address") })
820
- ] })
813
+ /* @__PURE__ */ jsx(
814
+ SwitchField,
815
+ {
816
+ label: t("sales.documents.form.shipping.custom", "Define new address"),
817
+ flip: true,
818
+ checked: useCustomShipping,
819
+ onCheckedChange: (checked) => setUseCustomShipping(checked),
820
+ disabled: customerRequired || locked
821
+ }
822
+ )
821
823
  ] }),
822
824
  !useCustomShipping ? renderAddressSelect(
823
825
  shippingAddressIdState ?? "",
@@ -836,17 +838,16 @@ function SalesDocumentAddressesSection({
836
838
  hidePrimaryToggle: true
837
839
  }
838
840
  ),
839
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-sm", children: [
840
- /* @__PURE__ */ jsx(
841
- Switch,
842
- {
843
- checked: saveShippingAddress && !customerRequired,
844
- onCheckedChange: (checked) => setSaveShippingAddress(checked),
845
- disabled: customerRequired || locked
846
- }
847
- ),
848
- t("sales.documents.form.address.saveToCustomer", "Save this address to the customer")
849
- ] })
841
+ /* @__PURE__ */ jsx(
842
+ SwitchField,
843
+ {
844
+ label: t("sales.documents.form.address.saveToCustomer", "Save this address to the customer"),
845
+ flip: true,
846
+ checked: saveShippingAddress && !customerRequired,
847
+ onCheckedChange: (checked) => setSaveShippingAddress(checked),
848
+ disabled: customerRequired || locked
849
+ }
850
+ )
850
851
  ] }) : null
851
852
  ] }),
852
853
  /* @__PURE__ */ jsxs("div", { className: "space-y-3 rounded border bg-card p-4", children: [
@@ -858,24 +859,23 @@ function SalesDocumentAddressesSection({
858
859
  "Billing will mirror the shipping address. Uncheck to edit."
859
860
  ) : t("sales.documents.form.billing.hint", "Select an address or define a new one.") })
860
861
  ] }),
861
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-sm", children: [
862
- /* @__PURE__ */ jsx(
863
- Switch,
864
- {
865
- checked: sameAsShipping,
866
- onCheckedChange: (checked) => {
867
- setSameAsShipping(checked);
868
- if (checked) {
869
- setUseCustomBilling(useCustomShipping);
870
- setBillingAddressId(useCustomShipping ? null : shippingAddressIdState);
871
- setBillingDraft(useCustomShipping ? shippingDraft : emptyDraft);
872
- }
873
- },
874
- disabled: locked
875
- }
876
- ),
877
- /* @__PURE__ */ jsx("span", { children: t("sales.documents.form.address.sameAsShipping", "Same as shipping") })
878
- ] })
862
+ /* @__PURE__ */ jsx(
863
+ SwitchField,
864
+ {
865
+ label: t("sales.documents.form.address.sameAsShipping", "Same as shipping"),
866
+ flip: true,
867
+ checked: sameAsShipping,
868
+ onCheckedChange: (checked) => {
869
+ setSameAsShipping(checked);
870
+ if (checked) {
871
+ setUseCustomBilling(useCustomShipping);
872
+ setBillingAddressId(useCustomShipping ? null : shippingAddressIdState);
873
+ setBillingDraft(useCustomShipping ? shippingDraft : emptyDraft);
874
+ }
875
+ },
876
+ disabled: locked
877
+ }
878
+ )
879
879
  ] }),
880
880
  !sameAsShipping ? /* @__PURE__ */ jsxs(Fragment, { children: [
881
881
  !useCustomBilling ? renderAddressSelect(
@@ -884,17 +884,16 @@ function SalesDocumentAddressesSection({
884
884
  setBillingAddressId,
885
885
  addressesLoading || customerRequired || locked
886
886
  ) : null,
887
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-sm", children: [
888
- /* @__PURE__ */ jsx(
889
- Switch,
890
- {
891
- checked: useCustomBilling,
892
- onCheckedChange: (checked) => setUseCustomBilling(checked),
893
- disabled: customerRequired || locked
894
- }
895
- ),
896
- /* @__PURE__ */ jsx("span", { children: t("sales.documents.form.shipping.custom", "Define new address") })
897
- ] }),
887
+ /* @__PURE__ */ jsx(
888
+ SwitchField,
889
+ {
890
+ label: t("sales.documents.form.shipping.custom", "Define new address"),
891
+ flip: true,
892
+ checked: useCustomBilling,
893
+ onCheckedChange: (checked) => setUseCustomBilling(checked),
894
+ disabled: customerRequired || locked
895
+ }
896
+ ),
898
897
  useCustomBilling ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
899
898
  /* @__PURE__ */ jsx(
900
899
  AddressEditor,
@@ -906,17 +905,16 @@ function SalesDocumentAddressesSection({
906
905
  hidePrimaryToggle: true
907
906
  }
908
907
  ),
909
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-sm", children: [
910
- /* @__PURE__ */ jsx(
911
- Switch,
912
- {
913
- checked: saveBillingAddress && !customerRequired,
914
- onCheckedChange: (checked) => setSaveBillingAddress(checked),
915
- disabled: customerRequired || locked
916
- }
917
- ),
918
- t("sales.documents.form.address.saveToCustomer", "Save this address to the customer")
919
- ] })
908
+ /* @__PURE__ */ jsx(
909
+ SwitchField,
910
+ {
911
+ label: t("sales.documents.form.address.saveToCustomer", "Save this address to the customer"),
912
+ flip: true,
913
+ checked: saveBillingAddress && !customerRequired,
914
+ onCheckedChange: (checked) => setSaveBillingAddress(checked),
915
+ disabled: customerRequired || locked
916
+ }
917
+ )
920
918
  ] }) : null
921
919
  ] }) : null
922
920
  ] })
@@ -1091,17 +1089,16 @@ function SalesDocumentAddressesSection({
1091
1089
  }
1092
1090
  )
1093
1091
  ] }),
1094
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-sm", children: [
1095
- /* @__PURE__ */ jsx(
1096
- Switch,
1097
- {
1098
- checked: additionalUseCustom,
1099
- onCheckedChange: (checked) => setAdditionalUseCustom(checked),
1100
- disabled: customerRequired || locked
1101
- }
1102
- ),
1103
- /* @__PURE__ */ jsx("span", { children: t("sales.documents.form.shipping.custom", "Define new address") })
1104
- ] }),
1092
+ /* @__PURE__ */ jsx(
1093
+ SwitchField,
1094
+ {
1095
+ label: t("sales.documents.form.shipping.custom", "Define new address"),
1096
+ flip: true,
1097
+ checked: additionalUseCustom,
1098
+ onCheckedChange: (checked) => setAdditionalUseCustom(checked),
1099
+ disabled: customerRequired || locked
1100
+ }
1101
+ ),
1105
1102
  !additionalUseCustom ? renderAddressSelect(
1106
1103
  additionalSelectedId,
1107
1104
  addressOptions,