kiban-design-system 1.0.273-alpha.0 → 1.0.274-alpha.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.css.map +1 -1
- package/dist/index.js +19 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -921,7 +921,9 @@ function formatFileSize(bytes) {
|
|
|
921
921
|
unitIndex += 1;
|
|
922
922
|
}
|
|
923
923
|
return `${size.toFixed(2)} ${units[unitIndex]}`;
|
|
924
|
-
}
|
|
924
|
+
}
|
|
925
|
+
// eslint-disable-next-line
|
|
926
|
+
// code end
|
|
925
927
|
|
|
926
928
|
const cssClassName = (mainClass, ...classes) => {
|
|
927
929
|
const filteredClasses = classes
|
|
@@ -30664,6 +30666,7 @@ const AlphaZipCodeInput = ({ label, isRequired, items, onBlur, onFocus, onChange
|
|
|
30664
30666
|
const [isFocusActive, setIsFocusActive] = useState(false);
|
|
30665
30667
|
const [showPopover, setShowPopover] = useState(false);
|
|
30666
30668
|
const handleOnBlur = () => {
|
|
30669
|
+
setShowPopover(false);
|
|
30667
30670
|
setIsFocusActive(false);
|
|
30668
30671
|
if (onBlur)
|
|
30669
30672
|
onBlur();
|
|
@@ -30674,6 +30677,7 @@ const AlphaZipCodeInput = ({ label, isRequired, items, onBlur, onFocus, onChange
|
|
|
30674
30677
|
if (onFocus)
|
|
30675
30678
|
onFocus();
|
|
30676
30679
|
};
|
|
30680
|
+
// eslint-disable-next-line max-len
|
|
30677
30681
|
const handleOnChange = (event) => {
|
|
30678
30682
|
const isValid = /^[0-9]+$/i.test(event.target.value) || event.target.value === '';
|
|
30679
30683
|
if (isValid && onChange) {
|
|
@@ -30696,7 +30700,20 @@ const AlphaZipCodeInput = ({ label, isRequired, items, onBlur, onFocus, onChange
|
|
|
30696
30700
|
}));
|
|
30697
30701
|
const optionListMarkup = items.length > 0 ? (jsx(OptionList, { items: itemsOptions, selected: [''], onChange: handleOnSelectItem }, void 0)) : null;
|
|
30698
30702
|
const emptyItemsMarkup = items.length === 0 ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME}__EmptyItems` }, { children: labelEmpty }), void 0)) : null;
|
|
30699
|
-
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) }),
|
|
30703
|
+
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)), [
|
|
30704
|
+
items,
|
|
30705
|
+
value,
|
|
30706
|
+
showPopover,
|
|
30707
|
+
emptyItemsMarkup,
|
|
30708
|
+
optionListMarkup,
|
|
30709
|
+
isFocusActive,
|
|
30710
|
+
]);
|
|
30711
|
+
useEffect(() => {
|
|
30712
|
+
if (showPopover) {
|
|
30713
|
+
setShowPopover(false);
|
|
30714
|
+
requestAnimationFrame(() => setShowPopover(true));
|
|
30715
|
+
}
|
|
30716
|
+
}, [items]);
|
|
30700
30717
|
return (jsxs("div", Object.assign({ className: `${COMPONENT_NAME}__Wrapper` }, { children: [labelMarkup, popoverMarkup] }), void 0));
|
|
30701
30718
|
};
|
|
30702
30719
|
|