kiban-design-system 1.1.9-hotfix.0 → 1.1.11-hotfix.0

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.js CHANGED
@@ -30541,6 +30541,7 @@ const AlphaZipCodeInput = ({ label, isRequired, items, onBlur, onFocus, onChange
30541
30541
  const [isFocusActive, setIsFocusActive] = useState(false);
30542
30542
  const [showPopover, setShowPopover] = useState(false);
30543
30543
  const handleOnBlur = () => {
30544
+ setShowPopover(false);
30544
30545
  setIsFocusActive(false);
30545
30546
  if (onBlur)
30546
30547
  onBlur();
@@ -30551,6 +30552,7 @@ const AlphaZipCodeInput = ({ label, isRequired, items, onBlur, onFocus, onChange
30551
30552
  if (onFocus)
30552
30553
  onFocus();
30553
30554
  };
30555
+ // eslint-disable-next-line max-len
30554
30556
  const handleOnChange = (event) => {
30555
30557
  const isValid = /^[0-9]+$/i.test(event.target.value) || event.target.value === '';
30556
30558
  if (isValid && onChange) {
@@ -30573,7 +30575,20 @@ const AlphaZipCodeInput = ({ label, isRequired, items, onBlur, onFocus, onChange
30573
30575
  }));
30574
30576
  const optionListMarkup = items.length > 0 ? (jsx(OptionList, { items: itemsOptions, selected: [''], onChange: handleOnSelectItem }, void 0)) : null;
30575
30577
  const emptyItemsMarkup = items.length === 0 ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME}__EmptyItems` }, { children: labelEmpty }), void 0)) : null;
30576
- const popoverMarkup = useMemo(() => (jsx(Popover$1, Object.assign({ activator: inputMarkup, isActive: showPopover, isFullWidth: true, onClose: () => setShowPopover(false), isFixed: true }, { children: jsxs(Popover$1.Pane, { children: [optionListMarkup, emptyItemsMarkup] }, void 0) }), void 0)), [items, value, showPopover, isFocusActive]);
30578
+ const popoverMarkup = useMemo(() => (jsx(Popover$1, Object.assign({ activator: inputMarkup, isActive: showPopover, isFullWidth: true, onClose: () => setShowPopover(false), isFixed: true }, { children: jsxs(Popover$1.Pane, { children: [optionListMarkup, emptyItemsMarkup] }, void 0) }), items.length)), [
30579
+ items,
30580
+ value,
30581
+ showPopover,
30582
+ emptyItemsMarkup,
30583
+ optionListMarkup,
30584
+ isFocusActive,
30585
+ ]);
30586
+ useEffect(() => {
30587
+ if (showPopover) {
30588
+ setShowPopover(false);
30589
+ requestAnimationFrame(() => setShowPopover(true));
30590
+ }
30591
+ }, [items]);
30577
30592
  return (jsxs("div", Object.assign({ className: `${COMPONENT_NAME}__Wrapper` }, { children: [labelMarkup, popoverMarkup] }), void 0));
30578
30593
  };
30579
30594