@eleventheye/asui 2.12.8 → 2.12.9
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ASNavBar.d.ts","sourceRoot":"","sources":["../../src/asnavbar/ASNavBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAA8B,MAAM,wBAAwB,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKjD,eAAO,MAAM,yBAAyB,EAAE,oBAYvC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,oBAYzC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,oBAUzC,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"ASNavBar.d.ts","sourceRoot":"","sources":["../../src/asnavbar/ASNavBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAA8B,MAAM,wBAAwB,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKjD,eAAO,MAAM,yBAAyB,EAAE,oBAYvC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,oBAYzC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,oBAUzC,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAkFrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -47,7 +47,7 @@ exports.defaultNavBarMWStyleOptions = {
|
|
|
47
47
|
$borderRadius: 6,
|
|
48
48
|
$padding: '0',
|
|
49
49
|
};
|
|
50
|
-
const ASNavBar = ({ className = '', navItems = [], selectedItemId = '', onItemSelected
|
|
50
|
+
const ASNavBar = ({ className = '', navItems = [], selectedItemId = '', onItemSelected, theme = astheme_1.default, size = ASUI_types_1.ComponentSize.Medium, styleOptions = { ...exports.defaultNavBarStyleOptions }, dwStyleOptions = { ...exports.defaultNavBarDWStyleOptions }, mwStyleOptions = { ...exports.defaultNavBarMWStyleOptions }, }) => {
|
|
51
51
|
const navBarRef = (0, react_1.useRef)(null);
|
|
52
52
|
const [uniqueID] = (0, react_1.useState)(() => (0, uuid_1.v4)());
|
|
53
53
|
const [navBarComponentId] = (0, react_1.useState)(`asnavbar-${uniqueID}`);
|
|
@@ -72,16 +72,14 @@ const ASNavBar = ({ className = '', navItems = [], selectedItemId = '', onItemSe
|
|
|
72
72
|
setIsMobile(width < $mobileBreakpoint);
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
|
-
|
|
76
|
-
observer.observe(navBarRef.current);
|
|
77
|
-
}
|
|
75
|
+
observer.observe(document.body);
|
|
78
76
|
return () => {
|
|
79
77
|
observer.disconnect();
|
|
80
78
|
};
|
|
81
79
|
}, [$disableTransitionsBetweenDisplayModes, $mobileBreakpoint, $displayModeOverride]);
|
|
82
80
|
const onItemSelectedHandler = (0, react_1.useCallback)((itemId) => {
|
|
83
81
|
setSelectedId(itemId);
|
|
84
|
-
onItemSelected(itemId);
|
|
82
|
+
onItemSelected?.(itemId);
|
|
85
83
|
}, [onItemSelected]);
|
|
86
84
|
return ((0, jsx_runtime_1.jsx)(styles_1.ASNavBarStyled, { ref: navBarRef, id: navBarComponentId, theme: theme, ...exports.defaultNavBarStyleOptions, ...styleOptions, children: isMobile ? ((0, jsx_runtime_1.jsx)(mobile_1.default, { id: `asnavbar-mw-${uniqueID}`, className: className, navItems: navItems, selectedItemId: selectedId, onItemSelected: onItemSelectedHandler, theme: theme, size: size, styleOptions: { ...exports.defaultNavBarMWStyleOptions, ...mwStyleOptions } })) : ((0, jsx_runtime_1.jsx)(desktop_1.default, { id: `asnavbar-dw-${uniqueID}`, className: className, navItems: navItems, selectedItemId: selectedId, onItemSelected: onItemSelectedHandler, theme: theme, size: size, styleOptions: { ...exports.defaultNavBarDWStyleOptions, ...dwStyleOptions } })) }));
|
|
87
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/asnavbar/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAIvE,UAAU,mBAAoB,SAAQ,oBAAoB;IACxD,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/asnavbar/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAIvE,UAAU,mBAAoB,SAAQ,oBAAoB;IACxD,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,wPAiC1B,CAAC;AAEF,UAAU,wBAAwB;IAChC,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,0BAA0B,6PAetC,CAAC"}
|
package/dist/asnavbar/styles.js
CHANGED
|
@@ -26,6 +26,7 @@ exports.ASNavBarStyled = styled_components_1.default.div `
|
|
|
26
26
|
border-radius: ${({ $borderRadius = 6 }) => $borderRadius}px;
|
|
27
27
|
background-color: ${({ theme }) => theme.navbar.navBarBackgroundColor};
|
|
28
28
|
box-shadow: ${({ theme }) => theme.navbar.navBarBoxShadow};
|
|
29
|
+
transform: translateZ(0);
|
|
29
30
|
|
|
30
31
|
${ASSharedStyles_1.MaxWidthStyle}
|
|
31
32
|
max-width: ${({ $maxWidth = 100, $maxWidthUnit = '%' }) => `${$maxWidth}${$maxWidthUnit}`};
|