hplx-react-elements-dev 1.0.78 → 1.0.80

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.
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { CheckboxProps } from "../types";
3
- declare const Checkbox: ({ size, text, secondaryText, disabled, onClick }: CheckboxProps) => JSX.Element;
3
+ declare const Checkbox: ({ size, text, secondaryText, disabled, isMarked, onClick }: CheckboxProps) => JSX.Element;
4
4
  export default Checkbox;
package/dist/esm/index.js CHANGED
@@ -3565,12 +3565,14 @@ var Checkbox = function Checkbox(_a) {
3565
3565
  secondaryText = _a.secondaryText,
3566
3566
  _c = _a.disabled,
3567
3567
  disabled = _c === void 0 ? false : _c,
3568
- _d = _a.onClick,
3569
- onClick = _d === void 0 ? function () {} : _d;
3568
+ _d = _a.isMarked,
3569
+ isMarked = _d === void 0 ? false : _d,
3570
+ _e = _a.onClick,
3571
+ onClick = _e === void 0 ? function () {} : _e;
3570
3572
 
3571
- var _e = useState(false),
3572
- isChecked = _e[0],
3573
- setCheck = _e[1];
3573
+ var _f = useState(false),
3574
+ isChecked = _f[0],
3575
+ setCheck = _f[1];
3574
3576
 
3575
3577
  var OnButtonClick = function OnButtonClick() {
3576
3578
  onClick();
@@ -3579,6 +3581,9 @@ var Checkbox = function Checkbox(_a) {
3579
3581
  });
3580
3582
  };
3581
3583
 
3584
+ useEffect(function () {
3585
+ setCheck(isMarked);
3586
+ }, [isMarked]);
3582
3587
  return jsxRuntime.exports.jsxs("div", __assign({
3583
3588
  className: "hplxt-flex"
3584
3589
  }, {
@@ -17811,13 +17816,11 @@ var InputTag = function InputTag(_a) {
17811
17816
  return allowDuplicates || !tags.includes(option.value);
17812
17817
  });
17813
17818
  setDropdownArr(filteredOptions);
17814
- } // Focus on the input element
17819
+ } // Set the dropdown offset
17815
17820
 
17816
17821
 
17817
- inputRef.current && inputRef.current.focus(); // Set the dropdown offset
17818
-
17819
- setdropdownOffset("".concat((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.offsetLeft, "px"));
17820
- }, [options, tags, inputRef, allowDuplicates]); // This function handles the click event of a dropdown item
17822
+ showDropdown && setdropdownOffset("".concat((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.offsetLeft, "px"));
17823
+ }, [options, tags, inputRef, allowDuplicates, showDropdown]); // This function handles the click event of a dropdown item
17821
17824
 
17822
17825
  var handleDropdownClick = function handleDropdownClick(selectedItem) {
17823
17826
  setTagInputValue(""); // Set a timeout to add the selected item to the tags after a certain time
@@ -18019,7 +18022,7 @@ var InputTag = function InputTag(_a) {
18019
18022
  }
18020
18023
 
18021
18024
  setdropdownOffset("".concat((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.offsetLeft, "px"));
18022
- }, [editIndex]);
18025
+ }, [editIndex, dropdownArr]);
18023
18026
  return jsxRuntime.exports.jsxs("div", __assign({
18024
18027
  className: "inputTag hplxt-w-auto hplxt-h-auto hplxt-gap-1 hplxt-p-1.5 hplxt-flex hplxt-flex-wrap hplxt-border-1 hplxt-rounded-lg hplxt-border-Blue_gray-100 hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary ".concat(active ? "hplxt-border-Primary-300 hplxt-shadow-xs-primary" : "", " ").concat(disabled ? "hplxt-bg-Gray-50" : "", " ").concat(className)
18025
18028
  }, {
@@ -172,6 +172,7 @@ export interface CheckboxProps {
172
172
  secondaryText?: string;
173
173
  disabled?: boolean;
174
174
  onClick?: () => void;
175
+ isMarked?: boolean;
175
176
  }
176
177
  type ButtonGroupOptionType = {
177
178
  value?: string;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "frontend",
10
10
  "healthplix"
11
11
  ],
12
- "version": "1.0.78",
12
+ "version": "1.0.80",
13
13
  "main": "dist/esm/index.js",
14
14
  "module": "dist/esm/index.js",
15
15
  "types": "dist/esm/index.d.ts",