@betterstore/react 0.2.27 → 0.2.29
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/CHANGELOG.md +12 -0
- package/dist/index.cjs.js +5 -3
- package/dist/index.mjs +5 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -32560,6 +32560,10 @@ function AddressInput() {
|
|
|
32560
32560
|
try {
|
|
32561
32561
|
const isValid = yield form.trigger("address");
|
|
32562
32562
|
if (!isValid) {
|
|
32563
|
+
form.setError("address", {
|
|
32564
|
+
message: "invalid_address",
|
|
32565
|
+
type: "custom",
|
|
32566
|
+
});
|
|
32563
32567
|
return;
|
|
32564
32568
|
}
|
|
32565
32569
|
const newAddress = form.getValues("address");
|
|
@@ -32573,7 +32577,6 @@ function AddressInput() {
|
|
|
32573
32577
|
React.useEffect(() => {
|
|
32574
32578
|
if (open)
|
|
32575
32579
|
return;
|
|
32576
|
-
console.log("Validation Func Rerun");
|
|
32577
32580
|
const isAddressInvalid = form.getFieldState("address").invalid;
|
|
32578
32581
|
if (isAddressInvalid) {
|
|
32579
32582
|
form.setError("address", {
|
|
@@ -32585,7 +32588,6 @@ function AddressInput() {
|
|
|
32585
32588
|
form.clearErrors("address");
|
|
32586
32589
|
}
|
|
32587
32590
|
}, [open]);
|
|
32588
|
-
console.log("Address Input Rerendered");
|
|
32589
32591
|
return (React.createElement("div", { className: "w-full md:col-span-2" },
|
|
32590
32592
|
React.createElement(Dialog, { open: open, onOpenChange: setOpen },
|
|
32591
32593
|
React.createElement(DialogTrigger, { asChild: true },
|
|
@@ -32595,7 +32597,7 @@ function AddressInput() {
|
|
|
32595
32597
|
React.createElement(FormControl, null,
|
|
32596
32598
|
React.createElement(Input, { placeholder: t("CheckoutEmbed.CustomerForm.address.addressPlaceholder"), value: (currentValue === null || currentValue === void 0 ? void 0 : currentValue.line1) ? formatAddress(currentValue) : "", readOnly: true, className: "cursor-pointer" })),
|
|
32597
32599
|
React.createElement(FormMessage, null))) }))),
|
|
32598
|
-
React.createElement(DialogContent, { className: "sm:max-w-[500px]
|
|
32600
|
+
React.createElement(DialogContent, { className: "sm:max-w-[500px]" },
|
|
32599
32601
|
React.createElement("div", { className: "relative" },
|
|
32600
32602
|
React.createElement(DialogHeader, null,
|
|
32601
32603
|
React.createElement(DialogTitle, null, t("CheckoutEmbed.CustomerForm.address.title")),
|
package/dist/index.mjs
CHANGED
|
@@ -32537,6 +32537,10 @@ function AddressInput() {
|
|
|
32537
32537
|
try {
|
|
32538
32538
|
const isValid = yield form.trigger("address");
|
|
32539
32539
|
if (!isValid) {
|
|
32540
|
+
form.setError("address", {
|
|
32541
|
+
message: "invalid_address",
|
|
32542
|
+
type: "custom",
|
|
32543
|
+
});
|
|
32540
32544
|
return;
|
|
32541
32545
|
}
|
|
32542
32546
|
const newAddress = form.getValues("address");
|
|
@@ -32550,7 +32554,6 @@ function AddressInput() {
|
|
|
32550
32554
|
useEffect(() => {
|
|
32551
32555
|
if (open)
|
|
32552
32556
|
return;
|
|
32553
|
-
console.log("Validation Func Rerun");
|
|
32554
32557
|
const isAddressInvalid = form.getFieldState("address").invalid;
|
|
32555
32558
|
if (isAddressInvalid) {
|
|
32556
32559
|
form.setError("address", {
|
|
@@ -32562,7 +32565,6 @@ function AddressInput() {
|
|
|
32562
32565
|
form.clearErrors("address");
|
|
32563
32566
|
}
|
|
32564
32567
|
}, [open]);
|
|
32565
|
-
console.log("Address Input Rerendered");
|
|
32566
32568
|
return (React__default.createElement("div", { className: "w-full md:col-span-2" },
|
|
32567
32569
|
React__default.createElement(Dialog, { open: open, onOpenChange: setOpen },
|
|
32568
32570
|
React__default.createElement(DialogTrigger, { asChild: true },
|
|
@@ -32572,7 +32574,7 @@ function AddressInput() {
|
|
|
32572
32574
|
React__default.createElement(FormControl, null,
|
|
32573
32575
|
React__default.createElement(Input, { placeholder: t("CheckoutEmbed.CustomerForm.address.addressPlaceholder"), value: (currentValue === null || currentValue === void 0 ? void 0 : currentValue.line1) ? formatAddress(currentValue) : "", readOnly: true, className: "cursor-pointer" })),
|
|
32574
32576
|
React__default.createElement(FormMessage, null))) }))),
|
|
32575
|
-
React__default.createElement(DialogContent, { className: "sm:max-w-[500px]
|
|
32577
|
+
React__default.createElement(DialogContent, { className: "sm:max-w-[500px]" },
|
|
32576
32578
|
React__default.createElement("div", { className: "relative" },
|
|
32577
32579
|
React__default.createElement(DialogHeader, null,
|
|
32578
32580
|
React__default.createElement(DialogTitle, null, t("CheckoutEmbed.CustomerForm.address.title")),
|