opus-toolkit-components 1.8.5 → 1.8.7
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/lib/components/PageTemplate/index.d.ts +11 -0
- package/lib/components/Sidebar/index.d.ts +57 -58
- package/lib/main.js +187 -142
- package/lib/main.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
import type { SidebarMenu, SidebarUser } from "../Sidebar";
|
|
2
|
+
|
|
1
3
|
export interface PageTemplateProps {
|
|
4
|
+
sidebarMenus?: SidebarMenu[];
|
|
5
|
+
sidebarUser?: SidebarUser;
|
|
6
|
+
sidebarActiveItem?: string | number | null;
|
|
7
|
+
onSidebarItemClick?: (key: string | number) => void;
|
|
8
|
+
sidebarLogo?: string;
|
|
9
|
+
sidebarSearchValue?: string;
|
|
10
|
+
onSidebarSearchChange?: (value: string) => void;
|
|
11
|
+
sidebarOpenGroupKey?: string | number | null;
|
|
12
|
+
onSidebarGroupToggle?: (openGroupKey: string | number | null) => void;
|
|
2
13
|
headerTitle?: string;
|
|
3
14
|
headerCenter?: React.ReactNode;
|
|
4
15
|
headerRight?: React.ReactNode;
|
|
@@ -1,58 +1,57 @@
|
|
|
1
|
-
import type { IconProps } from "../Icon";
|
|
2
|
-
|
|
3
|
-
export interface SidebarMenuItem {
|
|
4
|
-
key: string | number;
|
|
5
|
-
name: string;
|
|
6
|
-
path?: string;
|
|
7
|
-
href?: string;
|
|
8
|
-
iconProps?: IconProps;
|
|
9
|
-
onClick?: (key: string | number) => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface SidebarMenuGroup {
|
|
13
|
-
key: string | number;
|
|
14
|
-
name: string;
|
|
15
|
-
iconProps?: IconProps;
|
|
16
|
-
children: SidebarMenuItem[];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type SidebarMenu = SidebarMenuItem | SidebarMenuGroup;
|
|
20
|
-
|
|
21
|
-
export interface SidebarUser {
|
|
22
|
-
id: string | number;
|
|
23
|
-
name: string;
|
|
24
|
-
role: string;
|
|
25
|
-
avatar?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface SidebarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
29
|
-
menus: SidebarMenu[];
|
|
30
|
-
user: SidebarUser;
|
|
31
|
-
|
|
32
|
-
/** Currently selected (active) menu item */
|
|
33
|
-
activeItem?: string | number | null;
|
|
34
|
-
onItemClick?: (key: string | number) => void;
|
|
35
|
-
|
|
36
|
-
/** Optional logo override */
|
|
37
|
-
logo?: string;
|
|
38
|
-
|
|
39
|
-
/** Controlled search input state */
|
|
40
|
-
searchValue?: string;
|
|
41
|
-
onSearchChange?: (value: string) => void;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*/
|
|
48
|
-
openGroupKey
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export const Sidebar: React.FC<SidebarProps>;
|
|
1
|
+
import type { IconProps } from "../Icon";
|
|
2
|
+
|
|
3
|
+
export interface SidebarMenuItem {
|
|
4
|
+
key: string | number;
|
|
5
|
+
name: string;
|
|
6
|
+
path?: string;
|
|
7
|
+
href?: string;
|
|
8
|
+
iconProps?: IconProps;
|
|
9
|
+
onClick?: (key: string | number) => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface SidebarMenuGroup {
|
|
13
|
+
key: string | number;
|
|
14
|
+
name: string;
|
|
15
|
+
iconProps?: IconProps;
|
|
16
|
+
children: SidebarMenuItem[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type SidebarMenu = SidebarMenuItem | SidebarMenuGroup;
|
|
20
|
+
|
|
21
|
+
export interface SidebarUser {
|
|
22
|
+
id: string | number;
|
|
23
|
+
name: string;
|
|
24
|
+
role: string;
|
|
25
|
+
avatar?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface SidebarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
29
|
+
menus: SidebarMenu[];
|
|
30
|
+
user: SidebarUser;
|
|
31
|
+
|
|
32
|
+
/** Currently selected (active) menu item */
|
|
33
|
+
activeItem?: string | number | null;
|
|
34
|
+
onItemClick?: (key: string | number) => void;
|
|
35
|
+
|
|
36
|
+
/** Optional logo override */
|
|
37
|
+
logo?: string;
|
|
38
|
+
|
|
39
|
+
/** Controlled search input state */
|
|
40
|
+
searchValue?: string;
|
|
41
|
+
onSearchChange?: (value: string) => void;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Optional controlled key of the currently expanded group.
|
|
45
|
+
* Set to `null` to collapse all groups.
|
|
46
|
+
* When omitted, the Sidebar manages expansion state internally.
|
|
47
|
+
*/
|
|
48
|
+
openGroupKey?: string | number | null;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Optional controlled change handler.
|
|
52
|
+
* Receives the NEXT openGroupKey value.
|
|
53
|
+
*/
|
|
54
|
+
onGroupToggle?: (openGroupKey: string | number | null) => void;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const Sidebar: React.FC<SidebarProps>;
|
package/lib/main.js
CHANGED
|
@@ -1555,33 +1555,54 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1555
1555
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
1556
1556
|
/* harmony import */ var _Header_Header__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38195);
|
|
1557
1557
|
/* harmony import */ var _Footer_Footer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3047);
|
|
1558
|
-
/* harmony import */ var
|
|
1559
|
-
/* harmony import */ var
|
|
1558
|
+
/* harmony import */ var _Sidebar_Sidebar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11775);
|
|
1559
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(94178);
|
|
1560
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
|
|
1560
1561
|
|
|
1561
1562
|
|
|
1562
1563
|
|
|
1563
1564
|
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
*
|
|
1567
|
-
*
|
|
1568
|
-
* @property {
|
|
1569
|
-
* @property {
|
|
1570
|
-
*
|
|
1571
|
-
* @property {
|
|
1572
|
-
* @property {
|
|
1573
|
-
* @property {
|
|
1574
|
-
*
|
|
1575
|
-
* @property {
|
|
1576
|
-
* @property {string} [
|
|
1565
|
+
|
|
1566
|
+
/**
|
|
1567
|
+
* @typedef {Object} PageTemplateProps
|
|
1568
|
+
*
|
|
1569
|
+
* @property {import('../Sidebar').SidebarMenu[]} [sidebarMenus] Sidebar menu configuration
|
|
1570
|
+
* @property {import('../Sidebar').SidebarUser} [sidebarUser] Sidebar user profile data
|
|
1571
|
+
* @property {string|number|null} [sidebarActiveItem] Active sidebar item key
|
|
1572
|
+
* @property {(key: string|number) => void} [onSidebarItemClick]
|
|
1573
|
+
* @property {string} [sidebarLogo] Optional sidebar logo override
|
|
1574
|
+
* @property {string} [sidebarSearchValue] Controlled search input value
|
|
1575
|
+
* @property {(value: string) => void} [onSidebarSearchChange]
|
|
1576
|
+
* @property {string|number|null} [sidebarOpenGroupKey] Expanded sidebar group key
|
|
1577
|
+
* @property {(openGroupKey: string|number|null) => void} [onSidebarGroupToggle]
|
|
1578
|
+
*
|
|
1579
|
+
* @property {string} [headerTitle] Title passed to left Header
|
|
1580
|
+
* @property {React.ReactNode} [headerCenter] Center slot of Header
|
|
1581
|
+
* @property {React.ReactNode} [headerRight] Right slot of Header
|
|
1582
|
+
*
|
|
1583
|
+
* @property {React.ReactNode} [footerLeft] Left slot of Footer
|
|
1584
|
+
* @property {React.ReactNode} [footerCenter] Center slot of Footer
|
|
1585
|
+
* @property {React.ReactNode} [footerRight] Right slot of Footer
|
|
1586
|
+
*
|
|
1587
|
+
* @property {React.ReactNode} children Main page content
|
|
1588
|
+
* @property {string} [className] Optional wrapper class
|
|
1577
1589
|
*/
|
|
1578
1590
|
|
|
1579
|
-
/**
|
|
1580
|
-
* @param {PageTemplateProps} props
|
|
1591
|
+
/**
|
|
1592
|
+
* @param {PageTemplateProps} props
|
|
1581
1593
|
*/
|
|
1582
1594
|
|
|
1583
1595
|
const PageTemplate = _ref => {
|
|
1584
1596
|
let {
|
|
1597
|
+
sidebarMenus,
|
|
1598
|
+
sidebarUser,
|
|
1599
|
+
sidebarActiveItem,
|
|
1600
|
+
onSidebarItemClick,
|
|
1601
|
+
sidebarLogo,
|
|
1602
|
+
sidebarSearchValue = "",
|
|
1603
|
+
onSidebarSearchChange,
|
|
1604
|
+
sidebarOpenGroupKey,
|
|
1605
|
+
onSidebarGroupToggle,
|
|
1585
1606
|
headerTitle,
|
|
1586
1607
|
headerCenter,
|
|
1587
1608
|
headerRight,
|
|
@@ -1591,19 +1612,37 @@ const PageTemplate = _ref => {
|
|
|
1591
1612
|
children,
|
|
1592
1613
|
className = ""
|
|
1593
1614
|
} = _ref;
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1615
|
+
const hasSidebar = Boolean((sidebarMenus === null || sidebarMenus === void 0 ? void 0 : sidebarMenus.length) && sidebarUser);
|
|
1616
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
|
1617
|
+
className: "flex min-h-screen w-full ".concat(className),
|
|
1618
|
+
children: [hasSidebar ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("aside", {
|
|
1619
|
+
className: "shrink-0",
|
|
1620
|
+
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Sidebar_Sidebar__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
|
1621
|
+
menus: sidebarMenus,
|
|
1622
|
+
user: sidebarUser,
|
|
1623
|
+
activeItem: sidebarActiveItem,
|
|
1624
|
+
onItemClick: onSidebarItemClick,
|
|
1625
|
+
logo: sidebarLogo,
|
|
1626
|
+
searchValue: sidebarSearchValue,
|
|
1627
|
+
onSearchChange: onSidebarSearchChange,
|
|
1628
|
+
openGroupKey: sidebarOpenGroupKey,
|
|
1629
|
+
onGroupToggle: onSidebarGroupToggle
|
|
1630
|
+
})
|
|
1631
|
+
}) : null, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
|
1632
|
+
className: "flex min-h-screen min-w-0 flex-1 flex-col",
|
|
1633
|
+
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Header_Header__WEBPACK_IMPORTED_MODULE_1__["default"], {
|
|
1634
|
+
title: headerTitle,
|
|
1635
|
+
center: headerCenter,
|
|
1636
|
+
right: headerRight
|
|
1637
|
+
// className="bg-[--color-primary]"
|
|
1638
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("main", {
|
|
1639
|
+
className: "flex-1 p-4",
|
|
1640
|
+
children: children
|
|
1641
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Footer_Footer__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
|
1642
|
+
left: footerLeft,
|
|
1643
|
+
center: footerCenter,
|
|
1644
|
+
right: footerRight
|
|
1645
|
+
})]
|
|
1607
1646
|
})]
|
|
1608
1647
|
});
|
|
1609
1648
|
};
|
|
@@ -5577,75 +5616,75 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
5577
5616
|
|
|
5578
5617
|
|
|
5579
5618
|
|
|
5580
|
-
/**
|
|
5581
|
-
* A single menu item (no children).
|
|
5582
|
-
* @typedef {Object} SidebarMenuItem
|
|
5583
|
-
* @property {string|number} key
|
|
5584
|
-
* @property {string} name
|
|
5585
|
-
* @property {string} [path]
|
|
5586
|
-
* @property {string} [href]
|
|
5587
|
-
* @property {import('../Icon').IconProps} [iconProps]
|
|
5588
|
-
* @property {(key: string|number) => void} [onClick]
|
|
5619
|
+
/**
|
|
5620
|
+
* A single menu item (no children).
|
|
5621
|
+
* @typedef {Object} SidebarMenuItem
|
|
5622
|
+
* @property {string|number} key
|
|
5623
|
+
* @property {string} name
|
|
5624
|
+
* @property {string} [path]
|
|
5625
|
+
* @property {string} [href]
|
|
5626
|
+
* @property {import('../Icon').IconProps} [iconProps]
|
|
5627
|
+
* @property {(key: string|number) => void} [onClick]
|
|
5589
5628
|
*/
|
|
5590
5629
|
|
|
5591
|
-
/**
|
|
5592
|
-
* A grouped menu entry with children.
|
|
5593
|
-
* @typedef {Object} SidebarMenuGroup
|
|
5594
|
-
* @property {string|number} key
|
|
5595
|
-
* @property {string} name
|
|
5596
|
-
* @property {SidebarMenuItem[]} children
|
|
5630
|
+
/**
|
|
5631
|
+
* A grouped menu entry with children.
|
|
5632
|
+
* @typedef {Object} SidebarMenuGroup
|
|
5633
|
+
* @property {string|number} key
|
|
5634
|
+
* @property {string} name
|
|
5635
|
+
* @property {SidebarMenuItem[]} children
|
|
5597
5636
|
*/
|
|
5598
5637
|
|
|
5599
|
-
/**
|
|
5600
|
-
* A full menu entry (either group or leaf item).
|
|
5601
|
-
* @typedef {SidebarMenuItem | SidebarMenuGroup} SidebarMenu
|
|
5638
|
+
/**
|
|
5639
|
+
* A full menu entry (either group or leaf item).
|
|
5640
|
+
* @typedef {SidebarMenuItem | SidebarMenuGroup} SidebarMenu
|
|
5602
5641
|
*/
|
|
5603
5642
|
|
|
5604
|
-
/**
|
|
5605
|
-
* Minimal shape expected for SidebarProfile.
|
|
5606
|
-
* @typedef {Object} SidebarUser
|
|
5607
|
-
* @property {string|number} id
|
|
5608
|
-
* @property {string} name
|
|
5609
|
-
* @property {string} role
|
|
5610
|
-
* @property {string} [avatar]
|
|
5643
|
+
/**
|
|
5644
|
+
* Minimal shape expected for SidebarProfile.
|
|
5645
|
+
* @typedef {Object} SidebarUser
|
|
5646
|
+
* @property {string|number} id
|
|
5647
|
+
* @property {string} name
|
|
5648
|
+
* @property {string} role
|
|
5649
|
+
* @property {string} [avatar]
|
|
5611
5650
|
*/
|
|
5612
5651
|
|
|
5613
|
-
/**
|
|
5614
|
-
* Props for Sidebar.
|
|
5615
|
-
*
|
|
5616
|
-
* @typedef {Object} SidebarProps
|
|
5617
|
-
*
|
|
5618
|
-
* @property {SidebarMenu[]} menus
|
|
5619
|
-
* All sidebar menu items (groups + items).
|
|
5620
|
-
*
|
|
5621
|
-
* @property {SidebarUser} user
|
|
5622
|
-
* The current logged-in user.
|
|
5623
|
-
*
|
|
5624
|
-
* @property {string|number|null} [activeItem]
|
|
5625
|
-
* Key of the currently selected item.
|
|
5626
|
-
*
|
|
5627
|
-
* @property {(key: string|number) => void} [onItemClick]
|
|
5628
|
-
* Fired when a menu item is clicked.
|
|
5629
|
-
*
|
|
5630
|
-
* @property {string} [logo]
|
|
5631
|
-
* Optional logo override.
|
|
5632
|
-
*
|
|
5633
|
-
* @property {string} [searchValue]
|
|
5634
|
-
* Controlled search input value.
|
|
5635
|
-
*
|
|
5636
|
-
* @property {(value: string) => void} [onSearchChange]
|
|
5637
|
-
*
|
|
5638
|
-
* @property {string|number|null} openGroupKey
|
|
5639
|
-
*
|
|
5640
|
-
*
|
|
5641
|
-
* @property {(openGroupKey: string|number|null) => void} onGroupToggle
|
|
5642
|
-
*
|
|
5652
|
+
/**
|
|
5653
|
+
* Props for Sidebar.
|
|
5654
|
+
*
|
|
5655
|
+
* @typedef {Object} SidebarProps
|
|
5656
|
+
*
|
|
5657
|
+
* @property {SidebarMenu[]} menus
|
|
5658
|
+
* All sidebar menu items (groups + items).
|
|
5659
|
+
*
|
|
5660
|
+
* @property {SidebarUser} user
|
|
5661
|
+
* The current logged-in user.
|
|
5662
|
+
*
|
|
5663
|
+
* @property {string|number|null} [activeItem]
|
|
5664
|
+
* Key of the currently selected item.
|
|
5665
|
+
*
|
|
5666
|
+
* @property {(key: string|number) => void} [onItemClick]
|
|
5667
|
+
* Fired when a menu item is clicked.
|
|
5668
|
+
*
|
|
5669
|
+
* @property {string} [logo]
|
|
5670
|
+
* Optional logo override.
|
|
5671
|
+
*
|
|
5672
|
+
* @property {string} [searchValue]
|
|
5673
|
+
* Controlled search input value.
|
|
5674
|
+
*
|
|
5675
|
+
* @property {(value: string) => void} [onSearchChange]
|
|
5676
|
+
*
|
|
5677
|
+
* @property {string|number|null} [openGroupKey]
|
|
5678
|
+
* Optional controlled key of the currently expanded group.
|
|
5679
|
+
*
|
|
5680
|
+
* @property {(openGroupKey: string|number|null) => void} [onGroupToggle]
|
|
5681
|
+
* Optional controlled change handler. If omitted, Sidebar manages group state internally.
|
|
5643
5682
|
*/
|
|
5644
5683
|
|
|
5645
|
-
/**
|
|
5646
|
-
* Fully typed Sidebar component.
|
|
5647
|
-
*
|
|
5648
|
-
* @param {SidebarProps & React.HTMLAttributes<HTMLDivElement>} props
|
|
5684
|
+
/**
|
|
5685
|
+
* Fully typed Sidebar component.
|
|
5686
|
+
*
|
|
5687
|
+
* @param {SidebarProps & React.HTMLAttributes<HTMLDivElement>} props
|
|
5649
5688
|
*/
|
|
5650
5689
|
|
|
5651
5690
|
function Sidebar(_ref) {
|
|
@@ -5662,15 +5701,21 @@ function Sidebar(_ref) {
|
|
|
5662
5701
|
} = _ref,
|
|
5663
5702
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
5664
5703
|
const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
5704
|
+
const [internalOpenGroupKey, setInternalOpenGroupKey] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
5705
|
+
const currentOpenGroupKey = openGroupKey !== undefined ? openGroupKey : internalOpenGroupKey;
|
|
5665
5706
|
const handleGroupToggle = key => {
|
|
5666
|
-
const nextOpenGroupKey =
|
|
5667
|
-
onGroupToggle
|
|
5707
|
+
const nextOpenGroupKey = currentOpenGroupKey === key ? null : key;
|
|
5708
|
+
if (onGroupToggle) {
|
|
5709
|
+
onGroupToggle(nextOpenGroupKey);
|
|
5710
|
+
return;
|
|
5711
|
+
}
|
|
5712
|
+
setInternalOpenGroupKey(nextOpenGroupKey);
|
|
5668
5713
|
};
|
|
5669
5714
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", _objectSpread(_objectSpread({
|
|
5670
5715
|
className: "flex"
|
|
5671
5716
|
}, rest), {}, {
|
|
5672
5717
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
|
|
5673
|
-
className: "".concat(open ? "w-[20rem]" : "w-[3rem]", " transition-width flex min-h-screen flex-col
|
|
5718
|
+
className: "".concat(open ? "w-[20rem]" : "w-[3rem]", " transition-width flex min-h-screen flex-col bg-[--color-primary-bg] text-[--color-text-strong] duration-300 ease-in-out"),
|
|
5674
5719
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
|
|
5675
5720
|
className: "flex items-center justify-between p-3 pr-0",
|
|
5676
5721
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("img", {
|
|
@@ -5721,7 +5766,7 @@ function Sidebar(_ref) {
|
|
|
5721
5766
|
activeItem: activeItem,
|
|
5722
5767
|
onItemClick: onItemClick,
|
|
5723
5768
|
toggleSidebar: setOpen,
|
|
5724
|
-
isOpen:
|
|
5769
|
+
isOpen: currentOpenGroupKey === menu.key,
|
|
5725
5770
|
onToggle: () => handleGroupToggle(menu.key)
|
|
5726
5771
|
}, "group-".concat(menu.key, "-").concat(menu.name)) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_SidebarItem__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
|
5727
5772
|
menu: menu,
|
|
@@ -50958,62 +51003,62 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
50958
51003
|
|
|
50959
51004
|
|
|
50960
51005
|
|
|
50961
|
-
/**
|
|
50962
|
-
* Icon props used by your dynamic Icon component (optional).
|
|
50963
|
-
* @typedef {import('../Icon/Icon').IconProps} IconProps
|
|
51006
|
+
/**
|
|
51007
|
+
* Icon props used by your dynamic Icon component (optional).
|
|
51008
|
+
* @typedef {import('../Icon/Icon').IconProps} IconProps
|
|
50964
51009
|
*/
|
|
50965
51010
|
|
|
50966
|
-
/**
|
|
50967
|
-
* A single child menu item.
|
|
50968
|
-
* @typedef {Object} SidebarChild
|
|
50969
|
-
* @property {string|number} key
|
|
50970
|
-
* @property {string} name
|
|
50971
|
-
* @property {string} [path]
|
|
50972
|
-
* @property {string} [href]
|
|
50973
|
-
* @property {IconProps} [iconProps]
|
|
50974
|
-
* @property {(key: string|number) => void} [onClick]
|
|
51011
|
+
/**
|
|
51012
|
+
* A single child menu item.
|
|
51013
|
+
* @typedef {Object} SidebarChild
|
|
51014
|
+
* @property {string|number} key
|
|
51015
|
+
* @property {string} name
|
|
51016
|
+
* @property {string} [path]
|
|
51017
|
+
* @property {string} [href]
|
|
51018
|
+
* @property {IconProps} [iconProps]
|
|
51019
|
+
* @property {(key: string|number) => void} [onClick]
|
|
50975
51020
|
*/
|
|
50976
51021
|
|
|
50977
|
-
/**
|
|
50978
|
-
* Sidebar group object containing children.
|
|
50979
|
-
* @typedef {Object} SidebarGroupMenu
|
|
50980
|
-
* @property {string|number} key
|
|
50981
|
-
* @property {string} name
|
|
50982
|
-
* @property {SidebarChild[]} children
|
|
50983
|
-
* @property {IconProps} [iconProps]
|
|
51022
|
+
/**
|
|
51023
|
+
* Sidebar group object containing children.
|
|
51024
|
+
* @typedef {Object} SidebarGroupMenu
|
|
51025
|
+
* @property {string|number} key
|
|
51026
|
+
* @property {string} name
|
|
51027
|
+
* @property {SidebarChild[]} children
|
|
51028
|
+
* @property {IconProps} [iconProps]
|
|
50984
51029
|
*/
|
|
50985
51030
|
|
|
50986
|
-
/**
|
|
50987
|
-
* Props for SidebarGroup component.
|
|
50988
|
-
*
|
|
50989
|
-
* @typedef {Object} SidebarGroupProps
|
|
50990
|
-
*
|
|
50991
|
-
* @property {SidebarGroupMenu} menu
|
|
50992
|
-
* The group menu containing children.
|
|
50993
|
-
*
|
|
50994
|
-
* @property {boolean} open
|
|
50995
|
-
* Whether the sidebar itself is expanded (wide mode vs collapsed).
|
|
50996
|
-
*
|
|
50997
|
-
* @property {string|number|null} activeItem
|
|
50998
|
-
* The currently selected menu item key.
|
|
50999
|
-
*
|
|
51000
|
-
* @property {(key: string|number) => void} onItemClick
|
|
51001
|
-
* Handler fired when a child item is selected.
|
|
51002
|
-
*
|
|
51003
|
-
* @property {(open: boolean) => void} toggleSidebar
|
|
51004
|
-
* Opens the sidebar when a user clicks a collapsed group.
|
|
51005
|
-
*
|
|
51006
|
-
* @property {boolean} isOpen
|
|
51007
|
-
* REQUIRED. Whether this group’s children are expanded.
|
|
51008
|
-
*
|
|
51009
|
-
* @property {() => void} onToggle
|
|
51010
|
-
* REQUIRED. Called when the group header is clicked.
|
|
51031
|
+
/**
|
|
51032
|
+
* Props for SidebarGroup component.
|
|
51033
|
+
*
|
|
51034
|
+
* @typedef {Object} SidebarGroupProps
|
|
51035
|
+
*
|
|
51036
|
+
* @property {SidebarGroupMenu} menu
|
|
51037
|
+
* The group menu containing children.
|
|
51038
|
+
*
|
|
51039
|
+
* @property {boolean} open
|
|
51040
|
+
* Whether the sidebar itself is expanded (wide mode vs collapsed).
|
|
51041
|
+
*
|
|
51042
|
+
* @property {string|number|null} activeItem
|
|
51043
|
+
* The currently selected menu item key.
|
|
51044
|
+
*
|
|
51045
|
+
* @property {(key: string|number) => void} onItemClick
|
|
51046
|
+
* Handler fired when a child item is selected.
|
|
51047
|
+
*
|
|
51048
|
+
* @property {(open: boolean) => void} toggleSidebar
|
|
51049
|
+
* Opens the sidebar when a user clicks a collapsed group.
|
|
51050
|
+
*
|
|
51051
|
+
* @property {boolean} isOpen
|
|
51052
|
+
* REQUIRED. Whether this group’s children are expanded.
|
|
51053
|
+
*
|
|
51054
|
+
* @property {() => void} onToggle
|
|
51055
|
+
* REQUIRED. Called when the group header is clicked.
|
|
51011
51056
|
*/
|
|
51012
51057
|
|
|
51013
|
-
/**
|
|
51014
|
-
* Fully typed SidebarGroup component.
|
|
51015
|
-
*
|
|
51016
|
-
* @param {SidebarGroupProps & React.HTMLAttributes<HTMLDivElement>} props
|
|
51058
|
+
/**
|
|
51059
|
+
* Fully typed SidebarGroup component.
|
|
51060
|
+
*
|
|
51061
|
+
* @param {SidebarGroupProps & React.HTMLAttributes<HTMLDivElement>} props
|
|
51017
51062
|
*/
|
|
51018
51063
|
|
|
51019
51064
|
function SidebarGroup(_ref) {
|
|
@@ -51060,7 +51105,7 @@ function SidebarGroup(_ref) {
|
|
|
51060
51105
|
onClick: () => {
|
|
51061
51106
|
var _child$onClick;
|
|
51062
51107
|
(_child$onClick = child.onClick) === null || _child$onClick === void 0 || _child$onClick.call(child, child.key);
|
|
51063
|
-
onItemClick(child.key);
|
|
51108
|
+
onItemClick === null || onItemClick === void 0 || onItemClick(child.key);
|
|
51064
51109
|
}
|
|
51065
51110
|
}, "child-".concat(child.key, "-").concat(child.path)))
|
|
51066
51111
|
})]
|