@medusajs/draft-order 2.11.2-snapshot-20251030153804 → 2.11.2-snapshot-20251030163249
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/.medusa/server/src/admin/index.js +240 -241
- package/.medusa/server/src/admin/index.mjs +239 -239
- package/package.json +31 -32
|
@@ -14,15 +14,14 @@ const reactHookForm = require("react-hook-form");
|
|
|
14
14
|
const radixUi = require("radix-ui");
|
|
15
15
|
const react = require("@ariakit/react");
|
|
16
16
|
const matchSorter = require("match-sorter");
|
|
17
|
-
const debounce = require("lodash
|
|
17
|
+
const debounce = require("lodash/debounce");
|
|
18
18
|
const Primitive = require("@uiw/react-json-view");
|
|
19
|
-
const
|
|
19
|
+
const lodash = require("lodash");
|
|
20
20
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
21
21
|
const React__default = /* @__PURE__ */ _interopDefault(React);
|
|
22
22
|
const Medusa__default = /* @__PURE__ */ _interopDefault(Medusa);
|
|
23
23
|
const debounce__default = /* @__PURE__ */ _interopDefault(debounce);
|
|
24
24
|
const Primitive__default = /* @__PURE__ */ _interopDefault(Primitive);
|
|
25
|
-
const isEqual__default = /* @__PURE__ */ _interopDefault(isEqual);
|
|
26
25
|
function useQueryParams(keys, prefix) {
|
|
27
26
|
const [params] = reactRouterDom.useSearchParams();
|
|
28
27
|
const result = {};
|
|
@@ -9572,196 +9571,27 @@ const ID = () => {
|
|
|
9572
9571
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Outlet, {})
|
|
9573
9572
|
] });
|
|
9574
9573
|
};
|
|
9575
|
-
const
|
|
9576
|
-
const { id } = reactRouterDom.useParams();
|
|
9577
|
-
const { order, isPending, isError, error } = useOrder(id, {
|
|
9578
|
-
fields: "+billing_address"
|
|
9579
|
-
});
|
|
9580
|
-
if (isError) {
|
|
9581
|
-
throw error;
|
|
9582
|
-
}
|
|
9583
|
-
const isReady = !isPending && !!order;
|
|
9574
|
+
const CustomItems = () => {
|
|
9584
9575
|
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
9585
|
-
/* @__PURE__ */ jsxRuntime.
|
|
9586
|
-
|
|
9587
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
|
|
9588
|
-
] }),
|
|
9589
|
-
isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
|
|
9576
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
|
|
9577
|
+
/* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
|
|
9590
9578
|
] });
|
|
9591
9579
|
};
|
|
9592
|
-
const
|
|
9593
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
9580
|
+
const CustomItemsForm = () => {
|
|
9594
9581
|
const form = reactHookForm.useForm({
|
|
9595
|
-
defaultValues: {
|
|
9596
|
-
first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
|
|
9597
|
-
last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
|
|
9598
|
-
company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
|
|
9599
|
-
address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
|
|
9600
|
-
address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
|
|
9601
|
-
city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
|
|
9602
|
-
province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
|
|
9603
|
-
country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
|
|
9604
|
-
postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
9605
|
-
phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
|
|
9606
|
-
},
|
|
9607
9582
|
resolver: zod.zodResolver(schema$5)
|
|
9608
9583
|
});
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
{
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
handleSuccess();
|
|
9617
|
-
},
|
|
9618
|
-
onError: (error) => {
|
|
9619
|
-
ui.toast.error(error.message);
|
|
9620
|
-
}
|
|
9621
|
-
}
|
|
9622
|
-
);
|
|
9623
|
-
});
|
|
9624
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9625
|
-
KeyboundForm,
|
|
9626
|
-
{
|
|
9627
|
-
className: "flex flex-1 flex-col overflow-hidden",
|
|
9628
|
-
onSubmit,
|
|
9629
|
-
children: [
|
|
9630
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
9631
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9632
|
-
Form$2.Field,
|
|
9633
|
-
{
|
|
9634
|
-
control: form.control,
|
|
9635
|
-
name: "country_code",
|
|
9636
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
9637
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
|
|
9638
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
|
|
9639
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
9640
|
-
] })
|
|
9641
|
-
}
|
|
9642
|
-
),
|
|
9643
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
9644
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9645
|
-
Form$2.Field,
|
|
9646
|
-
{
|
|
9647
|
-
control: form.control,
|
|
9648
|
-
name: "first_name",
|
|
9649
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
9650
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
|
|
9651
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
9652
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
9653
|
-
] })
|
|
9654
|
-
}
|
|
9655
|
-
),
|
|
9656
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9657
|
-
Form$2.Field,
|
|
9658
|
-
{
|
|
9659
|
-
control: form.control,
|
|
9660
|
-
name: "last_name",
|
|
9661
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
9662
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
|
|
9663
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
9664
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
9665
|
-
] })
|
|
9666
|
-
}
|
|
9667
|
-
)
|
|
9668
|
-
] }),
|
|
9669
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9670
|
-
Form$2.Field,
|
|
9671
|
-
{
|
|
9672
|
-
control: form.control,
|
|
9673
|
-
name: "company",
|
|
9674
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
9675
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
|
|
9676
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
9677
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
9678
|
-
] })
|
|
9679
|
-
}
|
|
9680
|
-
),
|
|
9681
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9682
|
-
Form$2.Field,
|
|
9683
|
-
{
|
|
9684
|
-
control: form.control,
|
|
9685
|
-
name: "address_1",
|
|
9686
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
9687
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
|
|
9688
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
9689
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
9690
|
-
] })
|
|
9691
|
-
}
|
|
9692
|
-
),
|
|
9693
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9694
|
-
Form$2.Field,
|
|
9695
|
-
{
|
|
9696
|
-
control: form.control,
|
|
9697
|
-
name: "address_2",
|
|
9698
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
9699
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
|
|
9700
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
9701
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
9702
|
-
] })
|
|
9703
|
-
}
|
|
9704
|
-
),
|
|
9705
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
9706
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9707
|
-
Form$2.Field,
|
|
9708
|
-
{
|
|
9709
|
-
control: form.control,
|
|
9710
|
-
name: "postal_code",
|
|
9711
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
9712
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
|
|
9713
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
9714
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
9715
|
-
] })
|
|
9716
|
-
}
|
|
9717
|
-
),
|
|
9718
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9719
|
-
Form$2.Field,
|
|
9720
|
-
{
|
|
9721
|
-
control: form.control,
|
|
9722
|
-
name: "city",
|
|
9723
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
9724
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
|
|
9725
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
9726
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
9727
|
-
] })
|
|
9728
|
-
}
|
|
9729
|
-
)
|
|
9730
|
-
] }),
|
|
9731
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9732
|
-
Form$2.Field,
|
|
9733
|
-
{
|
|
9734
|
-
control: form.control,
|
|
9735
|
-
name: "province",
|
|
9736
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
9737
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
|
|
9738
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
9739
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
9740
|
-
] })
|
|
9741
|
-
}
|
|
9742
|
-
),
|
|
9743
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9744
|
-
Form$2.Field,
|
|
9745
|
-
{
|
|
9746
|
-
control: form.control,
|
|
9747
|
-
name: "phone",
|
|
9748
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
9749
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
|
|
9750
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
9751
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
9752
|
-
] })
|
|
9753
|
-
}
|
|
9754
|
-
)
|
|
9755
|
-
] }) }),
|
|
9756
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9757
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9758
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
|
|
9759
|
-
] }) })
|
|
9760
|
-
]
|
|
9761
|
-
}
|
|
9762
|
-
) });
|
|
9584
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
9585
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
|
|
9586
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9587
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9588
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
|
|
9589
|
+
] }) })
|
|
9590
|
+
] }) });
|
|
9763
9591
|
};
|
|
9764
|
-
const schema$5 =
|
|
9592
|
+
const schema$5 = objectType({
|
|
9593
|
+
email: stringType().email()
|
|
9594
|
+
});
|
|
9765
9595
|
const Email = () => {
|
|
9766
9596
|
const { id } = reactRouterDom.useParams();
|
|
9767
9597
|
const { order, isPending, isError, error } = useOrder(id, {
|
|
@@ -9830,27 +9660,6 @@ const EmailForm = ({ order }) => {
|
|
|
9830
9660
|
const schema$4 = objectType({
|
|
9831
9661
|
email: stringType().email()
|
|
9832
9662
|
});
|
|
9833
|
-
const CustomItems = () => {
|
|
9834
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
9835
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
|
|
9836
|
-
/* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
|
|
9837
|
-
] });
|
|
9838
|
-
};
|
|
9839
|
-
const CustomItemsForm = () => {
|
|
9840
|
-
const form = reactHookForm.useForm({
|
|
9841
|
-
resolver: zod.zodResolver(schema$3)
|
|
9842
|
-
});
|
|
9843
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
9844
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
|
|
9845
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9846
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9847
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
|
|
9848
|
-
] }) })
|
|
9849
|
-
] }) });
|
|
9850
|
-
};
|
|
9851
|
-
const schema$3 = objectType({
|
|
9852
|
-
email: stringType().email()
|
|
9853
|
-
});
|
|
9854
9663
|
const NumberInput = React.forwardRef(
|
|
9855
9664
|
({
|
|
9856
9665
|
value,
|
|
@@ -11480,7 +11289,7 @@ const SalesChannelForm = ({ order }) => {
|
|
|
11480
11289
|
defaultValues: {
|
|
11481
11290
|
sales_channel_id: order.sales_channel_id || ""
|
|
11482
11291
|
},
|
|
11483
|
-
resolver: zod.zodResolver(schema$
|
|
11292
|
+
resolver: zod.zodResolver(schema$3)
|
|
11484
11293
|
});
|
|
11485
11294
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
11486
11295
|
const { handleSuccess } = useRouteModal();
|
|
@@ -11555,7 +11364,7 @@ const SalesChannelField = ({ control, order }) => {
|
|
|
11555
11364
|
}
|
|
11556
11365
|
);
|
|
11557
11366
|
};
|
|
11558
|
-
const schema$
|
|
11367
|
+
const schema$3 = objectType({
|
|
11559
11368
|
sales_channel_id: stringType().min(1)
|
|
11560
11369
|
});
|
|
11561
11370
|
const STACKED_FOCUS_MODAL_ID = "shipping-form";
|
|
@@ -11583,7 +11392,7 @@ const Shipping = () => {
|
|
|
11583
11392
|
const isReady = preview && !isPreviewPending && order && !isPending;
|
|
11584
11393
|
return /* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal, { onClose: onCancel, children: !orderHasItems ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col overflow-hidden ", children: [
|
|
11585
11394
|
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Header, {}),
|
|
11586
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 px-6
|
|
11395
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 py-16 px-6", children: [
|
|
11587
11396
|
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Shipping" }) }),
|
|
11588
11397
|
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", className: "text-ui-fg-subtle", children: "This draft order currently has no items. Add items to the order before adding shipping." }) })
|
|
11589
11398
|
] }) }) }),
|
|
@@ -11670,14 +11479,14 @@ const ShippingForm = ({ preview, order }) => {
|
|
|
11670
11479
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
|
|
11671
11480
|
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Header, {}),
|
|
11672
11481
|
/* @__PURE__ */ jsxRuntime.jsxs(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
11673
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 px-6
|
|
11482
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 py-16 px-6", children: [
|
|
11674
11483
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
11675
11484
|
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Shipping" }) }),
|
|
11676
11485
|
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", className: "text-ui-fg-subtle", children: "Choose which shipping method(s) to use for the items in the order." }) })
|
|
11677
11486
|
] }),
|
|
11678
11487
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Divider, { variant: "dashed" }),
|
|
11679
|
-
/* @__PURE__ */ jsxRuntime.jsx(radixUi.Accordion.Root, { type: "multiple", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-ui-bg-subtle shadow-elevation-card-rest
|
|
11680
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between
|
|
11488
|
+
/* @__PURE__ */ jsxRuntime.jsx(radixUi.Accordion.Root, { type: "multiple", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-ui-bg-subtle rounded-xl shadow-elevation-card-rest", children: [
|
|
11489
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 py-2 flex items-center justify-between", children: [
|
|
11681
11490
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11682
11491
|
ui.Text,
|
|
11683
11492
|
{
|
|
@@ -11719,8 +11528,8 @@ const ShippingForm = ({ preview, order }) => {
|
|
|
11719
11528
|
value: profile.id,
|
|
11720
11529
|
className: "bg-ui-bg-base shadow-elevation-card-rest rounded-lg",
|
|
11721
11530
|
children: [
|
|
11722
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3
|
|
11723
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex
|
|
11531
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-2 flex items-center justify-between gap-3", children: [
|
|
11532
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-x-3 w-full overflow-hidden", children: [
|
|
11724
11533
|
/* @__PURE__ */ jsxRuntime.jsx(radixUi.Accordion.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11725
11534
|
ui.IconButton,
|
|
11726
11535
|
{
|
|
@@ -11728,12 +11537,12 @@ const ShippingForm = ({ preview, order }) => {
|
|
|
11728
11537
|
variant: "transparent",
|
|
11729
11538
|
className: "group/trigger",
|
|
11730
11539
|
disabled: !hasItems,
|
|
11731
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(icons.TriangleRightMini, { className: "
|
|
11540
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.TriangleRightMini, { className: "group-data-[state=open]/trigger:rotate-90 transition-transform" })
|
|
11732
11541
|
}
|
|
11733
11542
|
) }),
|
|
11734
11543
|
!shippingOption ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-x-3", children: [
|
|
11735
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "shadow-borders-base flex
|
|
11736
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-
|
|
11544
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-7 rounded-md shadow-borders-base flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-6 rounded bg-ui-bg-component-hover flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(icons.Shopping, { className: "text-ui-fg-subtle" }) }) }),
|
|
11545
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col flex-1", children: [
|
|
11737
11546
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11738
11547
|
ui.Text,
|
|
11739
11548
|
{
|
|
@@ -11757,7 +11566,7 @@ const ShippingForm = ({ preview, order }) => {
|
|
|
11757
11566
|
}
|
|
11758
11567
|
)
|
|
11759
11568
|
] })
|
|
11760
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex
|
|
11569
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-[5px] max-sm:flex-col max-sm:items-start flex-1 w-full overflow-hidden", children: [
|
|
11761
11570
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11762
11571
|
ui.Tooltip,
|
|
11763
11572
|
{
|
|
@@ -11774,7 +11583,7 @@ const ShippingForm = ({ preview, order }) => {
|
|
|
11774
11583
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11775
11584
|
ui.Badge,
|
|
11776
11585
|
{
|
|
11777
|
-
className: "flex
|
|
11586
|
+
className: "flex items-center gap-x-[3px] overflow-hidden cursor-default",
|
|
11778
11587
|
size: "xsmall",
|
|
11779
11588
|
children: [
|
|
11780
11589
|
/* @__PURE__ */ jsxRuntime.jsx(icons.Shopping, { className: "shrink-0" }),
|
|
@@ -11799,7 +11608,7 @@ const ShippingForm = ({ preview, order }) => {
|
|
|
11799
11608
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11800
11609
|
ui.Badge,
|
|
11801
11610
|
{
|
|
11802
|
-
className: "flex
|
|
11611
|
+
className: "flex items-center gap-x-[3px] overflow-hidden cursor-default",
|
|
11803
11612
|
size: "xsmall",
|
|
11804
11613
|
children: [
|
|
11805
11614
|
/* @__PURE__ */ jsxRuntime.jsx(icons.Buildings, { className: "shrink-0" }),
|
|
@@ -11812,7 +11621,7 @@ const ShippingForm = ({ preview, order }) => {
|
|
|
11812
11621
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { content: shippingOption.name, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11813
11622
|
ui.Badge,
|
|
11814
11623
|
{
|
|
11815
|
-
className: "flex
|
|
11624
|
+
className: "flex items-center gap-x-[3px] overflow-hidden cursor-default",
|
|
11816
11625
|
size: "xsmall",
|
|
11817
11626
|
children: [
|
|
11818
11627
|
/* @__PURE__ */ jsxRuntime.jsx(icons.TruckFast, { className: "shrink-0" }),
|
|
@@ -11883,17 +11692,17 @@ const ShippingForm = ({ preview, order }) => {
|
|
|
11883
11692
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11884
11693
|
"div",
|
|
11885
11694
|
{
|
|
11886
|
-
className: "flex items-center gap-x-3
|
|
11695
|
+
className: "px-3 flex items-center gap-x-3",
|
|
11887
11696
|
children: [
|
|
11888
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "
|
|
11697
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-5 h-[56px] flex flex-col justify-center items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11889
11698
|
ui.Divider,
|
|
11890
11699
|
{
|
|
11891
11700
|
variant: "dashed",
|
|
11892
11701
|
orientation: "vertical"
|
|
11893
11702
|
}
|
|
11894
11703
|
) }),
|
|
11895
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-x-3
|
|
11896
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "
|
|
11704
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "py-2 flex items-center gap-x-3", children: [
|
|
11705
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-7 flex items-center justify-center tabular-nums", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11897
11706
|
ui.Text,
|
|
11898
11707
|
{
|
|
11899
11708
|
size: "small",
|
|
@@ -12030,7 +11839,7 @@ const ShippingProfileForm = ({
|
|
|
12030
11839
|
isPending: isUpdatingShippingMethod
|
|
12031
11840
|
} = useDraftOrderUpdateShippingMethod(order.id);
|
|
12032
11841
|
const onSubmit = form.handleSubmit(async (values) => {
|
|
12033
|
-
if (
|
|
11842
|
+
if (lodash.isEqual(values, form.formState.defaultValues)) {
|
|
12034
11843
|
setIsOpen(STACKED_FOCUS_MODAL_ID, false);
|
|
12035
11844
|
return;
|
|
12036
11845
|
}
|
|
@@ -12074,7 +11883,7 @@ const ShippingProfileForm = ({
|
|
|
12074
11883
|
onSubmit,
|
|
12075
11884
|
children: [
|
|
12076
11885
|
/* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Header, {}),
|
|
12077
|
-
/* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 px-6
|
|
11886
|
+
/* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 py-16 px-6", children: [
|
|
12078
11887
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
12079
11888
|
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Shipping" }) }),
|
|
12080
11889
|
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", className: "text-ui-fg-subtle", children: "Add a shipping method for the selected shipping profile. You can see the items that will be shipped using this method in the preview below." }) })
|
|
@@ -12147,14 +11956,14 @@ const ItemsPreview = ({ order, shippingProfileId }) => {
|
|
|
12147
11956
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", className: "text-ui-fg-subtle", children: "Items with the selected shipping profile." })
|
|
12148
11957
|
] }) }),
|
|
12149
11958
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-ui-bg-subtle shadow-elevation-card-rest rounded-xl", children: [
|
|
12150
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "
|
|
11959
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3 px-4 py-2 text-ui-fg-muted", children: [
|
|
12151
11960
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", weight: "plus", children: "Item" }) }),
|
|
12152
11961
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", weight: "plus", children: "Quantity" }) })
|
|
12153
11962
|
] }),
|
|
12154
11963
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-y-1.5 px-[5px] pb-[5px]", children: matches.length > 0 ? matches == null ? void 0 : matches.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12155
11964
|
"div",
|
|
12156
11965
|
{
|
|
12157
|
-
className: "bg-ui-bg-base shadow-elevation-card-rest
|
|
11966
|
+
className: "grid grid-cols-2 gap-3 px-4 py-2 bg-ui-bg-base shadow-elevation-card-rest rounded-lg items-center",
|
|
12158
11967
|
children: [
|
|
12159
11968
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-x-3", children: [
|
|
12160
11969
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12207,7 +12016,7 @@ const ItemsPreview = ({ order, shippingProfileId }) => {
|
|
|
12207
12016
|
]
|
|
12208
12017
|
},
|
|
12209
12018
|
item.id
|
|
12210
|
-
)) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-ui-bg-base shadow-elevation-card-rest flex
|
|
12019
|
+
)) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-x-3 bg-ui-bg-base rounded-lg p-4 shadow-elevation-card-rest flex-col gap-1", children: [
|
|
12211
12020
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", weight: "plus", leading: "compact", children: "No items found" }),
|
|
12212
12021
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.Text, { size: "small", className: "text-ui-fg-subtle", children: [
|
|
12213
12022
|
'No items found for "',
|
|
@@ -12397,7 +12206,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12397
12206
|
postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
12398
12207
|
phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
|
|
12399
12208
|
},
|
|
12400
|
-
resolver: zod.zodResolver(schema$
|
|
12209
|
+
resolver: zod.zodResolver(schema$2)
|
|
12401
12210
|
});
|
|
12402
12211
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12403
12212
|
const { handleSuccess } = useRouteModal();
|
|
@@ -12567,7 +12376,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12567
12376
|
}
|
|
12568
12377
|
) });
|
|
12569
12378
|
};
|
|
12570
|
-
const schema$
|
|
12379
|
+
const schema$2 = addressSchema;
|
|
12571
12380
|
const TransferOwnership = () => {
|
|
12572
12381
|
const { id } = reactRouterDom.useParams();
|
|
12573
12382
|
const { draft_order, isPending, isError, error } = useDraftOrder(id, {
|
|
@@ -12591,7 +12400,7 @@ const TransferOwnershipForm = ({ order }) => {
|
|
|
12591
12400
|
defaultValues: {
|
|
12592
12401
|
customer_id: order.customer_id || ""
|
|
12593
12402
|
},
|
|
12594
|
-
resolver: zod.zodResolver(schema)
|
|
12403
|
+
resolver: zod.zodResolver(schema$1)
|
|
12595
12404
|
});
|
|
12596
12405
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12597
12406
|
const { handleSuccess } = useRouteModal();
|
|
@@ -13041,9 +12850,199 @@ const Illustration = () => {
|
|
|
13041
12850
|
}
|
|
13042
12851
|
);
|
|
13043
12852
|
};
|
|
13044
|
-
const schema = objectType({
|
|
12853
|
+
const schema$1 = objectType({
|
|
13045
12854
|
customer_id: stringType().min(1)
|
|
13046
12855
|
});
|
|
12856
|
+
const BillingAddress = () => {
|
|
12857
|
+
const { id } = reactRouterDom.useParams();
|
|
12858
|
+
const { order, isPending, isError, error } = useOrder(id, {
|
|
12859
|
+
fields: "+billing_address"
|
|
12860
|
+
});
|
|
12861
|
+
if (isError) {
|
|
12862
|
+
throw error;
|
|
12863
|
+
}
|
|
12864
|
+
const isReady = !isPending && !!order;
|
|
12865
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
12866
|
+
/* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
|
|
12867
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
|
|
12868
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
|
|
12869
|
+
] }),
|
|
12870
|
+
isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
|
|
12871
|
+
] });
|
|
12872
|
+
};
|
|
12873
|
+
const BillingAddressForm = ({ order }) => {
|
|
12874
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
12875
|
+
const form = reactHookForm.useForm({
|
|
12876
|
+
defaultValues: {
|
|
12877
|
+
first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
|
|
12878
|
+
last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
|
|
12879
|
+
company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
|
|
12880
|
+
address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
|
|
12881
|
+
address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
|
|
12882
|
+
city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
|
|
12883
|
+
province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
|
|
12884
|
+
country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
|
|
12885
|
+
postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
12886
|
+
phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
|
|
12887
|
+
},
|
|
12888
|
+
resolver: zod.zodResolver(schema)
|
|
12889
|
+
});
|
|
12890
|
+
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12891
|
+
const { handleSuccess } = useRouteModal();
|
|
12892
|
+
const onSubmit = form.handleSubmit(async (data) => {
|
|
12893
|
+
await mutateAsync(
|
|
12894
|
+
{ billing_address: data },
|
|
12895
|
+
{
|
|
12896
|
+
onSuccess: () => {
|
|
12897
|
+
handleSuccess();
|
|
12898
|
+
},
|
|
12899
|
+
onError: (error) => {
|
|
12900
|
+
ui.toast.error(error.message);
|
|
12901
|
+
}
|
|
12902
|
+
}
|
|
12903
|
+
);
|
|
12904
|
+
});
|
|
12905
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12906
|
+
KeyboundForm,
|
|
12907
|
+
{
|
|
12908
|
+
className: "flex flex-1 flex-col overflow-hidden",
|
|
12909
|
+
onSubmit,
|
|
12910
|
+
children: [
|
|
12911
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
12912
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12913
|
+
Form$2.Field,
|
|
12914
|
+
{
|
|
12915
|
+
control: form.control,
|
|
12916
|
+
name: "country_code",
|
|
12917
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
12918
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
|
|
12919
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
|
|
12920
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
12921
|
+
] })
|
|
12922
|
+
}
|
|
12923
|
+
),
|
|
12924
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
12925
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12926
|
+
Form$2.Field,
|
|
12927
|
+
{
|
|
12928
|
+
control: form.control,
|
|
12929
|
+
name: "first_name",
|
|
12930
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
12931
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
|
|
12932
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
12933
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
12934
|
+
] })
|
|
12935
|
+
}
|
|
12936
|
+
),
|
|
12937
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12938
|
+
Form$2.Field,
|
|
12939
|
+
{
|
|
12940
|
+
control: form.control,
|
|
12941
|
+
name: "last_name",
|
|
12942
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
12943
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
|
|
12944
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
12945
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
12946
|
+
] })
|
|
12947
|
+
}
|
|
12948
|
+
)
|
|
12949
|
+
] }),
|
|
12950
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12951
|
+
Form$2.Field,
|
|
12952
|
+
{
|
|
12953
|
+
control: form.control,
|
|
12954
|
+
name: "company",
|
|
12955
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
12956
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
|
|
12957
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
12958
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
12959
|
+
] })
|
|
12960
|
+
}
|
|
12961
|
+
),
|
|
12962
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12963
|
+
Form$2.Field,
|
|
12964
|
+
{
|
|
12965
|
+
control: form.control,
|
|
12966
|
+
name: "address_1",
|
|
12967
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
12968
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
|
|
12969
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
12970
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
12971
|
+
] })
|
|
12972
|
+
}
|
|
12973
|
+
),
|
|
12974
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12975
|
+
Form$2.Field,
|
|
12976
|
+
{
|
|
12977
|
+
control: form.control,
|
|
12978
|
+
name: "address_2",
|
|
12979
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
12980
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
|
|
12981
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
12982
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
12983
|
+
] })
|
|
12984
|
+
}
|
|
12985
|
+
),
|
|
12986
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
12987
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12988
|
+
Form$2.Field,
|
|
12989
|
+
{
|
|
12990
|
+
control: form.control,
|
|
12991
|
+
name: "postal_code",
|
|
12992
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
12993
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
|
|
12994
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
12995
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
12996
|
+
] })
|
|
12997
|
+
}
|
|
12998
|
+
),
|
|
12999
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13000
|
+
Form$2.Field,
|
|
13001
|
+
{
|
|
13002
|
+
control: form.control,
|
|
13003
|
+
name: "city",
|
|
13004
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
13005
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
|
|
13006
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
13007
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
13008
|
+
] })
|
|
13009
|
+
}
|
|
13010
|
+
)
|
|
13011
|
+
] }),
|
|
13012
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13013
|
+
Form$2.Field,
|
|
13014
|
+
{
|
|
13015
|
+
control: form.control,
|
|
13016
|
+
name: "province",
|
|
13017
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
13018
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
|
|
13019
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
13020
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
13021
|
+
] })
|
|
13022
|
+
}
|
|
13023
|
+
),
|
|
13024
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13025
|
+
Form$2.Field,
|
|
13026
|
+
{
|
|
13027
|
+
control: form.control,
|
|
13028
|
+
name: "phone",
|
|
13029
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
13030
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
|
|
13031
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
13032
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
13033
|
+
] })
|
|
13034
|
+
}
|
|
13035
|
+
)
|
|
13036
|
+
] }) }),
|
|
13037
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
13038
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
13039
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
|
|
13040
|
+
] }) })
|
|
13041
|
+
]
|
|
13042
|
+
}
|
|
13043
|
+
) });
|
|
13044
|
+
};
|
|
13045
|
+
const schema = addressSchema;
|
|
13047
13046
|
const widgetModule = { widgets: [] };
|
|
13048
13047
|
const routeModule = {
|
|
13049
13048
|
routes: [
|
|
@@ -13065,17 +13064,13 @@ const routeModule = {
|
|
|
13065
13064
|
loader,
|
|
13066
13065
|
children: [
|
|
13067
13066
|
{
|
|
13068
|
-
Component:
|
|
13069
|
-
path: "/draft-orders/:id/
|
|
13067
|
+
Component: CustomItems,
|
|
13068
|
+
path: "/draft-orders/:id/custom-items"
|
|
13070
13069
|
},
|
|
13071
13070
|
{
|
|
13072
13071
|
Component: Email,
|
|
13073
13072
|
path: "/draft-orders/:id/email"
|
|
13074
13073
|
},
|
|
13075
|
-
{
|
|
13076
|
-
Component: CustomItems,
|
|
13077
|
-
path: "/draft-orders/:id/custom-items"
|
|
13078
|
-
},
|
|
13079
13074
|
{
|
|
13080
13075
|
Component: Items,
|
|
13081
13076
|
path: "/draft-orders/:id/items"
|
|
@@ -13103,6 +13098,10 @@ const routeModule = {
|
|
|
13103
13098
|
{
|
|
13104
13099
|
Component: TransferOwnership,
|
|
13105
13100
|
path: "/draft-orders/:id/transfer-ownership"
|
|
13101
|
+
},
|
|
13102
|
+
{
|
|
13103
|
+
Component: BillingAddress,
|
|
13104
|
+
path: "/draft-orders/:id/billing-address"
|
|
13106
13105
|
}
|
|
13107
13106
|
]
|
|
13108
13107
|
}
|