@miden-npm/react 0.0.12 → 0.0.13
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/index.cjs +12 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1618,6 +1618,7 @@ var BaseInput = ({
|
|
|
1618
1618
|
disabled = false,
|
|
1619
1619
|
loading = false,
|
|
1620
1620
|
showCopyIcon = false,
|
|
1621
|
+
preventPaste = false,
|
|
1621
1622
|
value,
|
|
1622
1623
|
defaultValue,
|
|
1623
1624
|
onChange,
|
|
@@ -1645,17 +1646,18 @@ var BaseInput = ({
|
|
|
1645
1646
|
el.selectionStart = el.selectionEnd = el.value.length;
|
|
1646
1647
|
});
|
|
1647
1648
|
};
|
|
1648
|
-
const handleStringChange = (e) => {
|
|
1649
|
-
const incoming = e.replace(/,/g, "");
|
|
1650
|
-
if (!isControlled) setRawValue(incoming);
|
|
1651
|
-
onChange?.(incoming);
|
|
1652
|
-
};
|
|
1653
1649
|
const handleBlur = () => {
|
|
1654
1650
|
onBlur?.(rawValue);
|
|
1655
1651
|
};
|
|
1656
1652
|
const handleKeyDown = (e) => {
|
|
1657
1653
|
if (rules.includes("numeric")) restrictToNumericKeys(e);
|
|
1658
1654
|
};
|
|
1655
|
+
const handlePaste = (e) => {
|
|
1656
|
+
if (preventPaste) {
|
|
1657
|
+
e.preventDefault();
|
|
1658
|
+
setLocalError("Pasting is disabled for this input");
|
|
1659
|
+
}
|
|
1660
|
+
};
|
|
1659
1661
|
const containerBg = disabled ? "bg-grey-50 cursor-not-allowed" : "bg-white";
|
|
1660
1662
|
const containerBorder = validationError || localError ? "border-red-300 bg-red-50" : "border-grey-100";
|
|
1661
1663
|
const copyToClipboard = (text) => {
|
|
@@ -1664,7 +1666,7 @@ var BaseInput = ({
|
|
|
1664
1666
|
const copyHandler = () => {
|
|
1665
1667
|
copyToClipboard(rawValue).then(() => {
|
|
1666
1668
|
setLocalHint("Text copied to clipboard");
|
|
1667
|
-
}).catch((
|
|
1669
|
+
}).catch(() => {
|
|
1668
1670
|
setLocalError("Failed to copy text to clipboard");
|
|
1669
1671
|
});
|
|
1670
1672
|
};
|
|
@@ -1688,6 +1690,7 @@ var BaseInput = ({
|
|
|
1688
1690
|
onChange: handleChange,
|
|
1689
1691
|
onBlur: handleBlur,
|
|
1690
1692
|
onKeyDown: handleKeyDown,
|
|
1693
|
+
onPaste: handlePaste,
|
|
1691
1694
|
disabled,
|
|
1692
1695
|
placeholder: placeholder ?? (label ? `Enter ${label.toLowerCase()}` : void 0),
|
|
1693
1696
|
inputMode: isAmountInput ? "decimal" : void 0,
|
|
@@ -1707,10 +1710,7 @@ var BaseInput = ({
|
|
|
1707
1710
|
onClick: copyHandler
|
|
1708
1711
|
}
|
|
1709
1712
|
)
|
|
1710
|
-
] }) : (
|
|
1711
|
-
// Simple loader placeholder; swap for your icon component if desired
|
|
1712
|
-
/* @__PURE__ */ jsx24("div", { className: "animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full" })
|
|
1713
|
-
)
|
|
1713
|
+
] }) : /* @__PURE__ */ jsx24("div", { className: "animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full" })
|
|
1714
1714
|
]
|
|
1715
1715
|
}
|
|
1716
1716
|
),
|
|
@@ -1787,7 +1787,7 @@ function BzpCheckoutIframe({
|
|
|
1787
1787
|
setMessage("Payment link created successfully");
|
|
1788
1788
|
if (response.launchUrl) {
|
|
1789
1789
|
setLoading(false);
|
|
1790
|
-
launchIframe(response.launchUrl);
|
|
1790
|
+
launchIframe(`${response.launchUrl}&merchantId=${btoa(secretKey)}`);
|
|
1791
1791
|
}
|
|
1792
1792
|
} else {
|
|
1793
1793
|
setLoading(false);
|
|
@@ -2338,6 +2338,7 @@ function PayByCard({
|
|
|
2338
2338
|
mask: "0000 0000 0000 0000",
|
|
2339
2339
|
placeholder: "0000 0000 0000 0000",
|
|
2340
2340
|
value: payForm.cardNo,
|
|
2341
|
+
preventPaste: true,
|
|
2341
2342
|
onChange: (e) => {
|
|
2342
2343
|
setPayForm({ ...payForm, cardNo: e });
|
|
2343
2344
|
if (payErrors.cardNo)
|