@superdispatch/ui-lab 0.21.14 → 0.21.15
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.
|
@@ -2,7 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
|
2
2
|
import { Accordion, AccordionSummary } from '@material-ui/core';
|
|
3
3
|
import { ExpandMore } from '@material-ui/icons';
|
|
4
4
|
import { Color, useUID } from '@superdispatch/ui';
|
|
5
|
-
import { useEffect, useState } from 'react';
|
|
5
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
import { useNavbarContext } from "./NavbarContext.js";
|
|
8
8
|
import { NavbarItem } from "./NavbarItem.js";
|
|
@@ -43,6 +43,7 @@ export function NavbarAccordion(_ref) {
|
|
|
43
43
|
useEffect(() => {
|
|
44
44
|
setExpanded(isNavbarExpanded);
|
|
45
45
|
}, [isNavbarExpanded]);
|
|
46
|
+
var filteredItems = useMemo(() => items.filter(item => !item.hide), [items]);
|
|
46
47
|
return /*#__PURE__*/_jsxs(NavbarAccordionRoot, {
|
|
47
48
|
square: true,
|
|
48
49
|
"data-gutter": !gutter,
|
|
@@ -66,9 +67,9 @@ export function NavbarAccordion(_ref) {
|
|
|
66
67
|
"data-expanded": isNavbarExpanded,
|
|
67
68
|
children: label
|
|
68
69
|
})]
|
|
69
|
-
}),
|
|
70
|
-
var index =
|
|
71
|
-
var prev =
|
|
70
|
+
}), filteredItems.map(item => {
|
|
71
|
+
var index = filteredItems.indexOf(item);
|
|
72
|
+
var prev = filteredItems[index - 1];
|
|
72
73
|
var {
|
|
73
74
|
ident = 0
|
|
74
75
|
} = item;
|
package/dist-web/index.js
CHANGED
|
@@ -1217,6 +1217,7 @@ function NavbarAccordion(_ref) {
|
|
|
1217
1217
|
useEffect(() => {
|
|
1218
1218
|
setExpanded(isNavbarExpanded);
|
|
1219
1219
|
}, [isNavbarExpanded]);
|
|
1220
|
+
var filteredItems = useMemo(() => items.filter(item => !item.hide), [items]);
|
|
1220
1221
|
return /*#__PURE__*/jsxs(NavbarAccordionRoot, {
|
|
1221
1222
|
square: true,
|
|
1222
1223
|
"data-gutter": !gutter,
|
|
@@ -1240,9 +1241,9 @@ function NavbarAccordion(_ref) {
|
|
|
1240
1241
|
"data-expanded": isNavbarExpanded,
|
|
1241
1242
|
children: label
|
|
1242
1243
|
})]
|
|
1243
|
-
}),
|
|
1244
|
-
var index =
|
|
1245
|
-
var prev =
|
|
1244
|
+
}), filteredItems.map(item => {
|
|
1245
|
+
var index = filteredItems.indexOf(item);
|
|
1246
|
+
var prev = filteredItems[index - 1];
|
|
1246
1247
|
var {
|
|
1247
1248
|
ident = 0
|
|
1248
1249
|
} = item;
|