hplx-react-elements-dev 1.0.85 → 1.0.86

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/esm/index.js CHANGED
@@ -2681,26 +2681,30 @@ var TextAreaField = function TextAreaField(_a) {
2681
2681
  _d = _a.rows,
2682
2682
  rows = _d === void 0 ? 2 : _d,
2683
2683
  _e = _a.isDynamicHeight,
2684
- isDynamicHeight = _e === void 0 ? false : _e;
2684
+ isDynamicHeight = _e === void 0 ? false : _e,
2685
+ _f = _a.isFocus,
2686
+ isFocus = _f === void 0 ? false : _f;
2685
2687
 
2686
- var _f = inputProps || {},
2687
- disabled = _f.disabled,
2688
- onFocus = _f.onFocus,
2689
- onBlur = _f.onBlur;
2688
+ var _g = inputProps || {},
2689
+ disabled = _g.disabled,
2690
+ onFocus = _g.onFocus,
2691
+ onBlur = _g.onBlur;
2690
2692
 
2691
- var _g = useState(false),
2692
- active = _g[0],
2693
- setActive = _g[1];
2693
+ var _h = useState(false),
2694
+ active = _h[0],
2695
+ setActive = _h[1];
2694
2696
 
2695
- var _h = useState(rows),
2696
- row = _h[0],
2697
- setRow = _h[1];
2697
+ var _j = useState(rows),
2698
+ row = _j[0],
2699
+ setRow = _j[1];
2698
2700
 
2699
2701
  var ref = useRef(null);
2700
2702
 
2701
2703
  var handleHeight = function handleHeight() {
2702
- var element = ref.current;
2703
- isDynamicHeight && setRow(element.scrollHeight / 32);
2704
+ if (isFocus = true) {
2705
+ var element = ref === null || ref === void 0 ? void 0 : ref.current;
2706
+ isDynamicHeight && setRow((element === null || element === void 0 ? void 0 : element.scrollHeight) / 32);
2707
+ }
2704
2708
  };
2705
2709
 
2706
2710
  var handleFocus = function handleFocus(event) {
@@ -2712,7 +2716,7 @@ var TextAreaField = function TextAreaField(_a) {
2712
2716
  var handleBlur = function handleBlur(event) {
2713
2717
  setActive(false);
2714
2718
  onBlur && onBlur(event);
2715
- isDynamicHeight && setRow(rows);
2719
+ isDynamicHeight && !isFocus && setRow(rows);
2716
2720
  };
2717
2721
 
2718
2722
  return jsxRuntime.exports.jsxs("div", __assign({
@@ -2738,7 +2742,7 @@ var TextAreaField = function TextAreaField(_a) {
2738
2742
  ref: ref,
2739
2743
  className: "hplxt-flex-1 hplxt-px-2 hplxt-py-2 focus-visible:hplxt-outline-0 hplxt-border-0 focus:hplxt-border-0",
2740
2744
  style: {
2741
- height: row * 32 + 'px'
2745
+ height: row * 32 + "px"
2742
2746
  }
2743
2747
  }, inputProps, {
2744
2748
  onInput: handleHeight,
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { TextAreaFieldProps } from "../types";
3
- declare const TextAreaField: ({ label, hint_text_icon, hint_text, errorMsg, inputProps, className, rows, isDynamicHeight, }: TextAreaFieldProps) => JSX.Element;
3
+ declare const TextAreaField: ({ label, hint_text_icon, hint_text, errorMsg, inputProps, className, rows, isDynamicHeight, isFocus, }: TextAreaFieldProps) => JSX.Element;
4
4
  export default TextAreaField;
@@ -120,6 +120,7 @@ export interface TextAreaFieldProps {
120
120
  className?: string;
121
121
  rows?: number;
122
122
  isDynamicHeight?: boolean;
123
+ isFocus?: boolean;
123
124
  }
124
125
  type badgesizeType = "sm" | "md" | "lg";
125
126
  type badgeiconType = "Left" | "Right" | "Only";
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "frontend",
10
10
  "healthplix"
11
11
  ],
12
- "version": "1.0.85",
12
+ "version": "1.0.86",
13
13
  "main": "dist/esm/index.js",
14
14
  "module": "dist/esm/index.js",
15
15
  "types": "dist/esm/index.d.ts",