@openzeppelin/ui-components 1.2.0 → 1.2.1
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 +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +13 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -2713,7 +2713,7 @@ BooleanField.displayName = "BooleanField";
|
|
|
2713
2713
|
* 4. BaseField provides consistent layout and hook form integration
|
|
2714
2714
|
* 5. This component handles bytes-specific validation and formatting
|
|
2715
2715
|
*/
|
|
2716
|
-
function BytesField({ id, label, helperText, control, name, width = "full", validation, placeholder = "Enter hex or base64 encoded bytes", rows = 3, maxBytes, acceptedFormats = "both", autoPrefix = false, allowHexPrefix = true, readOnly }) {
|
|
2716
|
+
function BytesField({ id, label, helperText, control, name, width = "full", validation, placeholder = "Enter hex or base64 encoded bytes", rows = 3, maxBytes, exactBytes, acceptedFormats = "both", autoPrefix = false, allowHexPrefix = true, readOnly }) {
|
|
2717
2717
|
const isRequired = !!validation?.required;
|
|
2718
2718
|
const errorId = `${id}-error`;
|
|
2719
2719
|
const descriptionId = `${id}-description`;
|
|
@@ -2724,6 +2724,7 @@ function BytesField({ id, label, helperText, control, name, width = "full", vali
|
|
|
2724
2724
|
return (0, _openzeppelin_ui_utils.validateBytesSimple)(value, {
|
|
2725
2725
|
acceptedFormats,
|
|
2726
2726
|
maxBytes,
|
|
2727
|
+
exactBytes,
|
|
2727
2728
|
allowHexPrefix
|
|
2728
2729
|
});
|
|
2729
2730
|
};
|
|
@@ -2799,7 +2800,8 @@ function BytesField({ id, label, helperText, control, name, width = "full", vali
|
|
|
2799
2800
|
acceptedFormats === "hex" && "Hex format (e.g., 48656c6c6f or 0x48656c6c6f)",
|
|
2800
2801
|
acceptedFormats === "base64" && "Base64 format (e.g., SGVsbG8=)",
|
|
2801
2802
|
acceptedFormats === "both" && "Hex (e.g., 48656c6c6f) or Base64 (e.g., SGVsbG8=) format",
|
|
2802
|
-
|
|
2803
|
+
exactBytes && ` • Exactly ${exactBytes} bytes (${exactBytes * 2} hex chars)`,
|
|
2804
|
+
!exactBytes && maxBytes && ` • Max ${maxBytes} bytes`
|
|
2803
2805
|
]
|
|
2804
2806
|
})]
|
|
2805
2807
|
}),
|