@govtechsg/sgds-web-component 3.15.1-rc.2 → 3.16.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/components/Badge/index.umd.min.js +1 -1
- package/components/Badge/index.umd.min.js.map +1 -1
- package/components/Breadcrumb/index.umd.min.js +6 -6
- package/components/Breadcrumb/index.umd.min.js.map +1 -1
- package/components/ComboBox/index.umd.min.js +2 -2
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/Datepicker/index.umd.min.js +1 -1
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/Drawer/drawer.js +1 -1
- package/components/Drawer/index.umd.min.js +1 -1
- package/components/Drawer/index.umd.min.js.map +1 -1
- package/components/Dropdown/dropdown-menu.js +1 -1
- package/components/Dropdown/index.umd.min.js +1 -1
- package/components/Dropdown/index.umd.min.js.map +1 -1
- package/components/Mainnav/index.umd.min.js +9 -9
- package/components/Mainnav/index.umd.min.js.map +1 -1
- package/components/Mainnav/mainnav.js +1 -1
- package/components/Modal/index.umd.min.js +1 -1
- package/components/Modal/index.umd.min.js.map +1 -1
- package/components/Modal/modal.js +1 -1
- package/components/OverflowMenu/index.umd.min.js +6 -6
- package/components/OverflowMenu/index.umd.min.js.map +1 -1
- package/components/Select/index.umd.min.js +1 -1
- package/components/Select/index.umd.min.js.map +1 -1
- package/components/Subnav/index.umd.min.js +1 -1
- package/components/Subnav/index.umd.min.js.map +1 -1
- package/components/Subnav/subnav.js +1 -1
- package/components/Toast/index.umd.min.js +1 -1
- package/components/Toast/index.umd.min.js.map +1 -1
- package/components/Toast/toast-container.js +1 -1
- package/components/Tooltip/index.umd.min.js +1 -1
- package/components/Tooltip/index.umd.min.js.map +1 -1
- package/components/Tooltip/tooltip.js +1 -1
- package/components/index.d.ts +0 -1
- package/components/index.js +0 -1
- package/components/index.js.map +1 -1
- package/components/index.umd.min.js +64 -116
- package/components/index.umd.min.js.map +1 -1
- package/css/fouc.css +1 -5
- package/css/utility.css +0 -14
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/index.js.map +1 -1
- package/index.umd.min.js +63 -194
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/components/Drawer/drawer.cjs.js +1 -1
- package/react/components/Drawer/drawer.js +1 -1
- package/react/components/Dropdown/dropdown-menu.cjs.js +1 -1
- package/react/components/Dropdown/dropdown-menu.js +1 -1
- package/react/components/Mainnav/mainnav.cjs.js +1 -1
- package/react/components/Mainnav/mainnav.js +1 -1
- package/react/components/Modal/modal.cjs.js +1 -1
- package/react/components/Modal/modal.js +1 -1
- package/react/components/Subnav/subnav.cjs.js +1 -1
- package/react/components/Subnav/subnav.js +1 -1
- package/react/components/Toast/toast-container.cjs.js +1 -1
- package/react/components/Toast/toast-container.js +1 -1
- package/react/components/Tooltip/tooltip.cjs.js +1 -1
- package/react/components/Tooltip/tooltip.js +1 -1
- package/react/index.cjs.js +54 -62
- package/react/index.cjs.js.map +1 -1
- package/react/index.d.ts +1 -5
- package/react/index.js +1 -5
- package/react/index.js.map +1 -1
- package/themes/root.css +0 -13
- package/components/Sidebar/index.d.ts +0 -16
- package/components/Sidebar/index.js +0 -10
- package/components/Sidebar/index.js.map +0 -1
- package/components/Sidebar/index.umd.min.js +0 -2501
- package/components/Sidebar/index.umd.min.js.map +0 -1
- package/components/Sidebar/sgds-sidebar-group.d.ts +0 -51
- package/components/Sidebar/sgds-sidebar-group.js +0 -123
- package/components/Sidebar/sgds-sidebar-group.js.map +0 -1
- package/components/Sidebar/sgds-sidebar-item.d.ts +0 -17
- package/components/Sidebar/sgds-sidebar-item.js +0 -61
- package/components/Sidebar/sgds-sidebar-item.js.map +0 -1
- package/components/Sidebar/sgds-sidebar-section.d.ts +0 -56
- package/components/Sidebar/sgds-sidebar-section.js +0 -125
- package/components/Sidebar/sgds-sidebar-section.js.map +0 -1
- package/components/Sidebar/sgds-sidebar.d.ts +0 -161
- package/components/Sidebar/sgds-sidebar.js +0 -424
- package/components/Sidebar/sgds-sidebar.js.map +0 -1
- package/components/Sidebar/sidebar-context.d.ts +0 -51
- package/components/Sidebar/sidebar-context.js +0 -45
- package/components/Sidebar/sidebar-context.js.map +0 -1
- package/components/Sidebar/sidebar-element.d.ts +0 -112
- package/components/Sidebar/sidebar-element.js +0 -280
- package/components/Sidebar/sidebar-element.js.map +0 -1
- package/components/Sidebar/sidebar-item.js +0 -6
- package/components/Sidebar/sidebar-item.js.map +0 -1
- package/components/Sidebar/sidebar-section.js +0 -6
- package/components/Sidebar/sidebar-section.js.map +0 -1
- package/components/Sidebar/sidebar.js +0 -6
- package/components/Sidebar/sidebar.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar-group.cjs.js +0 -129
- package/react/components/Sidebar/sgds-sidebar-group.cjs.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar-group.js +0 -124
- package/react/components/Sidebar/sgds-sidebar-group.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar-item.cjs.js +0 -67
- package/react/components/Sidebar/sgds-sidebar-item.cjs.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar-item.js +0 -62
- package/react/components/Sidebar/sgds-sidebar-item.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar-section.cjs.js +0 -131
- package/react/components/Sidebar/sgds-sidebar-section.cjs.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar-section.js +0 -126
- package/react/components/Sidebar/sgds-sidebar-section.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar.cjs.js +0 -430
- package/react/components/Sidebar/sgds-sidebar.cjs.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar.js +0 -425
- package/react/components/Sidebar/sgds-sidebar.js.map +0 -1
- package/react/components/Sidebar/sidebar-context.cjs.js +0 -54
- package/react/components/Sidebar/sidebar-context.cjs.js.map +0 -1
- package/react/components/Sidebar/sidebar-context.js +0 -46
- package/react/components/Sidebar/sidebar-context.js.map +0 -1
- package/react/components/Sidebar/sidebar-element.cjs.js +0 -285
- package/react/components/Sidebar/sidebar-element.cjs.js.map +0 -1
- package/react/components/Sidebar/sidebar-element.js +0 -281
- package/react/components/Sidebar/sidebar-element.js.map +0 -1
- package/react/components/Sidebar/sidebar-item.cjs.js +0 -11
- package/react/components/Sidebar/sidebar-item.cjs.js.map +0 -1
- package/react/components/Sidebar/sidebar-item.js +0 -7
- package/react/components/Sidebar/sidebar-item.js.map +0 -1
- package/react/components/Sidebar/sidebar-section.cjs.js +0 -11
- package/react/components/Sidebar/sidebar-section.cjs.js.map +0 -1
- package/react/components/Sidebar/sidebar-section.js +0 -7
- package/react/components/Sidebar/sidebar-section.js.map +0 -1
- package/react/components/Sidebar/sidebar.cjs.js +0 -11
- package/react/components/Sidebar/sidebar.cjs.js.map +0 -1
- package/react/components/Sidebar/sidebar.js +0 -7
- package/react/components/Sidebar/sidebar.js.map +0 -1
- package/react/sidebar/index.cjs.js +0 -42
- package/react/sidebar/index.cjs.js.map +0 -1
- package/react/sidebar/index.d.ts +0 -2
- package/react/sidebar/index.js +0 -18
- package/react/sidebar/index.js.map +0 -1
- package/react/sidebar-group/index.cjs.js +0 -40
- package/react/sidebar-group/index.cjs.js.map +0 -1
- package/react/sidebar-group/index.d.ts +0 -2
- package/react/sidebar-group/index.js +0 -16
- package/react/sidebar-group/index.js.map +0 -1
- package/react/sidebar-item/index.cjs.js +0 -40
- package/react/sidebar-item/index.cjs.js.map +0 -1
- package/react/sidebar-item/index.d.ts +0 -2
- package/react/sidebar-item/index.js +0 -16
- package/react/sidebar-item/index.js.map +0 -1
- package/react/sidebar-section/index.cjs.js +0 -40
- package/react/sidebar-section/index.cjs.js.map +0 -1
- package/react/sidebar-section/index.d.ts +0 -2
- package/react/sidebar-section/index.js +0 -16
- package/react/sidebar-section/index.js.map +0 -1
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import SgdsIcon from "../Icon/sgds-icon";
|
|
2
|
-
import { SidebarElement } from "./sidebar-element";
|
|
3
|
-
/**
|
|
4
|
-
* @summary Sidebar group represents a navigable parent item within the sidebar that can have nested children.
|
|
5
|
-
* Groups support multiple levels of nesting and show nested items in a drawer overlay or submenu.
|
|
6
|
-
* Groups can be used to organize related sidebar items into expanding/collapsing sections.
|
|
7
|
-
*
|
|
8
|
-
* Behavior varies by nesting level:
|
|
9
|
-
* - Level 1 (root): Clicking opens drawer overlay showing all nested children. Keyboard: ArrowRight opens drawer.
|
|
10
|
-
* - Level 2+ (nested): Clicking toggles submenu visibility. Keyboard: ArrowRight toggles submenu.
|
|
11
|
-
*
|
|
12
|
-
* @slot default - Insert sgds-sidebar-group or sgds-sidebar-item elements as nested children
|
|
13
|
-
* @slot trailingIcon - Icon to display after the label text. A chevron is auto-appended.
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
export declare class SgdsSidebarGroup extends SidebarElement {
|
|
17
|
-
static styles: import("lit").CSSResult[];
|
|
18
|
-
/** @internal */
|
|
19
|
-
static dependencies: {
|
|
20
|
-
"sgds-icon": typeof SgdsIcon;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Manages submenu visibility state for nested groups.
|
|
24
|
-
* When true, the submenu is displayed showing nested children.
|
|
25
|
-
* When false, the submenu is hidden.
|
|
26
|
-
* Only used for nested groups (level 2+). Root-level groups use drawer overlay instead.
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
_showMenu: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Reports the visibility state of the submenu for nested groups.
|
|
32
|
-
* Returns true when the submenu is displayed showing child items, false when hidden.
|
|
33
|
-
* Only applicable for nested groups (level 2+). Root-level groups use drawer overlay instead.
|
|
34
|
-
* @readonly
|
|
35
|
-
* @type {boolean}
|
|
36
|
-
*/
|
|
37
|
-
get showMenu(): boolean;
|
|
38
|
-
/** @internal */
|
|
39
|
-
protected _handleClick(): void;
|
|
40
|
-
/**
|
|
41
|
-
* Determines the appropriate chevron icon based on nesting level and menu visibility.
|
|
42
|
-
* Icon changes provide visual feedback on expandable/collapsible state:
|
|
43
|
-
* - Level 1: chevron-right (closed drawer) or chevron-right (no change - drawer controlled by parent)
|
|
44
|
-
* - Level 2+: chevron-down (submenu open) or chevron-up (submenu closed)
|
|
45
|
-
* @private
|
|
46
|
-
* @returns {string} The icon name to display (e.g., 'chevron-right', 'chevron-down')
|
|
47
|
-
*/
|
|
48
|
-
private _getIcon;
|
|
49
|
-
render(): import("lit").TemplateResult<1>;
|
|
50
|
-
}
|
|
51
|
-
export default SgdsSidebarGroup;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import { state } from 'lit/decorators.js';
|
|
4
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
-
import SgdsElement from '../../base/sgds-element.js';
|
|
6
|
-
import css_248z from './sidebar-item.js';
|
|
7
|
-
import { SgdsIcon } from '../Icon/sgds-icon.js';
|
|
8
|
-
import { SidebarElement } from './sidebar-element.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @summary Sidebar group represents a navigable parent item within the sidebar that can have nested children.
|
|
12
|
-
* Groups support multiple levels of nesting and show nested items in a drawer overlay or submenu.
|
|
13
|
-
* Groups can be used to organize related sidebar items into expanding/collapsing sections.
|
|
14
|
-
*
|
|
15
|
-
* Behavior varies by nesting level:
|
|
16
|
-
* - Level 1 (root): Clicking opens drawer overlay showing all nested children. Keyboard: ArrowRight opens drawer.
|
|
17
|
-
* - Level 2+ (nested): Clicking toggles submenu visibility. Keyboard: ArrowRight toggles submenu.
|
|
18
|
-
*
|
|
19
|
-
* @slot default - Insert sgds-sidebar-group or sgds-sidebar-item elements as nested children
|
|
20
|
-
* @slot trailingIcon - Icon to display after the label text. A chevron is auto-appended.
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
class SgdsSidebarGroup extends SidebarElement {
|
|
24
|
-
constructor() {
|
|
25
|
-
super(...arguments);
|
|
26
|
-
/**
|
|
27
|
-
* Manages submenu visibility state for nested groups.
|
|
28
|
-
* When true, the submenu is displayed showing nested children.
|
|
29
|
-
* When false, the submenu is hidden.
|
|
30
|
-
* Only used for nested groups (level 2+). Root-level groups use drawer overlay instead.
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
this._showMenu = false;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Reports the visibility state of the submenu for nested groups.
|
|
37
|
-
* Returns true when the submenu is displayed showing child items, false when hidden.
|
|
38
|
-
* Only applicable for nested groups (level 2+). Root-level groups use drawer overlay instead.
|
|
39
|
-
* @readonly
|
|
40
|
-
* @type {boolean}
|
|
41
|
-
*/
|
|
42
|
-
get showMenu() {
|
|
43
|
-
return this._showMenu;
|
|
44
|
-
}
|
|
45
|
-
/** @internal */
|
|
46
|
-
_handleClick() {
|
|
47
|
-
if (this._childLevel !== 1) {
|
|
48
|
-
this._showMenu = !this._showMenu;
|
|
49
|
-
this._childElements.forEach(v => {
|
|
50
|
-
v._hidden = !this._showMenu;
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
super._handleClick();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Determines the appropriate chevron icon based on nesting level and menu visibility.
|
|
59
|
-
* Icon changes provide visual feedback on expandable/collapsible state:
|
|
60
|
-
* - Level 1: chevron-right (closed drawer) or chevron-right (no change - drawer controlled by parent)
|
|
61
|
-
* - Level 2+: chevron-down (submenu open) or chevron-up (submenu closed)
|
|
62
|
-
* @private
|
|
63
|
-
* @returns {string} The icon name to display (e.g., 'chevron-right', 'chevron-down')
|
|
64
|
-
*/
|
|
65
|
-
_getIcon() {
|
|
66
|
-
if (this._childLevel === 1) {
|
|
67
|
-
return "chevron-right";
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
return this._showMenu ? "chevron-down" : "chevron-up";
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
render() {
|
|
74
|
-
return html `
|
|
75
|
-
<div
|
|
76
|
-
class=${classMap({
|
|
77
|
-
"sidebar-item": true,
|
|
78
|
-
"sidebar-item--collapsed": this._sidebarCollapsed && this._childLevel === 1,
|
|
79
|
-
active: this._selected
|
|
80
|
-
})}
|
|
81
|
-
@click=${() => this._handleClick()}
|
|
82
|
-
aria-level=${this._childLevel}
|
|
83
|
-
.aria-expanded=${this._showMenu}
|
|
84
|
-
tabindex=${this._childLevel > 2 && !this._showMenu ? -1 : 0}
|
|
85
|
-
>
|
|
86
|
-
<div class="sidebar-item-label-wrapper">
|
|
87
|
-
<div>
|
|
88
|
-
<slot name="leadingIcon"></slot>
|
|
89
|
-
<span class="sidebar-item-label">${this.title}</span>
|
|
90
|
-
</div>
|
|
91
|
-
|
|
92
|
-
<span class="sidebar-item-trailingIcon">
|
|
93
|
-
<slot name="trailingIcon"></slot>
|
|
94
|
-
<sgds-icon aria-label=${this.title || this.name} name=${this._getIcon()} size="sm"></sgds-icon>
|
|
95
|
-
</span>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
|
|
99
|
-
<div
|
|
100
|
-
class=${classMap({
|
|
101
|
-
"sidebar-submenu": true,
|
|
102
|
-
"sidebar-submenu--collapsed": this._sidebarCollapsed && this._childLevel == 1,
|
|
103
|
-
show: this._showMenu
|
|
104
|
-
})}
|
|
105
|
-
>
|
|
106
|
-
<div>
|
|
107
|
-
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
108
|
-
</div>
|
|
109
|
-
</div>
|
|
110
|
-
`;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
SgdsSidebarGroup.styles = [...SgdsElement.styles, css_248z];
|
|
114
|
-
/** @internal */
|
|
115
|
-
SgdsSidebarGroup.dependencies = {
|
|
116
|
-
"sgds-icon": SgdsIcon
|
|
117
|
-
};
|
|
118
|
-
__decorate([
|
|
119
|
-
state()
|
|
120
|
-
], SgdsSidebarGroup.prototype, "_showMenu", void 0);
|
|
121
|
-
|
|
122
|
-
export { SgdsSidebarGroup, SgdsSidebarGroup as default };
|
|
123
|
-
//# sourceMappingURL=sgds-sidebar-group.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-sidebar-group.js","sources":["../../../src/components/Sidebar/sgds-sidebar-group.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport sidebarOptionStyle from \"./sidebar-item.css\";\nimport SgdsIcon from \"../Icon/sgds-icon\";\n\nimport { SidebarElement } from \"./sidebar-element\";\n\n/**\n * @summary Sidebar group represents a navigable parent item within the sidebar that can have nested children.\n * Groups support multiple levels of nesting and show nested items in a drawer overlay or submenu.\n * Groups can be used to organize related sidebar items into expanding/collapsing sections.\n *\n * Behavior varies by nesting level:\n * - Level 1 (root): Clicking opens drawer overlay showing all nested children. Keyboard: ArrowRight opens drawer.\n * - Level 2+ (nested): Clicking toggles submenu visibility. Keyboard: ArrowRight toggles submenu.\n *\n * @slot default - Insert sgds-sidebar-group or sgds-sidebar-item elements as nested children\n * @slot trailingIcon - Icon to display after the label text. A chevron is auto-appended.\n *\n */\nexport class SgdsSidebarGroup extends SidebarElement {\n static styles = [...SgdsElement.styles, sidebarOptionStyle];\n\n /** @internal */\n static dependencies = {\n \"sgds-icon\": SgdsIcon\n };\n\n /**\n * Manages submenu visibility state for nested groups.\n * When true, the submenu is displayed showing nested children.\n * When false, the submenu is hidden.\n * Only used for nested groups (level 2+). Root-level groups use drawer overlay instead.\n * @internal\n */\n @state() _showMenu = false;\n\n /**\n * Reports the visibility state of the submenu for nested groups.\n * Returns true when the submenu is displayed showing child items, false when hidden.\n * Only applicable for nested groups (level 2+). Root-level groups use drawer overlay instead.\n * @readonly\n * @type {boolean}\n */\n get showMenu(): boolean {\n return this._showMenu;\n }\n\n /** @internal */\n protected override _handleClick(): void {\n if (this._childLevel !== 1) {\n this._showMenu = !this._showMenu;\n this._childElements.forEach(v => {\n v._hidden = !this._showMenu;\n });\n } else {\n super._handleClick();\n }\n }\n /**\n * Determines the appropriate chevron icon based on nesting level and menu visibility.\n * Icon changes provide visual feedback on expandable/collapsible state:\n * - Level 1: chevron-right (closed drawer) or chevron-right (no change - drawer controlled by parent)\n * - Level 2+: chevron-down (submenu open) or chevron-up (submenu closed)\n * @private\n * @returns {string} The icon name to display (e.g., 'chevron-right', 'chevron-down')\n */\n private _getIcon() {\n if (this._childLevel === 1) {\n return \"chevron-right\";\n } else {\n return this._showMenu ? \"chevron-down\" : \"chevron-up\";\n }\n }\n\n render() {\n return html`\n <div\n class=${classMap({\n \"sidebar-item\": true,\n \"sidebar-item--collapsed\": this._sidebarCollapsed && this._childLevel === 1,\n active: this._selected\n })}\n @click=${() => this._handleClick()}\n aria-level=${this._childLevel}\n .aria-expanded=${this._showMenu}\n tabindex=${this._childLevel > 2 && !this._showMenu ? -1 : 0}\n >\n <div class=\"sidebar-item-label-wrapper\">\n <div>\n <slot name=\"leadingIcon\"></slot>\n <span class=\"sidebar-item-label\">${this.title}</span>\n </div>\n\n <span class=\"sidebar-item-trailingIcon\">\n <slot name=\"trailingIcon\"></slot>\n <sgds-icon aria-label=${this.title || this.name} name=${this._getIcon()} size=\"sm\"></sgds-icon>\n </span>\n </div>\n </div>\n\n <div\n class=${classMap({\n \"sidebar-submenu\": true,\n \"sidebar-submenu--collapsed\": this._sidebarCollapsed && this._childLevel == 1,\n show: this._showMenu\n })}\n >\n <div>\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsSidebarGroup;\n"],"names":["sidebarOptionStyle"],"mappings":";;;;;;;;;AASA;;;;;;;;;;;;AAYG;AACG,MAAO,gBAAiB,SAAQ,cAAc,CAAA;AAApD,IAAA,WAAA,GAAA;;AAQE;;;;;;AAMG;QACM,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;KA+E5B;AA7EC;;;;;;AAMG;AACH,IAAA,IAAI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;KACvB;;IAGkB,YAAY,GAAA;AAC7B,QAAA,IAAI,IAAI,CAAC,WAAW,KAAK,CAAC,EAAE;AAC1B,YAAA,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;AACjC,YAAA,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,IAAG;AAC9B,gBAAA,CAAC,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;AAC9B,aAAC,CAAC,CAAC;SACJ;aAAM;YACL,KAAK,CAAC,YAAY,EAAE,CAAC;SACtB;KACF;AACD;;;;;;;AAOG;IACK,QAAQ,GAAA;AACd,QAAA,IAAI,IAAI,CAAC,WAAW,KAAK,CAAC,EAAE;AAC1B,YAAA,OAAO,eAAe,CAAC;SACxB;aAAM;YACL,OAAO,IAAI,CAAC,SAAS,GAAG,cAAc,GAAG,YAAY,CAAC;SACvD;KACF;IAED,MAAM,GAAA;AACJ,QAAA,OAAO,IAAI,CAAA,CAAA;;AAEC,cAAA,EAAA,QAAQ,CAAC;AACf,YAAA,cAAc,EAAE,IAAI;YACpB,yBAAyB,EAAE,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,WAAW,KAAK,CAAC;YAC3E,MAAM,EAAE,IAAI,CAAC,SAAS;SACvB,CAAC,CAAA;AACO,eAAA,EAAA,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;AACrB,mBAAA,EAAA,IAAI,CAAC,WAAW,CAAA;AACZ,uBAAA,EAAA,IAAI,CAAC,SAAS,CAAA;AACpB,iBAAA,EAAA,IAAI,CAAC,WAAW,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;;;;;AAKpB,6CAAA,EAAA,IAAI,CAAC,KAAK,CAAA;;;;;oCAKrB,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAS,MAAA,EAAA,IAAI,CAAC,QAAQ,EAAE,CAAA;;;;;;AAMnE,cAAA,EAAA,QAAQ,CAAC;AACf,YAAA,iBAAiB,EAAE,IAAI;YACvB,4BAA4B,EAAE,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC;YAC7E,IAAI,EAAE,IAAI,CAAC,SAAS;SACrB,CAAC,CAAA;;;AAGoB,4BAAA,EAAA,IAAI,CAAC,iBAAiB,CAAA;;;KAG/C,CAAC;KACH;;AA5FM,gBAAM,CAAA,MAAA,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,EAAEA,QAAkB,CAA7C,CAA+C;AAE5D;AACO,gBAAA,CAAA,YAAY,GAAG;AACpB,IAAA,WAAW,EAAE,QAAQ;AACtB,CAFkB,CAEjB;AASO,UAAA,CAAA;AAAR,IAAA,KAAK,EAAE;AAAmB,CAAA,EAAA,gBAAA,CAAA,SAAA,EAAA,WAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SidebarElement } from "./sidebar-element";
|
|
2
|
-
/**
|
|
3
|
-
* @summary Sidebar item is a selectable navigation item within the sidebar component.
|
|
4
|
-
* It can be used as a terminal leaf node in the navigation hierarchy (does not support nested children).
|
|
5
|
-
* Items can optionally wrap anchor links for programmatic navigation to external URLs or routes.
|
|
6
|
-
*
|
|
7
|
-
* @slot default - Text content for the item label
|
|
8
|
-
* @slot leadingIcon - Icon to display before the label text (required for level 1 and level 2)
|
|
9
|
-
* @slot trailingIcon - Icon to display after the label text (optional)
|
|
10
|
-
*
|
|
11
|
-
* See SgdsSidebar for parent component usage and selection events.
|
|
12
|
-
*/
|
|
13
|
-
export declare class SgdsSidebarItem extends SidebarElement {
|
|
14
|
-
static styles: import("lit").CSSResult[];
|
|
15
|
-
render(): import("lit").TemplateResult<1>;
|
|
16
|
-
}
|
|
17
|
-
export default SgdsSidebarItem;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { html, nothing } from 'lit';
|
|
2
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
3
|
-
import SgdsElement from '../../base/sgds-element.js';
|
|
4
|
-
import css_248z from './sidebar-item.js';
|
|
5
|
-
import { SidebarElement } from './sidebar-element.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @summary Sidebar item is a selectable navigation item within the sidebar component.
|
|
9
|
-
* It can be used as a terminal leaf node in the navigation hierarchy (does not support nested children).
|
|
10
|
-
* Items can optionally wrap anchor links for programmatic navigation to external URLs or routes.
|
|
11
|
-
*
|
|
12
|
-
* @slot default - Text content for the item label
|
|
13
|
-
* @slot leadingIcon - Icon to display before the label text (required for level 1 and level 2)
|
|
14
|
-
* @slot trailingIcon - Icon to display after the label text (optional)
|
|
15
|
-
*
|
|
16
|
-
* See SgdsSidebar for parent component usage and selection events.
|
|
17
|
-
*/
|
|
18
|
-
class SgdsSidebarItem extends SidebarElement {
|
|
19
|
-
render() {
|
|
20
|
-
return html `
|
|
21
|
-
<div
|
|
22
|
-
class=${classMap({
|
|
23
|
-
"sidebar-item": true,
|
|
24
|
-
"sidebar-item--collapsed": this._sidebarCollapsed && this._childLevel === 1,
|
|
25
|
-
active: this._selected
|
|
26
|
-
})}
|
|
27
|
-
@click=${() => this._handleClick()}
|
|
28
|
-
aria-level=${this._childLevel}
|
|
29
|
-
aria-label=${this.title || this.name}
|
|
30
|
-
name=${this.name}
|
|
31
|
-
tabindex=${this._hidden ? -1 : 0}
|
|
32
|
-
role="button"
|
|
33
|
-
>
|
|
34
|
-
<div class="sidebar-item-label-wrapper">
|
|
35
|
-
<div>
|
|
36
|
-
<!-- For level 1 and 2 -->
|
|
37
|
-
${this._childLevel <= 2 ? html `<slot name="leadingIcon"></slot>` : nothing}
|
|
38
|
-
<span
|
|
39
|
-
class=${classMap({
|
|
40
|
-
"sidebar-item-label": true,
|
|
41
|
-
offset: this._childLevel > 2
|
|
42
|
-
})}
|
|
43
|
-
>${this.title}</span
|
|
44
|
-
>
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
<!-- For level 1 and 2 -->
|
|
48
|
-
${this._childLevel <= 2
|
|
49
|
-
? html `<span class="sidebar-item-trailingIcon">
|
|
50
|
-
<slot name="trailingIcon"></slot>
|
|
51
|
-
</span>`
|
|
52
|
-
: nothing}
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
`;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
SgdsSidebarItem.styles = [...SgdsElement.styles, css_248z];
|
|
59
|
-
|
|
60
|
-
export { SgdsSidebarItem, SgdsSidebarItem as default };
|
|
61
|
-
//# sourceMappingURL=sgds-sidebar-item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-sidebar-item.js","sources":["../../../src/components/Sidebar/sgds-sidebar-item.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport sidebarOptionStyle from \"./sidebar-item.css\";\n\nimport { SidebarElement } from \"./sidebar-element\";\n\n/**\n * @summary Sidebar item is a selectable navigation item within the sidebar component.\n * It can be used as a terminal leaf node in the navigation hierarchy (does not support nested children).\n * Items can optionally wrap anchor links for programmatic navigation to external URLs or routes.\n *\n * @slot default - Text content for the item label\n * @slot leadingIcon - Icon to display before the label text (required for level 1 and level 2)\n * @slot trailingIcon - Icon to display after the label text (optional)\n *\n * See SgdsSidebar for parent component usage and selection events.\n */\nexport class SgdsSidebarItem extends SidebarElement {\n static styles = [...SgdsElement.styles, sidebarOptionStyle];\n\n render() {\n return html`\n <div\n class=${classMap({\n \"sidebar-item\": true,\n \"sidebar-item--collapsed\": this._sidebarCollapsed && this._childLevel === 1,\n active: this._selected\n })}\n @click=${() => this._handleClick()}\n aria-level=${this._childLevel}\n aria-label=${this.title || this.name}\n name=${this.name}\n tabindex=${this._hidden ? -1 : 0}\n role=\"button\"\n >\n <div class=\"sidebar-item-label-wrapper\">\n <div>\n <!-- For level 1 and 2 -->\n ${this._childLevel <= 2 ? html`<slot name=\"leadingIcon\"></slot>` : nothing}\n <span\n class=${classMap({\n \"sidebar-item-label\": true,\n offset: this._childLevel > 2\n })}\n >${this.title}</span\n >\n </div>\n\n <!-- For level 1 and 2 -->\n ${this._childLevel <= 2\n ? html`<span class=\"sidebar-item-trailingIcon\">\n <slot name=\"trailingIcon\"></slot>\n </span>`\n : nothing}\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsSidebarItem;\n"],"names":["sidebarOptionStyle"],"mappings":";;;;;;AAQA;;;;;;;;;;AAUG;AACG,MAAO,eAAgB,SAAQ,cAAc,CAAA;IAGjD,MAAM,GAAA;AACJ,QAAA,OAAO,IAAI,CAAA,CAAA;;AAEC,cAAA,EAAA,QAAQ,CAAC;AACf,YAAA,cAAc,EAAE,IAAI;YACpB,yBAAyB,EAAE,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,WAAW,KAAK,CAAC;YAC3E,MAAM,EAAE,IAAI,CAAC,SAAS;SACvB,CAAC,CAAA;AACO,eAAA,EAAA,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;AACrB,mBAAA,EAAA,IAAI,CAAC,WAAW,CAAA;AAChB,mBAAA,EAAA,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAA;AAC7B,aAAA,EAAA,IAAI,CAAC,IAAI,CAAA;mBACL,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;;;;;;AAM1B,YAAA,EAAA,IAAI,CAAC,WAAW,IAAI,CAAC,GAAG,IAAI,CAAA,CAAA,gCAAA,CAAkC,GAAG,OAAO,CAAA;;AAEhE,oBAAA,EAAA,QAAQ,CAAC;AACf,YAAA,oBAAoB,EAAE,IAAI;AAC1B,YAAA,MAAM,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC;SAC7B,CAAC,CAAA;AACC,eAAA,EAAA,IAAI,CAAC,KAAK,CAAA;;;;;YAKf,IAAI,CAAC,WAAW,IAAI,CAAC;cACnB,IAAI,CAAA,CAAA;;AAEI,qBAAA,CAAA;AACV,cAAE,OAAO,CAAA;;;KAGhB,CAAC;KACH;;AAvCM,eAAM,CAAA,MAAA,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,EAAEA,QAAkB,CAAC;;;;"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { SidebarElement } from "./sidebar-element";
|
|
2
|
-
import SgdsIcon from "../Icon/sgds-icon";
|
|
3
|
-
import SgdsDivider from "../Divider/sgds-divider";
|
|
4
|
-
/**
|
|
5
|
-
* @summary Sidebar section is a container component that groups related sidebar items into organized sections.
|
|
6
|
-
* It displays a section header/title and can optionally be collapsible. Sections help organize navigation
|
|
7
|
-
* items hierarchically within the sidebar, providing visual separation between different areas of functionality.
|
|
8
|
-
*
|
|
9
|
-
* @slot - Insert sgds-sidebar-item and sgds-sidebar-group elements to be grouped within this section
|
|
10
|
-
*/
|
|
11
|
-
export declare class SgdsSidebarSection extends SidebarElement {
|
|
12
|
-
static styles: import("lit").CSSResult[];
|
|
13
|
-
/** @internal */
|
|
14
|
-
static dependencies: {
|
|
15
|
-
"sgds-icon": typeof SgdsIcon;
|
|
16
|
-
"sgds-divider": typeof SgdsDivider;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* The display title/label for the sidebar section header.
|
|
20
|
-
* Always visible in the sidebar, used to group related items.
|
|
21
|
-
* @attribute title
|
|
22
|
-
* @type {string}
|
|
23
|
-
* @default ""
|
|
24
|
-
*/
|
|
25
|
-
title: string;
|
|
26
|
-
/**
|
|
27
|
-
* Controls whether the section content is expanded or collapsed.
|
|
28
|
-
* When true, the section content is hidden but the section header remains visible.
|
|
29
|
-
* Only applicable when the section is collapsible.
|
|
30
|
-
* @attribute collapsed
|
|
31
|
-
* @type {boolean}
|
|
32
|
-
* @default false
|
|
33
|
-
*/
|
|
34
|
-
collapsed: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Enables a collapsible section header with expand/collapse toggle functionality.
|
|
37
|
-
* When true, users can click the header to toggle section visibility.
|
|
38
|
-
* When false, the section header is display-only and not interactive.
|
|
39
|
-
* @attribute collapsible
|
|
40
|
-
* @type {boolean}
|
|
41
|
-
* @default false
|
|
42
|
-
*/
|
|
43
|
-
collapsible: boolean;
|
|
44
|
-
seperator: boolean;
|
|
45
|
-
connectedCallback(): void;
|
|
46
|
-
/**
|
|
47
|
-
* Handles click events on the section label.
|
|
48
|
-
* Toggles the collapsed state to show/hide section content.
|
|
49
|
-
* Only called if the section is collapsible (collapsible prop is true).
|
|
50
|
-
* @private
|
|
51
|
-
* @returns {void}
|
|
52
|
-
*/
|
|
53
|
-
_handleClick(): void;
|
|
54
|
-
render(): import("lit").TemplateResult<1>;
|
|
55
|
-
}
|
|
56
|
-
export default SgdsSidebarSection;
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
2
|
-
import { html, nothing } from 'lit';
|
|
3
|
-
import { property } from 'lit/decorators.js';
|
|
4
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
-
import SgdsElement from '../../base/sgds-element.js';
|
|
6
|
-
import css_248z from './sidebar-section.js';
|
|
7
|
-
import { SidebarElement } from './sidebar-element.js';
|
|
8
|
-
import { SgdsIcon } from '../Icon/sgds-icon.js';
|
|
9
|
-
import { SgdsDivider } from '../Divider/sgds-divider.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @summary Sidebar section is a container component that groups related sidebar items into organized sections.
|
|
13
|
-
* It displays a section header/title and can optionally be collapsible. Sections help organize navigation
|
|
14
|
-
* items hierarchically within the sidebar, providing visual separation between different areas of functionality.
|
|
15
|
-
*
|
|
16
|
-
* @slot - Insert sgds-sidebar-item and sgds-sidebar-group elements to be grouped within this section
|
|
17
|
-
*/
|
|
18
|
-
class SgdsSidebarSection extends SidebarElement {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
/**
|
|
22
|
-
* The display title/label for the sidebar section header.
|
|
23
|
-
* Always visible in the sidebar, used to group related items.
|
|
24
|
-
* @attribute title
|
|
25
|
-
* @type {string}
|
|
26
|
-
* @default ""
|
|
27
|
-
*/
|
|
28
|
-
this.title = "";
|
|
29
|
-
/**
|
|
30
|
-
* Controls whether the section content is expanded or collapsed.
|
|
31
|
-
* When true, the section content is hidden but the section header remains visible.
|
|
32
|
-
* Only applicable when the section is collapsible.
|
|
33
|
-
* @attribute collapsed
|
|
34
|
-
* @type {boolean}
|
|
35
|
-
* @default false
|
|
36
|
-
*/
|
|
37
|
-
this.collapsed = false;
|
|
38
|
-
/**
|
|
39
|
-
* Enables a collapsible section header with expand/collapse toggle functionality.
|
|
40
|
-
* When true, users can click the header to toggle section visibility.
|
|
41
|
-
* When false, the section header is display-only and not interactive.
|
|
42
|
-
* @attribute collapsible
|
|
43
|
-
* @type {boolean}
|
|
44
|
-
* @default false
|
|
45
|
-
*/
|
|
46
|
-
this.collapsible = false;
|
|
47
|
-
this.seperator = false;
|
|
48
|
-
}
|
|
49
|
-
connectedCallback() {
|
|
50
|
-
super.connectedCallback();
|
|
51
|
-
this.setAttribute("role", "region");
|
|
52
|
-
this._childLevel = null;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Handles click events on the section label.
|
|
56
|
-
* Toggles the collapsed state to show/hide section content.
|
|
57
|
-
* Only called if the section is collapsible (collapsible prop is true).
|
|
58
|
-
* @private
|
|
59
|
-
* @returns {void}
|
|
60
|
-
*/
|
|
61
|
-
_handleClick() {
|
|
62
|
-
if (this.collapsible)
|
|
63
|
-
this.collapsed = !this.collapsed;
|
|
64
|
-
}
|
|
65
|
-
render() {
|
|
66
|
-
return html `
|
|
67
|
-
<div
|
|
68
|
-
class=${classMap({
|
|
69
|
-
"sidebar-section": true,
|
|
70
|
-
"sidebar-section--collapsed": this._sidebarCollapsed
|
|
71
|
-
})}
|
|
72
|
-
>
|
|
73
|
-
${this.title !== ""
|
|
74
|
-
? html `<div
|
|
75
|
-
class="sidebar-section-label"
|
|
76
|
-
@click=${this._handleClick}
|
|
77
|
-
aria-expanded=${!this.collapsed}
|
|
78
|
-
aria-disabled=${!this.collapsible}
|
|
79
|
-
tabindex="0"
|
|
80
|
-
>
|
|
81
|
-
<span>${this.title}</span>
|
|
82
|
-
${this.collapsible
|
|
83
|
-
? html `<sgds-icon name=${this.collapsed ? "chevron-down" : "chevron-up"} size="sm"></sgds-icon>`
|
|
84
|
-
: nothing}
|
|
85
|
-
</div>`
|
|
86
|
-
: nothing}
|
|
87
|
-
|
|
88
|
-
<div
|
|
89
|
-
class=${classMap({
|
|
90
|
-
"sidebar-section-content": true,
|
|
91
|
-
"sidebar-section-content--collapsed": this.collapsed && this.collapsible,
|
|
92
|
-
"sidebar-section-seperator": this.seperator
|
|
93
|
-
})}
|
|
94
|
-
>
|
|
95
|
-
<div>
|
|
96
|
-
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
|
|
100
|
-
${this.seperator ? html `<sgds-divider></sgds-divider>` : nothing}
|
|
101
|
-
</div>
|
|
102
|
-
`;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
SgdsSidebarSection.styles = [...SgdsElement.styles, css_248z];
|
|
106
|
-
/** @internal */
|
|
107
|
-
SgdsSidebarSection.dependencies = {
|
|
108
|
-
"sgds-icon": SgdsIcon,
|
|
109
|
-
"sgds-divider": SgdsDivider
|
|
110
|
-
};
|
|
111
|
-
__decorate([
|
|
112
|
-
property({ type: String, reflect: true })
|
|
113
|
-
], SgdsSidebarSection.prototype, "title", void 0);
|
|
114
|
-
__decorate([
|
|
115
|
-
property({ type: Boolean, reflect: true })
|
|
116
|
-
], SgdsSidebarSection.prototype, "collapsed", void 0);
|
|
117
|
-
__decorate([
|
|
118
|
-
property({ type: Boolean, reflect: true })
|
|
119
|
-
], SgdsSidebarSection.prototype, "collapsible", void 0);
|
|
120
|
-
__decorate([
|
|
121
|
-
property({ type: Boolean, reflect: true })
|
|
122
|
-
], SgdsSidebarSection.prototype, "seperator", void 0);
|
|
123
|
-
|
|
124
|
-
export { SgdsSidebarSection, SgdsSidebarSection as default };
|
|
125
|
-
//# sourceMappingURL=sgds-sidebar-section.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-sidebar-section.js","sources":["../../../src/components/Sidebar/sgds-sidebar-section.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport sidebarSectionStyle from \"./sidebar-section.css\";\n\nimport { SidebarElement } from \"./sidebar-element\";\nimport SgdsIcon from \"../Icon/sgds-icon\";\nimport SgdsDivider from \"../Divider/sgds-divider\";\n\n/**\n * @summary Sidebar section is a container component that groups related sidebar items into organized sections.\n * It displays a section header/title and can optionally be collapsible. Sections help organize navigation\n * items hierarchically within the sidebar, providing visual separation between different areas of functionality.\n *\n * @slot - Insert sgds-sidebar-item and sgds-sidebar-group elements to be grouped within this section\n */\nexport class SgdsSidebarSection extends SidebarElement {\n static styles = [...SgdsElement.styles, sidebarSectionStyle];\n\n /** @internal */\n static dependencies = {\n \"sgds-icon\": SgdsIcon,\n \"sgds-divider\": SgdsDivider\n };\n\n /**\n * The display title/label for the sidebar section header.\n * Always visible in the sidebar, used to group related items.\n * @attribute title\n * @type {string}\n * @default \"\"\n */\n @property({ type: String, reflect: true }) title = \"\";\n\n /**\n * Controls whether the section content is expanded or collapsed.\n * When true, the section content is hidden but the section header remains visible.\n * Only applicable when the section is collapsible.\n * @attribute collapsed\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean, reflect: true }) collapsed = false;\n\n /**\n * Enables a collapsible section header with expand/collapse toggle functionality.\n * When true, users can click the header to toggle section visibility.\n * When false, the section header is display-only and not interactive.\n * @attribute collapsible\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean, reflect: true }) collapsible = false;\n @property({ type: Boolean, reflect: true }) seperator = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute(\"role\", \"region\");\n this._childLevel = null;\n }\n\n /**\n * Handles click events on the section label.\n * Toggles the collapsed state to show/hide section content.\n * Only called if the section is collapsible (collapsible prop is true).\n * @private\n * @returns {void}\n */\n override _handleClick() {\n if (this.collapsible) this.collapsed = !this.collapsed;\n }\n\n render() {\n return html`\n <div\n class=${classMap({\n \"sidebar-section\": true,\n \"sidebar-section--collapsed\": this._sidebarCollapsed\n })}\n >\n ${this.title !== \"\"\n ? html`<div\n class=\"sidebar-section-label\"\n @click=${this._handleClick}\n aria-expanded=${!this.collapsed}\n aria-disabled=${!this.collapsible}\n tabindex=\"0\"\n >\n <span>${this.title}</span>\n ${this.collapsible\n ? html`<sgds-icon name=${this.collapsed ? \"chevron-down\" : \"chevron-up\"} size=\"sm\"></sgds-icon>`\n : nothing}\n </div>`\n : nothing}\n\n <div\n class=${classMap({\n \"sidebar-section-content\": true,\n \"sidebar-section-content--collapsed\": this.collapsed && this.collapsible,\n \"sidebar-section-seperator\": this.seperator\n })}\n >\n <div>\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n </div>\n\n ${this.seperator ? html`<sgds-divider></sgds-divider>` : nothing}\n </div>\n `;\n }\n}\n\nexport default SgdsSidebarSection;\n"],"names":["sidebarSectionStyle"],"mappings":"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"}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import SgdsElement from "../../base/sgds-element";
|
|
2
|
-
import SgdsSidebarGroup from "./sgds-sidebar-group";
|
|
3
|
-
import SgdsIconButton from "../IconButton/sgds-icon-button";
|
|
4
|
-
/**
|
|
5
|
-
* @summary Sidebar is a collapsible navigation component that displays menu items and groups.
|
|
6
|
-
* Users can expand and collapse the sidebar to save screen space while navigating through organized menu items.
|
|
7
|
-
* The sidebar coordinates selection and navigation across nested items using context providers and custom events.
|
|
8
|
-
*
|
|
9
|
-
* Features:
|
|
10
|
-
* - Collapsible state for space-saving layouts with icon-only mode
|
|
11
|
-
* - Multi-level nesting (up to 3 levels) with drawer overlay for root-level groups
|
|
12
|
-
* - Keyboard navigation with full ARIA support for accessibility
|
|
13
|
-
* - Programmatic link navigation support with anchor elements
|
|
14
|
-
* - Active item tracking and synchronized state management
|
|
15
|
-
*
|
|
16
|
-
* Keyboard Navigation:
|
|
17
|
-
* - Arrow Up/Down: Navigate between sidebar items and groups
|
|
18
|
-
* - Arrow Left/Right: Collapse/expand groups or navigate drawer overlays
|
|
19
|
-
* - Enter/Space: Activate focused item or toggle group
|
|
20
|
-
* - Tab: Standard focus management to interactive elements
|
|
21
|
-
*
|
|
22
|
-
* @slot default - Insert sgds-sidebar-item, sgds-sidebar-group, and sgds-sidebar-section elements
|
|
23
|
-
* @slot top - Insert brand/logo content in sidebar header
|
|
24
|
-
* @slot bottom - Insert content in sidebar footer
|
|
25
|
-
*
|
|
26
|
-
* @fires sgds-select - Emitted when a sidebar item or group is selected.
|
|
27
|
-
* Event detail: { activeItem: string } - name of the selected item
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
export declare class SgdsSidebar extends SgdsElement {
|
|
31
|
-
static styles: import("lit").CSSResult[];
|
|
32
|
-
static dependencies: {
|
|
33
|
-
"sgds-icon-button": typeof SgdsIconButton;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Controls whether the sidebar is collapsed or expanded.
|
|
37
|
-
* When true, the sidebar is in collapsed state showing only icons.
|
|
38
|
-
* When false, the sidebar is expanded displaying full labels and content.
|
|
39
|
-
* Affects all child items by toggling visibility of labels and adjusting spacing.
|
|
40
|
-
* @attribute collapsed
|
|
41
|
-
* @type {boolean}
|
|
42
|
-
* @default false
|
|
43
|
-
*/
|
|
44
|
-
collapsed: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* The name of the currently active sidebar item or group.
|
|
47
|
-
* Reflects the selected item and allows external control of sidebar selection.
|
|
48
|
-
* Used to synchronize sidebar state with external navigation state or programmatic selection.
|
|
49
|
-
* When set, the corresponding item with matching `name` attribute will be highlighted as active.
|
|
50
|
-
* @attribute active
|
|
51
|
-
* @type {string}
|
|
52
|
-
* @default ""
|
|
53
|
-
*/
|
|
54
|
-
active: string;
|
|
55
|
-
/** @internal Tracks the currently active group and provides it via context to all child elements */
|
|
56
|
-
_sidebarActiveGroup: SgdsSidebarGroup | null;
|
|
57
|
-
/** @internal Tracks the collapsed state and provides it via context to all child elements */
|
|
58
|
-
private _sidebarCollapsed;
|
|
59
|
-
/** @internal Tracks the currently active item and provides it via context to all child elements */
|
|
60
|
-
private _sidebarActiveItem;
|
|
61
|
-
/** @internal Provides the list of items shown in the drawer overlay */
|
|
62
|
-
private _drawerItems;
|
|
63
|
-
/** @internal Indicates whether a drawer overlay is currently open */
|
|
64
|
-
private _showDrawer;
|
|
65
|
-
/** @internal */
|
|
66
|
-
private _defaultNodes;
|
|
67
|
-
/** @internal */
|
|
68
|
-
private _isMobile;
|
|
69
|
-
/** @internal Bound resize handler for proper event listener removal */
|
|
70
|
-
private _boundHandleResize;
|
|
71
|
-
connectedCallback(): void;
|
|
72
|
-
disconnectedCallback(): void;
|
|
73
|
-
firstUpdated(): void;
|
|
74
|
-
updated(): void;
|
|
75
|
-
private _handleSlotChange;
|
|
76
|
-
/**
|
|
77
|
-
* Watch handler for the collapsed property.
|
|
78
|
-
* Syncs the internal collapsed state with the property value.
|
|
79
|
-
* Triggers re-render and updates all child items' collapsed styling.
|
|
80
|
-
* @private
|
|
81
|
-
* @returns {void}
|
|
82
|
-
*/
|
|
83
|
-
_handleCollapsed(): void;
|
|
84
|
-
/**
|
|
85
|
-
* Handles changes to the active item selection.
|
|
86
|
-
* Updates selection state and manages drawer overlay visibility based on the active item's nesting level.
|
|
87
|
-
* For root-level items with children, opens the drawer overlay.
|
|
88
|
-
* For nested items, expands parent groups and opens the appropriate drawer if needed.
|
|
89
|
-
* @private
|
|
90
|
-
* @returns {void}
|
|
91
|
-
*/
|
|
92
|
-
_handleActiveItem(): void;
|
|
93
|
-
/**
|
|
94
|
-
* Watch handler for the active property.
|
|
95
|
-
* Finds and sets the active item by name from the sidebar hierarchy.
|
|
96
|
-
* Clears active state when active property is empty.
|
|
97
|
-
* @private
|
|
98
|
-
* @returns {void}
|
|
99
|
-
*/
|
|
100
|
-
_handleActive(): void;
|
|
101
|
-
/**
|
|
102
|
-
* Recursively searches the sidebar hierarchy for an item matching the active name.
|
|
103
|
-
* Traverses through all nested levels to find the target element.
|
|
104
|
-
* Used to support programmatic selection of deeply nested items.
|
|
105
|
-
* @private
|
|
106
|
-
* @returns {SidebarElement | null} The matching sidebar element or null if not found
|
|
107
|
-
*/
|
|
108
|
-
private _getActiveChild;
|
|
109
|
-
/**
|
|
110
|
-
* Handles window resize events to manage responsive behavior.
|
|
111
|
-
* Automatically collapses sidebar on mobile devices (width <= SM_BREAKPOINT).
|
|
112
|
-
* Expands sidebar on larger screens.
|
|
113
|
-
* @private
|
|
114
|
-
* @returns {void}
|
|
115
|
-
*/ private _handleResize;
|
|
116
|
-
/**
|
|
117
|
-
* Manages the drawer overlay content based on the selected parent item.
|
|
118
|
-
* If element is provided: Opens drawer for that element's children.
|
|
119
|
-
* If element is undefined: Closes drawer and reverts items to their parent.
|
|
120
|
-
* @private
|
|
121
|
-
* @param {SgdsSidebarGroup} [element] - The parent item to display in drawer. Undefined closes drawer.
|
|
122
|
-
* @returns {void}
|
|
123
|
-
*/
|
|
124
|
-
private _setNodesToDrawer;
|
|
125
|
-
/**
|
|
126
|
-
* Reverts nested items back to their original parent element.
|
|
127
|
-
* Clears the drawer overlay content and updates selected attributes.
|
|
128
|
-
* Called when closing the drawer or switching to a different parent item.
|
|
129
|
-
* @private
|
|
130
|
-
* @param {SgdsSidebarItem} element - The parent item to return nodes to
|
|
131
|
-
* @returns {void}
|
|
132
|
-
*/
|
|
133
|
-
private _revertNodesToParent;
|
|
134
|
-
/**
|
|
135
|
-
* Attaches event listeners to all direct child sidebar items.
|
|
136
|
-
* Handles item selection events and drawer overlay state management.
|
|
137
|
-
* Manages emitting sgds-select custom events for external components.
|
|
138
|
-
* @private
|
|
139
|
-
* @returns {void}
|
|
140
|
-
*/
|
|
141
|
-
private addItemListeners;
|
|
142
|
-
/**
|
|
143
|
-
* Toggles the sidebar between collapsed and expanded states.
|
|
144
|
-
* Updates the collapsed property to show/hide labels and adjust item spacing.
|
|
145
|
-
* Called when user clicks the collapse/expand button in the sidebar header.
|
|
146
|
-
* @private
|
|
147
|
-
* @returns {void}
|
|
148
|
-
*/
|
|
149
|
-
private toggleCollapsed;
|
|
150
|
-
/**
|
|
151
|
-
* Handles clicks outside the sidebar to close the drawer overlay.
|
|
152
|
-
* Closes the nested items drawer when user clicks outside the sidebar.
|
|
153
|
-
* Maintains drawer visibility when clicking within sidebar boundaries.
|
|
154
|
-
* @private
|
|
155
|
-
* @param {MouseEvent} e - The click event from the document
|
|
156
|
-
* @returns {void}
|
|
157
|
-
*/
|
|
158
|
-
private _handleClickOutOfElement;
|
|
159
|
-
render(): import("lit").TemplateResult<1>;
|
|
160
|
-
}
|
|
161
|
-
export default SgdsSidebar;
|