kiban-design-system 1.0.272-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 +22 -5
- 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
|
|
@@ -10026,7 +10028,7 @@ const Item$3 = ({ label, isDisabled, icon, onClick, isActive: isActiveProp, subN
|
|
|
10026
10028
|
const anchorMarkup = (jsxs(AnchorComponent, Object.assign({}, anchorProps, { target: isExternal ? '_blank' : undefined, onClick: handleClick }, { children: [iconMarkup, labelMarkup] }), void 0));
|
|
10027
10029
|
const tooltipAnchorMarkup = isCollapsed ? (jsx(AlphaTooltip, Object.assign({ content: label, position: 'right' }, { children: anchorMarkup }), void 0)) : null;
|
|
10028
10030
|
const classNames = cssClassName(COMPONENT_NAME$p, isDisabled && 'isDisabled', isActive && 'isActive', truncateText && 'isTruncated', (isCollapsed !== undefined ? isCollapsed : collapsed) && 'isCollapsed');
|
|
10029
|
-
if (isVisible &&
|
|
10031
|
+
if (isVisible !== undefined &&
|
|
10030
10032
|
!isVisible(location, {
|
|
10031
10033
|
label,
|
|
10032
10034
|
url,
|
|
@@ -10050,8 +10052,8 @@ const Section$1 = ({ items, fill, title, isCollapsed: isCollapsedProp, areSubNav
|
|
|
10050
10052
|
// layout
|
|
10051
10053
|
className: titleClassNames }, { children: jsx("span", { children: title }, void 0) }), void 0)) : null;
|
|
10052
10054
|
const renderItem = (item, index) => {
|
|
10053
|
-
const { label, isDisabled, icon, onClick, isActive, subNavigationItems, truncateText, anchorProps, url, isExact, isExternal, } = item;
|
|
10054
|
-
return (jsx(Item$3, { label: label, isDisabled: isDisabled, icon: icon, onClick: onClick, isActive: isActive, subNavigationItems: subNavigationItems, truncateText: truncateText, anchorProps: anchorProps, isCollapsed: isCollapsed, isSubNavigation: areSubNavigationItems, url: url, isExact: isExact, isExternal: isExternal }, `alpha-side-menu-item-${index}`));
|
|
10055
|
+
const { label, isDisabled, icon, onClick, isActive, subNavigationItems, truncateText, anchorProps, url, isExact, isExternal, isVisible, } = item;
|
|
10056
|
+
return (jsx(Item$3, { label: label, isDisabled: isDisabled, icon: icon, onClick: onClick, isActive: isActive, subNavigationItems: subNavigationItems, truncateText: truncateText, anchorProps: anchorProps, isCollapsed: isCollapsed, isSubNavigation: areSubNavigationItems, url: url, isExact: isExact, isExternal: isExternal, isVisible: isVisible }, `alpha-side-menu-item-${index}`));
|
|
10055
10057
|
};
|
|
10056
10058
|
const itemsMarkup = items && items.length > 0 ? (jsx("ul", Object.assign({ className: `${COMPONENT_NAME$o}__Items` }, { children: items.map(renderItem) }), void 0)) : null;
|
|
10057
10059
|
const classNames = cssClassName(COMPONENT_NAME$o, fill && 'isFill');
|
|
@@ -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
|
|