x-ui-design 0.8.63 → 0.8.65

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.esm.js CHANGED
@@ -3367,7 +3367,7 @@ const TimePicker = ({
3367
3367
  const [innerValue, setInnerValue] = useState(propValue || defaultValue ? new Date(propValue || defaultValue) : null);
3368
3368
  const [[showHour, showMinutes, showSeconds]] = useState(`${format}`.split(':'));
3369
3369
  const [tempValue, setTempValue] = useState(null);
3370
- const inputRef = useRef(null);
3370
+ const triggerRef = useRef(null);
3371
3371
  const popupRef = useRef(null);
3372
3372
  const hourRef = useRef(null);
3373
3373
  const minuteRef = useRef(null);
@@ -3378,15 +3378,15 @@ const TimePicker = ({
3378
3378
  popupRef,
3379
3379
  placement,
3380
3380
  isOpen: open,
3381
- triggerRef: inputRef,
3382
- getPopupContainer: getPopupContainer?.(inputRef.current)
3381
+ triggerRef: triggerRef,
3382
+ getPopupContainer: getPopupContainer?.(triggerRef.current)
3383
3383
  });
3384
3384
  useEffect(() => {
3385
3385
  setInnerValue(propValue || defaultValue ? new Date(propValue || defaultValue) : null);
3386
3386
  }, [propValue]);
3387
3387
  useEffect(() => {
3388
3388
  const handleClickOutside = e => {
3389
- if (popupRef.current && !popupRef.current.contains(e.target) && inputRef.current && !inputRef.current.contains(e.target)) {
3389
+ if (popupRef.current && !popupRef.current.contains(e.target) && triggerRef.current && !triggerRef.current.contains(e.target)) {
3390
3390
  setOpen(false);
3391
3391
  setTempValue(null);
3392
3392
  if (!innerValue) {
@@ -3635,7 +3635,7 @@ const TimePicker = ({
3635
3635
  className: `${prefixCls}-input-wrapper`,
3636
3636
  onClick: () => setOpen(true)
3637
3637
  }, /*#__PURE__*/React.createElement("input", {
3638
- ref: inputRef,
3638
+ ref: triggerRef,
3639
3639
  size: INPUT_SIZE,
3640
3640
  placeholder: placeholder,
3641
3641
  className: `${prefixCls}-input`,
@@ -3662,7 +3662,7 @@ const TimePicker = ({
3662
3662
  }
3663
3663
  }, suffixIcon))), open && /*#__PURE__*/React.createElement(ConditionalWrapper, {
3664
3664
  condition: getPopupContainer !== undefined,
3665
- wrapper: element => getPopupContainer ? /*#__PURE__*/createPortal(element, getPopupContainer(inputRef.current)) : /*#__PURE__*/React.createElement(React.Fragment, null, element)
3665
+ wrapper: element => getPopupContainer ? /*#__PURE__*/createPortal(element, getPopupContainer(triggerRef.current)) : /*#__PURE__*/React.createElement(React.Fragment, null, element)
3666
3666
  }, /*#__PURE__*/React.createElement("div", {
3667
3667
  ref: popupRef,
3668
3668
  style: dropdownPosition,
@@ -5397,7 +5397,6 @@ const Dropdown = ({
5397
5397
  const onTriggerClick = e => {
5398
5398
  e.preventDefault();
5399
5399
  e.stopPropagation();
5400
- console.info(triggers.includes('click') && triggerRef.current && !open && triggerRef.current?.contains(e.target));
5401
5400
  if (triggers.includes('click') && triggerRef.current && !open && triggerRef.current?.contains(e.target)) {
5402
5401
  setOpenInternal(!open);
5403
5402
  }
@@ -5414,8 +5413,8 @@ const Dropdown = ({
5414
5413
  };
5415
5414
  const popup = /*#__PURE__*/React.createElement(ConditionalWrapper, {
5416
5415
  condition: getPopupContainer !== undefined,
5417
- wrapper: element => getPopupContainer ? /*#__PURE__*/createPortal(element, getPopupContainer(triggerRef.current)) : /*#__PURE__*/React.createElement(React.Fragment, null, element)
5418
- }, /*#__PURE__*/React.createElement("div", {
5416
+ wrapper: element => getPopupContainer ? /*#__PURE__*/createPortal(element, getPopupContainer(popupRef.current)) : /*#__PURE__*/React.createElement(React.Fragment, null, element)
5417
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
5419
5418
  ref: popupRef,
5420
5419
  className: `${prefixCls}-overlay ${prefixCls}-${placement} ${overlayClassName}`,
5421
5420
  style: {
@@ -5443,7 +5442,7 @@ const Dropdown = ({
5443
5442
  style: {
5444
5443
  padding: 8
5445
5444
  }
5446
- }, "Empty menu")));
5445
+ }, "Empty menu"))));
5447
5446
  return /*#__PURE__*/React.createElement("div", {
5448
5447
  ref: triggerRef,
5449
5448
  className: className,