hi-tm 0.13.6 → 0.13.7

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.
@@ -38,7 +38,6 @@ const react_1 = __importStar(require("react"));
38
38
  const InputCurrency = (0, react_1.forwardRef)(({ placeholder, value, required, currencyUnit, textError, label, autoComplete, autoFocus, inlineCss, onChangeValueHandler, onBlurHandler, onFocusHandler, onKeyUpHandler, onKeyDownHandler, disabled = false, }, ref) => {
39
39
  const [inputValue, setInputValue] = (0, react_1.useState)(value?.toString() || "");
40
40
  const internalRef = (0, react_1.useRef)(null);
41
- // Combine the external ref with the internal ref
42
41
  react_1.default.useImperativeHandle(ref, () => internalRef.current);
43
42
  (0, react_1.useEffect)(() => {
44
43
  if (value !== null) {
@@ -52,7 +51,7 @@ const InputCurrency = (0, react_1.forwardRef)(({ placeholder, value, required, c
52
51
  }
53
52
  }, [value]);
54
53
  const isErrorVisible = () => {
55
- return !(textError && textError.trim() !== "");
54
+ return !textError || textError.trim() === "";
56
55
  };
57
56
  const handleChange = (event) => {
58
57
  const newValue = event.target.value;
@@ -85,7 +84,7 @@ const InputCurrency = (0, react_1.forwardRef)(({ placeholder, value, required, c
85
84
  : "border-red-primary"}` },
86
85
  react_1.default.createElement("input", { ref: internalRef, type: "text", id: label, disabled: disabled, value: Number(inputValue).toLocaleString(), placeholder: placeholder, autoComplete: autoComplete ? "on" : "off", autoFocus: autoFocus, onChange: handleChange, onBlur: onBlurHandler, onFocus: onFocusHandler, onKeyUp: onKeyUpHandler, onKeyDown: handleKeyDown, className: "outline-none bg-inherit w-full h-full", required: required }),
87
86
  react_1.default.createElement("p", { className: "text-sm text-text-color-primary border-r border-gray-tertiary px-2" }, currencyUnit)),
88
- !isErrorVisible() && (react_1.default.createElement("p", { className: "text-sm mt-1 text-red-primary" }, textError?.trim())))));
87
+ !isErrorVisible() && textError && (react_1.default.createElement("p", { className: "text-sm mt-1 text-red-primary" }, textError.trim())))));
89
88
  });
90
89
  InputCurrency.displayName = "InputCurrency";
91
90
  exports.default = InputCurrency;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hi-tm",
3
- "version": "0.13.6",
3
+ "version": "0.13.7",
4
4
  "styles": "dist/styles/globals.css",
5
5
  "main": "dist/index.js",
6
6
  "exports": {