hplx-react-elements-dev 1.0.73 → 1.0.75

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
@@ -4635,7 +4635,9 @@ var RadioBtn = function RadioBtn(_a) {
4635
4635
  id = _a.id,
4636
4636
  text = _a.text,
4637
4637
  secondaryText = _a.secondaryText,
4638
- className = _a.className;
4638
+ className = _a.className,
4639
+ value = _a.value,
4640
+ onChange = _a.onChange;
4639
4641
  return jsxRuntime.exports.jsx("div", __assign({
4640
4642
  className: "radiobutton"
4641
4643
  }, {
@@ -4645,11 +4647,12 @@ var RadioBtn = function RadioBtn(_a) {
4645
4647
  children: [jsxRuntime.exports.jsx("input", {
4646
4648
  className: "hplxt-sr-only hplxt-peer hplxt-border-0 focus:hplxt-border-0",
4647
4649
  type: "radio",
4648
- value: "first",
4649
- name: "radioBtn",
4650
+ value: value,
4651
+ name: 'radioBtn',
4650
4652
  id: id,
4651
4653
  "data-testid": id,
4652
- disabled: disabled
4654
+ disabled: disabled,
4655
+ onChange: onChange
4653
4656
  }), jsxRuntime.exports.jsx("label", {
4654
4657
  className: "".concat(getPaddingClassName(size, disabled)),
4655
4658
  htmlFor: id
@@ -17706,7 +17709,7 @@ var InputTag = function InputTag(_a) {
17706
17709
  showDropdown = _k[0],
17707
17710
  setShowDropdown = _k[1];
17708
17711
 
17709
- var _l = useState(''),
17712
+ var _l = useState(""),
17710
17713
  dropdownOffset = _l[0],
17711
17714
  setdropdownOffset = _l[1];
17712
17715
 
@@ -17752,6 +17755,8 @@ var InputTag = function InputTag(_a) {
17752
17755
  editInputValue = _u[0],
17753
17756
  setEditInputValue = _u[1];
17754
17757
 
17758
+ var dropdownClickedRef = useRef(false);
17759
+
17755
17760
  var handleValueChange = function handleValueChange(e) {
17756
17761
  var sug = [];
17757
17762
  setShowDropdown(true);
@@ -17767,22 +17772,22 @@ var InputTag = function InputTag(_a) {
17767
17772
  };
17768
17773
 
17769
17774
  var handleClickOutside = function handleClickOutside(e) {
17770
- setDropdownArr(options);
17771
-
17772
17775
  if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
17773
17776
  setShowDropdown(false);
17774
17777
  setFocusIndex(-1);
17775
17778
  }
17779
+
17780
+ dropdownClickedRef.current = false;
17776
17781
  };
17777
17782
 
17778
17783
  var handleDropdownClick = function handleDropdownClick(selectedItem) {
17784
+ setTagInputValue("");
17779
17785
  setTags(function (prev) {
17780
17786
  return __spreadArray(__spreadArray([], prev, true), [selectedItem.value], false);
17781
17787
  });
17782
17788
  setValue(function (prev) {
17783
17789
  return prev.trim() + ", " + selectedItem.value;
17784
17790
  });
17785
- setTagInputValue("");
17786
17791
  onDropdownClick && onDropdownClick(selectedItem);
17787
17792
  handleValChange && handleValChange(value);
17788
17793
  setFocusIndex(-1);
@@ -17812,15 +17817,24 @@ var InputTag = function InputTag(_a) {
17812
17817
  };
17813
17818
 
17814
17819
  var handleBlur = function handleBlur(event) {
17815
- if (tagInputValue.trim()) {
17816
- setTags(__spreadArray(__spreadArray([], tags, true), [tagInputValue.trim()], false));
17817
- setValue(tags.filter(Boolean).join(", "));
17818
- setTagInputValue("");
17819
- }
17820
+ var sto = setTimeout(function () {
17821
+ if (dropdownClickedRef.current) {
17822
+ dropdownClickedRef.current = false;
17823
+ return;
17824
+ }
17820
17825
 
17821
- setFocusIndex(-1);
17822
- setActive(false);
17823
- onBlur && onBlur(event);
17826
+ if (Boolean(tagInputValue) && tagInputValue.trim()) {
17827
+ setTags(__spreadArray(__spreadArray([], tags, true), [tagInputValue.trim()], false));
17828
+ setValue(tags.filter(Boolean).join(", "));
17829
+ setTagInputValue("");
17830
+ }
17831
+
17832
+ setFocusIndex(-1);
17833
+ setActive(false);
17834
+ onBlur && onBlur(event);
17835
+ dropdownClickedRef.current = false;
17836
+ sto && clearTimeout(sto);
17837
+ }, 100);
17824
17838
  };
17825
17839
 
17826
17840
  var addEditTags = function addEditTags(e) {
@@ -18009,7 +18023,8 @@ var InputTag = function InputTag(_a) {
18009
18023
  className: "hplxt-text-Primary-700 ".concat(index === focusIndex ? "hplxt-bg-Blue_gray-100 hplxt-font-inter-1" : "")
18010
18024
  }, restOptions, {
18011
18025
  onSelect: function onSelect() {
18012
- return handleDropdownClick(restOptions);
18026
+ dropdownClickedRef.current = true;
18027
+ handleDropdownClick(restOptions);
18013
18028
  },
18014
18029
  ddRef: ddRef,
18015
18030
  setChangeLeft: setChangeLeft
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { RadioBtnProps } from "../types";
3
- declare const RadioBtn: ({ size, disabled, iconfile, id, text, secondaryText, className }: RadioBtnProps) => JSX.Element;
3
+ declare const RadioBtn: ({ size, disabled, iconfile, id, text, secondaryText, className, value, onChange }: RadioBtnProps) => JSX.Element;
4
4
  export default RadioBtn;
@@ -273,7 +273,9 @@ export interface RadioBtnProps {
273
273
  text: string;
274
274
  secondaryText: string;
275
275
  id: any;
276
+ value: string;
276
277
  className?: any;
278
+ onChange: () => void;
277
279
  }
278
280
  export type ToggleSwitchThemeType = "Dark" | "Light";
279
281
  export type ToggleSwitchSizeType = "sm" | "md";
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "frontend",
10
10
  "healthplix"
11
11
  ],
12
- "version": "1.0.73",
12
+ "version": "1.0.75",
13
13
  "main": "dist/esm/index.js",
14
14
  "module": "dist/esm/index.js",
15
15
  "types": "dist/esm/index.d.ts",