shirkasoft-ui-components 1.13.18 → 2.0.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.
Files changed (98) hide show
  1. package/README.md +415 -42
  2. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs +189 -100
  3. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs.map +1 -1
  4. package/fesm2022/shirkasoft-ui-components-button.mjs +367 -73
  5. package/fesm2022/shirkasoft-ui-components-button.mjs.map +1 -1
  6. package/fesm2022/shirkasoft-ui-components-chart.mjs +206 -142
  7. package/fesm2022/shirkasoft-ui-components-chart.mjs.map +1 -1
  8. package/fesm2022/shirkasoft-ui-components-config.mjs +976 -0
  9. package/fesm2022/shirkasoft-ui-components-config.mjs.map +1 -0
  10. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs +307 -142
  11. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs.map +1 -1
  12. package/fesm2022/shirkasoft-ui-components-date-picker.mjs +1624 -1400
  13. package/fesm2022/shirkasoft-ui-components-date-picker.mjs.map +1 -1
  14. package/fesm2022/shirkasoft-ui-components-fieldset.mjs +347 -92
  15. package/fesm2022/shirkasoft-ui-components-fieldset.mjs.map +1 -1
  16. package/fesm2022/shirkasoft-ui-components-file-upload.mjs +484 -293
  17. package/fesm2022/shirkasoft-ui-components-file-upload.mjs.map +1 -1
  18. package/fesm2022/shirkasoft-ui-components-icons.mjs +1141 -0
  19. package/fesm2022/shirkasoft-ui-components-icons.mjs.map +1 -0
  20. package/fesm2022/shirkasoft-ui-components-knob.mjs +395 -180
  21. package/fesm2022/shirkasoft-ui-components-knob.mjs.map +1 -1
  22. package/fesm2022/shirkasoft-ui-components-loading.mjs +505 -128
  23. package/fesm2022/shirkasoft-ui-components-loading.mjs.map +1 -1
  24. package/fesm2022/shirkasoft-ui-components-modal.mjs +311 -303
  25. package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -1
  26. package/fesm2022/shirkasoft-ui-components-notification.mjs +188 -142
  27. package/fesm2022/shirkasoft-ui-components-notification.mjs.map +1 -1
  28. package/fesm2022/shirkasoft-ui-components-price-input.mjs +517 -277
  29. package/fesm2022/shirkasoft-ui-components-price-input.mjs.map +1 -1
  30. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs +669 -289
  31. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs.map +1 -1
  32. package/fesm2022/shirkasoft-ui-components-select.mjs +1014 -814
  33. package/fesm2022/shirkasoft-ui-components-select.mjs.map +1 -1
  34. package/fesm2022/shirkasoft-ui-components-sidebar.mjs +508 -184
  35. package/fesm2022/shirkasoft-ui-components-sidebar.mjs.map +1 -1
  36. package/fesm2022/shirkasoft-ui-components-skeleton.mjs +197 -57
  37. package/fesm2022/shirkasoft-ui-components-skeleton.mjs.map +1 -1
  38. package/fesm2022/shirkasoft-ui-components-table.mjs +1918 -1676
  39. package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -1
  40. package/fesm2022/shirkasoft-ui-components-tabs.mjs +419 -177
  41. package/fesm2022/shirkasoft-ui-components-tabs.mjs.map +1 -1
  42. package/fesm2022/shirkasoft-ui-components-tag.mjs +177 -51
  43. package/fesm2022/shirkasoft-ui-components-tag.mjs.map +1 -1
  44. package/fesm2022/shirkasoft-ui-components-text-field.mjs +687 -369
  45. package/fesm2022/shirkasoft-ui-components-text-field.mjs.map +1 -1
  46. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs +466 -0
  47. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs.map +1 -0
  48. package/fesm2022/shirkasoft-ui-components-theme.mjs +147 -0
  49. package/fesm2022/shirkasoft-ui-components-theme.mjs.map +1 -0
  50. package/fesm2022/shirkasoft-ui-components-timeline.mjs +791 -215
  51. package/fesm2022/shirkasoft-ui-components-timeline.mjs.map +1 -1
  52. package/fesm2022/shirkasoft-ui-components-toggle.mjs +205 -128
  53. package/fesm2022/shirkasoft-ui-components-toggle.mjs.map +1 -1
  54. package/fesm2022/shirkasoft-ui-components-tooltip.mjs +244 -180
  55. package/fesm2022/shirkasoft-ui-components-tooltip.mjs.map +1 -1
  56. package/fesm2022/shirkasoft-ui-components-utils.mjs +97 -125
  57. package/fesm2022/shirkasoft-ui-components-utils.mjs.map +1 -1
  58. package/fesm2022/shirkasoft-ui-components-wizard.mjs +673 -166
  59. package/fesm2022/shirkasoft-ui-components-wizard.mjs.map +1 -1
  60. package/fesm2022/shirkasoft-ui-components.mjs +0 -9
  61. package/package.json +37 -7
  62. package/src/baseline.css +2472 -0
  63. package/src/theme.css +15 -543
  64. package/src/themes/ocean.css +56 -0
  65. package/src/themes/sunset.css +55 -0
  66. package/src/themes/violet.css +25 -0
  67. package/src/tokens.css +612 -0
  68. package/types/shirkasoft-ui-components-breadcrumb.d.ts +59 -44
  69. package/types/shirkasoft-ui-components-button.d.ts +142 -49
  70. package/types/shirkasoft-ui-components-chart.d.ts +59 -44
  71. package/types/shirkasoft-ui-components-config.d.ts +357 -0
  72. package/types/shirkasoft-ui-components-confirm-dialog.d.ts +107 -65
  73. package/types/shirkasoft-ui-components-date-picker.d.ts +527 -373
  74. package/types/shirkasoft-ui-components-fieldset.d.ts +135 -59
  75. package/types/shirkasoft-ui-components-file-upload.d.ts +176 -106
  76. package/types/shirkasoft-ui-components-icons.d.ts +1430 -0
  77. package/types/shirkasoft-ui-components-knob.d.ts +151 -64
  78. package/types/shirkasoft-ui-components-loading.d.ts +155 -64
  79. package/types/shirkasoft-ui-components-modal.d.ts +134 -132
  80. package/types/shirkasoft-ui-components-notification.d.ts +63 -58
  81. package/types/shirkasoft-ui-components-price-input.d.ts +198 -85
  82. package/types/shirkasoft-ui-components-rail-sidebar.d.ts +262 -142
  83. package/types/shirkasoft-ui-components-select.d.ts +301 -192
  84. package/types/shirkasoft-ui-components-sidebar.d.ts +198 -92
  85. package/types/shirkasoft-ui-components-skeleton.d.ts +68 -27
  86. package/types/shirkasoft-ui-components-table.d.ts +849 -649
  87. package/types/shirkasoft-ui-components-tabs.d.ts +102 -61
  88. package/types/shirkasoft-ui-components-tag.d.ts +54 -23
  89. package/types/shirkasoft-ui-components-text-field.d.ts +231 -111
  90. package/types/shirkasoft-ui-components-theme-picker.d.ts +117 -0
  91. package/types/shirkasoft-ui-components-theme.d.ts +80 -0
  92. package/types/shirkasoft-ui-components-timeline.d.ts +326 -150
  93. package/types/shirkasoft-ui-components-toggle.d.ts +76 -45
  94. package/types/shirkasoft-ui-components-tooltip.d.ts +64 -43
  95. package/types/shirkasoft-ui-components-utils.d.ts +26 -17
  96. package/types/shirkasoft-ui-components-wizard.d.ts +236 -86
  97. package/types/shirkasoft-ui-components.d.ts +1 -2
  98. package/fesm2022/shirkasoft-ui-components.mjs.map +0 -1
@@ -1,291 +1,671 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, PLATFORM_ID, Injector, input, model, output, signal, computed, viewChild, effect, untracked, afterNextRender, HostListener, Component } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { isPlatformBrowser, CommonModule } from '@angular/common';
5
- import { LucideMenu, LucideX, LucideDynamicIcon } from '@lucide/angular';
6
- import { getIcon } from 'shirkasoft-ui-components/utils';
7
- import { TooltipComponent } from 'shirkasoft-ui-components/tooltip';
8
-
9
- /**
10
- * Shirkasoft UI Components.
11
- * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
12
- * Belongs to Shirkasoft.
13
- */
14
- /** Counter used to generate unique element ids per instance. */
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, HostListener, Injector, PLATFORM_ID, afterNextRender, computed, effect, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
3
+ import * as i1 from "@angular/common";
4
+ import { CommonModule, isPlatformBrowser } from "@angular/common";
5
+ import { LucideMenu, LucideX, ShkIconDirective } from "shirkasoft-ui-components/icons";
6
+ import { getIcon } from "shirkasoft-ui-components/utils";
7
+ import { TooltipComponent } from "shirkasoft-ui-components/tooltip";
15
8
  let nextRailId = 0;
16
- /**
17
- * Narrow "rail" sidebar that expands into sections. Supports sections, roles,
18
- * language switching, collapse/expand and responsive tooltips. Below
19
- * `mobileBreakpoint` it turns into an off-canvas drawer opened from a
20
- * hamburger button, so it doesn't take any width from the page.
21
- */
22
- class RailSidebarComponent {
23
- constructor() {
24
- this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
25
- this.injector = inject(Injector);
26
- /** Unique id of the drawer (for aria-controls). */
27
- this.uid = `shk-rail-${nextRailId++}`;
28
- /** Sections presented as expandable areas of the rail. */
29
- this.sections = input([], ...(ngDevMode ? [{ debugName: "sections" }] : /* istanbul ignore next */ []));
30
- /** Current location url used to detect the active section/item. */
31
- this.activeUrl = input('', ...(ngDevMode ? [{ debugName: "activeUrl" }] : /* istanbul ignore next */ []));
32
- /** Key of the active section, bindable with [(activeSectionKey)]. */
33
- this.activeSectionKey = model('', ...(ngDevMode ? [{ debugName: "activeSectionKey" }] : /* istanbul ignore next */ []));
34
- /** Collapsed (rail only) state, bindable with [(collapsed)]. */
35
- this.collapsed = model(false, ...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
36
- /** Active language code. */
37
- this.activeLang = input('es', ...(ngDevMode ? [{ debugName: "activeLang" }] : /* istanbul ignore next */ []));
38
- /** Languages available in the language switcher. */
39
- this.langs = input(['es', 'en'], ...(ngDevMode ? [{ debugName: "langs" }] : /* istanbul ignore next */ []));
40
- /** Brand logo image/url. */
41
- this.logo = input('', ...(ngDevMode ? [{ debugName: "logo" }] : /* istanbul ignore next */ []));
42
- /** Application name shown when expanded. */
43
- this.appName = input('', ...(ngDevMode ? [{ debugName: "appName" }] : /* istanbul ignore next */ []));
44
- /** Role used to filter items that declare `roles`. */
45
- this.userRole = input('', ...(ngDevMode ? [{ debugName: "userRole" }] : /* istanbul ignore next */ []));
46
- /** Optional transform applied to item labels (e.g. i18n). */
47
- this.labelPipe = input((label) => label, ...(ngDevMode ? [{ debugName: "labelPipe" }] : /* istanbul ignore next */ []));
48
- /** Width of the collapsed rail. */
49
- this.railWidth = input('4.5rem', ...(ngDevMode ? [{ debugName: "railWidth" }] : /* istanbul ignore next */ []));
50
- /** Width when a section is expanded. */
51
- this.expandedWidth = input('16.5rem', ...(ngDevMode ? [{ debugName: "expandedWidth" }] : /* istanbul ignore next */ []));
52
- /** Tooltip for the workspace/home action. */
53
- this.workspaceTooltip = input('Inicio', ...(ngDevMode ? [{ debugName: "workspaceTooltip" }] : /* istanbul ignore next */ []));
54
- /** Tooltip for the logout action. */
55
- this.logoutTooltip = input('Cerrar sesión', ...(ngDevMode ? [{ debugName: "logoutTooltip" }] : /* istanbul ignore next */ []));
56
- /** Tooltip for collapsing the sidebar. */
57
- this.collapseTooltip = input('Colapsar', ...(ngDevMode ? [{ debugName: "collapseTooltip" }] : /* istanbul ignore next */ []));
58
- /** Tooltip for expanding the sidebar. */
59
- this.expandTooltip = input('Expandir', ...(ngDevMode ? [{ debugName: "expandTooltip" }] : /* istanbul ignore next */ []));
60
- /** Turns the sidebar into a hamburger + drawer below `mobileBreakpoint`. */
61
- this.responsive = input(true, ...(ngDevMode ? [{ debugName: "responsive" }] : /* istanbul ignore next */ []));
62
- /** Viewport width (px) under which the mobile drawer is used. */
63
- this.mobileBreakpoint = input(1024, ...(ngDevMode ? [{ debugName: "mobileBreakpoint" }] : /* istanbul ignore next */ []));
64
- /**
65
- * Renders the built-in hamburger button on mobile. Set it to false when the
66
- * app has its own top bar and toggles `[(mobileOpen)]` itself.
67
- */
68
- this.showMobileToggle = input(true, ...(ngDevMode ? [{ debugName: "showMobileToggle" }] : /* istanbul ignore next */ []));
69
- /** Mobile drawer open state, bindable with [(mobileOpen)]. */
70
- this.mobileOpen = model(false, ...(ngDevMode ? [{ debugName: "mobileOpen" }] : /* istanbul ignore next */ []));
71
- /** Accessible label of the hamburger button. */
72
- this.openMenuLabel = input('Abrir menú', ...(ngDevMode ? [{ debugName: "openMenuLabel" }] : /* istanbul ignore next */ []));
73
- /** Accessible label of the drawer close button. */
74
- this.closeMenuLabel = input('Cerrar menú', ...(ngDevMode ? [{ debugName: "closeMenuLabel" }] : /* istanbul ignore next */ []));
75
- /** Emitted when a section is selected, with its key and optional route. */
76
- this.sectionSelected = output();
77
- /** Emitted when a navigation item is clicked. */
78
- this.itemClick = output();
79
- /** Emitted with the next language code when the user switches language. */
80
- this.setLang = output();
81
- /** Emitted when the user requests to log out. */
82
- this.logoutRequested = output();
83
- /** Emitted with the new collapsed state after toggling. */
84
- this.toggleSidebar = output();
85
- /** Emitted when the workspace/home entry is clicked. */
86
- this.workspaceClick = output();
87
- this.getIcon = (name) => getIcon(name, LucideMenu);
88
- this.closeIcon = LucideX;
89
- /** Current viewport width (updated on resize). */
90
- this.viewportWidth = signal(this.isBrowser ? window.innerWidth : Number.MAX_SAFE_INTEGER, ...(ngDevMode ? [{ debugName: "viewportWidth" }] : /* istanbul ignore next */ []));
91
- /** Whether the mobile drawer mode is active. */
92
- this.isMobile = computed(() => this.responsive() && this.viewportWidth() < this.mobileBreakpoint(), ...(ngDevMode ? [{ debugName: "isMobile" }] : /* istanbul ignore next */ []));
93
- /** Whether the section panel is shown (always in the mobile drawer). */
94
- this.expanded = computed(() => this.isMobile() || !this.collapsed(), ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
95
- this.hamburgerBtn = viewChild('hamburger', ...(ngDevMode ? [{ debugName: "hamburgerBtn" }] : /* istanbul ignore next */ []));
96
- this.closeBtn = viewChild('closeBtn', ...(ngDevMode ? [{ debugName: "closeBtn" }] : /* istanbul ignore next */ []));
97
- /** Set of group ids currently expanded. */
98
- this.expandedGroups = signal(new Set(), ...(ngDevMode ? [{ debugName: "expandedGroups" }] : /* istanbul ignore next */ []));
99
- /** Current sidebar width depending on the collapsed state. */
100
- this.width = computed(() => this.expanded() ? this.expandedWidth() : this.railWidth(), ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
101
- /** The section currently selected. */
102
- this.activeSection = computed(() => this.sections().find((s) => s.key === this.activeSectionKey()) ?? null, ...(ngDevMode ? [{ debugName: "activeSection" }] : /* istanbul ignore next */ []));
103
- /** Items of the active section, filtered by role. */
104
- this.navItems = computed(() => {
105
- const role = this.userRole();
106
- const items = this.activeSection()?.items ?? [];
107
- return items.filter((item) => {
108
- if (!item.roles || item.roles.length === 0)
109
- return true;
110
- return role ? item.roles.includes(role) : false;
111
- });
112
- }, ...(ngDevMode ? [{ debugName: "navItems" }] : /* istanbul ignore next */ []));
113
- // Leaving mobile mode closes the drawer.
114
- effect(() => {
115
- if (!this.isMobile() && untracked(this.mobileOpen))
116
- this.mobileOpen.set(false);
117
- });
118
- // Lock the page scroll while the drawer is open.
119
- effect((onCleanup) => {
120
- if (!this.isBrowser || !(this.isMobile() && this.mobileOpen()))
121
- return;
122
- const body = document.body;
123
- const previous = body.style.overflow;
124
- body.style.overflow = 'hidden';
125
- onCleanup(() => (body.style.overflow = previous));
126
- });
127
- effect(() => {
128
- const url = this.activeUrl();
129
- if (!url)
130
- return;
131
- const section = this.sections().find((s) => {
132
- if (s.matchPrefixes?.length) {
133
- return s.matchPrefixes.some((prefix) => url.startsWith(prefix));
134
- }
135
- return s.routerLink ? url.startsWith(s.routerLink) : false;
136
- });
137
- if (section) {
138
- this.activeSectionKey.set(section.key);
139
- }
140
- });
141
- }
142
- onResize() {
143
- if (this.isBrowser)
144
- this.viewportWidth.set(window.innerWidth);
145
- }
146
- onEscape() {
147
- if (this.isMobile() && this.mobileOpen())
148
- this.closeMobile();
149
- }
150
- /** Opens the mobile drawer and moves the focus into it. */
151
- openMobile() {
152
- this.mobileOpen.set(true);
153
- afterNextRender(() => this.closeBtn()?.nativeElement.focus(), { injector: this.injector });
154
- }
155
- /** Closes the mobile drawer and gives the focus back to the hamburger. */
156
- closeMobile() {
157
- if (!this.mobileOpen())
158
- return;
159
- this.mobileOpen.set(false);
160
- afterNextRender(() => this.hamburgerBtn()?.nativeElement.focus(), { injector: this.injector });
161
- }
162
- /** Applies the `labelPipe` transform to a label. */
163
- label(label) {
164
- return this.labelPipe()(label);
165
- }
166
- /** Whether the section matches the active key. */
167
- isSectionActive(section) {
168
- return section.key === this.activeSectionKey();
169
- }
170
- /** Whether the item is the best route match for the active url. */
171
- isItemActive(item) {
172
- if (!item.routerLink)
173
- return false;
174
- return this.bestMatchItem() === item;
175
- }
176
- /** Whether one of the item's children matches the active url. */
177
- isGroupActive(item) {
178
- return (item.children?.some((c) => c.routerLink && this.matchesUrl(c.routerLink, this.activeUrl())) ?? false);
179
- }
180
- /** Exact or prefix match between a router link and the active url. */
181
- matchesUrl(routerLink, url) {
182
- return url === routerLink || url.startsWith(routerLink + '/');
183
- }
184
- /** Longest (most specific) item whose route matches the active url. */
185
- bestMatchItem() {
186
- const url = this.activeUrl();
187
- let best = null;
188
- for (const item of this.navItems()) {
189
- if (item.routerLink && this.matchesUrl(item.routerLink, url)) {
190
- if (!best || item.routerLink.length > best.routerLink.length) {
191
- best = item;
192
- }
193
- }
194
- for (const child of item.children ?? []) {
195
- if (!child.routerLink || !this.matchesUrl(child.routerLink, url))
196
- continue;
197
- if (!best || child.routerLink.length > best.routerLink.length) {
198
- best = child;
199
- }
200
- }
201
- }
202
- return best;
203
- }
204
- /** Whether a group is expanded. */
205
- isGroupExpanded(item) {
206
- return this.expandedGroups().has(item.id);
207
- }
208
- /** Toggles the expanded state of a group. */
209
- toggleGroup(item) {
210
- this.expandedGroups.update((set) => {
211
- const next = new Set(set);
212
- if (next.has(item.id)) {
213
- next.delete(item.id);
214
- }
215
- else {
216
- next.add(item.id);
217
- }
218
- return next;
219
- });
220
- }
221
- /** Selects a section, emits `sectionSelected` and expands the rail when collapsed. */
222
- onSectionClick(section) {
223
- this.activeSectionKey.set(section.key);
224
- this.sectionSelected.emit({ key: section.key, routerLink: section.routerLink });
225
- if (!this.isMobile() && this.collapsed()) {
226
- this.collapsed.set(false);
227
- this.toggleSidebar.emit(false);
228
- }
229
- }
230
- /** Emits `itemClick` for a navigation item (skipping disabled items). */
231
- onItemClick(item) {
232
- if (item.disabled)
233
- return;
234
- this.itemClick.emit(item);
235
- if (this.isMobile())
236
- this.closeMobile();
237
- }
238
- /** Emits `workspaceClick` and expands the sidebar if it was collapsed. */
239
- onWorkspace() {
240
- this.workspaceClick.emit();
241
- if (!this.isMobile() && this.collapsed()) {
242
- this.collapsed.set(false);
243
- this.toggleSidebar.emit(false);
244
- }
245
- }
246
- /** Emits `logoutRequested` (closing the mobile drawer). */
247
- onLogout() {
248
- this.logoutRequested.emit();
249
- if (this.isMobile())
250
- this.closeMobile();
251
- }
252
- /** Cycles to the next language and emits `setLang`. */
253
- onToggleLang() {
254
- const langs = this.langs();
255
- if (langs.length === 0)
256
- return;
257
- const idx = langs.indexOf(this.activeLang());
258
- const next = langs[(idx + 1) % langs.length] ?? langs[0];
259
- this.setLang.emit(next);
260
- }
261
- /** Toggles collapse and emits `toggleSidebar`. */
262
- onToggleSidebar() {
263
- if (this.isMobile()) {
264
- this.closeMobile();
265
- return;
266
- }
267
- this.collapsed.update((v) => !v);
268
- this.toggleSidebar.emit(this.collapsed());
269
- }
270
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: RailSidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
271
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: RailSidebarComponent, isStandalone: true, selector: "shk-rail-sidebar", inputs: { sections: { classPropertyName: "sections", publicName: "sections", isSignal: true, isRequired: false, transformFunction: null }, activeUrl: { classPropertyName: "activeUrl", publicName: "activeUrl", isSignal: true, isRequired: false, transformFunction: null }, activeSectionKey: { classPropertyName: "activeSectionKey", publicName: "activeSectionKey", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, activeLang: { classPropertyName: "activeLang", publicName: "activeLang", isSignal: true, isRequired: false, transformFunction: null }, langs: { classPropertyName: "langs", publicName: "langs", isSignal: true, isRequired: false, transformFunction: null }, logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, appName: { classPropertyName: "appName", publicName: "appName", isSignal: true, isRequired: false, transformFunction: null }, userRole: { classPropertyName: "userRole", publicName: "userRole", isSignal: true, isRequired: false, transformFunction: null }, labelPipe: { classPropertyName: "labelPipe", publicName: "labelPipe", isSignal: true, isRequired: false, transformFunction: null }, railWidth: { classPropertyName: "railWidth", publicName: "railWidth", isSignal: true, isRequired: false, transformFunction: null }, expandedWidth: { classPropertyName: "expandedWidth", publicName: "expandedWidth", isSignal: true, isRequired: false, transformFunction: null }, workspaceTooltip: { classPropertyName: "workspaceTooltip", publicName: "workspaceTooltip", isSignal: true, isRequired: false, transformFunction: null }, logoutTooltip: { classPropertyName: "logoutTooltip", publicName: "logoutTooltip", isSignal: true, isRequired: false, transformFunction: null }, collapseTooltip: { classPropertyName: "collapseTooltip", publicName: "collapseTooltip", isSignal: true, isRequired: false, transformFunction: null }, expandTooltip: { classPropertyName: "expandTooltip", publicName: "expandTooltip", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, mobileBreakpoint: { classPropertyName: "mobileBreakpoint", publicName: "mobileBreakpoint", isSignal: true, isRequired: false, transformFunction: null }, showMobileToggle: { classPropertyName: "showMobileToggle", publicName: "showMobileToggle", isSignal: true, isRequired: false, transformFunction: null }, mobileOpen: { classPropertyName: "mobileOpen", publicName: "mobileOpen", isSignal: true, isRequired: false, transformFunction: null }, openMenuLabel: { classPropertyName: "openMenuLabel", publicName: "openMenuLabel", isSignal: true, isRequired: false, transformFunction: null }, closeMenuLabel: { classPropertyName: "closeMenuLabel", publicName: "closeMenuLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeSectionKey: "activeSectionKeyChange", collapsed: "collapsedChange", mobileOpen: "mobileOpenChange", sectionSelected: "sectionSelected", itemClick: "itemClick", setLang: "setLang", logoutRequested: "logoutRequested", toggleSidebar: "toggleSidebar", workspaceClick: "workspaceClick" }, host: { listeners: { "window:resize": "onResize()", "document:keydown.escape": "onEscape()" }, properties: { "class.rail-is-mobile": "isMobile()" } }, viewQueries: [{ propertyName: "hamburgerBtn", first: true, predicate: ["hamburger"], descendants: true, isSignal: true }, { propertyName: "closeBtn", first: true, predicate: ["closeBtn"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (isMobile()) {\n <!-- Mobile: hamburger button + backdrop (the aside becomes a drawer) -->\n @if (showMobileToggle() && !mobileOpen()) {\n <button\n #hamburger\n type=\"button\"\n class=\"rail-hamburger _shk-bg-white dark:[background-color:var(--shk-surface-100)] border _shk-border dark:[border-color:var(--shk-surface-200)] _shk-text-surface-700 dark:[color:var(--shk-surface-700)]\"\n [attr.aria-label]=\"openMenuLabel()\"\n aria-expanded=\"false\"\n [attr.aria-controls]=\"uid\"\n (click)=\"openMobile()\"\n >\n <svg [lucideIcon]=\"getIcon('menu')\" class=\"w-5 h-5\"></svg>\n </button>\n }\n <div class=\"rail-backdrop\" [class.is-open]=\"mobileOpen()\" (click)=\"closeMobile()\"></div>\n}\n\n<aside\n [id]=\"uid\"\n class=\"h-full flex overflow-hidden shrink-0 _shk-bg-white dark:[background-color:var(--shk-surface-50)] border-r _shk-border dark:[border-color:var(--shk-surface-100)]\"\n [class.rail-drawer]=\"isMobile()\"\n [class.is-open]=\"isMobile() && mobileOpen()\"\n [attr.role]=\"isMobile() ? 'dialog' : null\"\n [attr.aria-modal]=\"isMobile() && mobileOpen() ? 'true' : null\"\n [attr.aria-label]=\"isMobile() ? appName() || openMenuLabel() : null\"\n [attr.inert]=\"isMobile() && !mobileOpen() ? '' : null\"\n [style.width]=\"width()\"\n>\n <!-- Rail: vertical icon column -->\n <div\n class=\"h-full flex flex-col items-center shrink-0 px-[0.3rem] py-2 gap-1 border-r _shk-border dark:[border-color:var(--shk-surface-100)]\"\n [style.width]=\"railWidth()\"\n >\n <!-- Workspace / logo -->\n <div class=\"flex items-center justify-center w-full\">\n <button\n type=\"button\"\n (click)=\"onWorkspace()\"\n [class.is-collapsed]=\"!expanded()\"\n class=\"rail-workspace w-[3.2rem] h-[3.2rem] rounded-xl _shk-bg-surface-100 dark:[background-color:var(--shk-surface-200)] border-none grid place-items-center p-0 relative transition-all\"\n [title]=\"workspaceTooltip()\"\n >\n @if (logo()) {\n <img [src]=\"logo()\" alt=\"Logo\" class=\"rail-app-icon w-8 h-8 object-contain\" />\n } @else {\n <svg [lucideIcon]=\"getIcon('menu')\" class=\"rail-app-icon w-6 h-6 _shk-text-surface-700 dark:[color:var(--shk-surface-700)]\"></svg>\n }\n @if (!expanded()) {\n <svg [lucideIcon]=\"getIcon('panel-right')\" class=\"rail-toggle-icon w-5 h-5 _shk-text-surface-700 dark:[color:var(--shk-surface-700)]\"></svg>\n }\n </button>\n </div>\n\n <!-- Section actions -->\n <div class=\"rail-actions flex-1 flex flex-col items-center gap-1 pt-1\">\n @for (section of sections(); track section.key) {\n <shk-tooltip [text]=\"label(section.label)\" position=\"right\" mode=\"fixed\">\n <button\n type=\"button\"\n (click)=\"onSectionClick(section)\"\n class=\"rail-icon w-[3.4rem] h-[3.4rem] rounded-[0.85rem] grid place-items-center transition-all cursor-pointer\"\n [class.is-active]=\"isSectionActive(section)\"\n [attr.aria-label]=\"label(section.label)\"\n >\n <svg [lucideIcon]=\"getIcon(section.icon)\" class=\"w-5 h-5\"></svg>\n </button>\n </shk-tooltip>\n }\n </div>\n\n <!-- Bottom: language + logout -->\n <div class=\"rail-bottom mt-auto flex flex-col items-center gap-1\">\n <button\n type=\"button\"\n (click)=\"onToggleLang()\"\n class=\"rail-icon w-[3.4rem] h-[3.4rem] rounded-[0.85rem] grid place-items-center transition-all cursor-pointer\"\n [title]=\"activeLang()\"\n >\n <div class=\"flex flex-col items-center gap-[0.15rem]\">\n <svg [lucideIcon]=\"getIcon('languages')\" class=\"w-5 h-5\"></svg>\n <span class=\"rail-lang-code text-[0.5rem] font-bold tracking-[0.05em] leading-none\">{{ activeLang() | uppercase }}</span>\n </div>\n </button>\n\n <button\n type=\"button\"\n (click)=\"onLogout()\"\n class=\"rail-icon rail-logout w-[3.4rem] h-[3.4rem] rounded-[0.85rem] grid place-items-center transition-all cursor-pointer\"\n [title]=\"logoutTooltip()\"\n >\n <svg [lucideIcon]=\"getIcon('log-out')\" class=\"w-5 h-5\"></svg>\n </button>\n </div>\n </div>\n\n <!-- Nav: section panel (hidden when collapsed) -->\n @if (expanded()) {\n <div class=\"flex-1 min-w-0 flex flex-col _shk-bg-white dark:[background-color:var(--shk-surface-50)]\">\n <!-- Brand header -->\n <div class=\"flex items-center justify-between gap-2 px-3 py-4 border-b _shk-border dark:[border-color:var(--shk-surface-100)]\">\n <span class=\"nav-app text-base font-bold whitespace-nowrap overflow-hidden text-ellipsis _shk-text-surface-800 dark:[color:var(--shk-surface-800)]\">\n {{ appName() }}\n </span>\n <button\n #closeBtn\n type=\"button\"\n (click)=\"onToggleSidebar()\"\n class=\"nav-toggle w-[1.8rem] h-[1.8rem] rounded-lg border-none bg-transparent grid place-items-center cursor-pointer shrink-0 transition-colors _shk-text-surface-700 dark:[color:var(--shk-surface-700)] hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)]\"\n [title]=\"isMobile() ? closeMenuLabel() : collapseTooltip()\"\n [attr.aria-label]=\"isMobile() ? closeMenuLabel() : collapseTooltip()\"\n >\n <svg [lucideIcon]=\"isMobile() ? closeIcon : getIcon('panel-right')\" class=\"w-4 h-4\"></svg>\n </button>\n </div>\n\n <!-- Menu -->\n <nav class=\"flex-1 overflow-y-auto _shk-scrollbar px-2 py-3\">\n @if (activeSection()) {\n <div class=\"px-2 pb-3\">\n <span class=\"nav-section-label text-xs font-bold tracking-[0.08em] uppercase _shk-text-surface-400 dark:[color:var(--shk-surface-500)] block whitespace-nowrap overflow-hidden text-ellipsis\">\n {{ label(activeSection()!.label) }}\n </span>\n </div>\n }\n\n <ul class=\"space-y-1\">\n @for (item of navItems(); track item.id) {\n @if (item.separator) {\n <li class=\"my-2 border-t _shk-border dark:[border-color:var(--shk-surface-200)]\"></li>\n }\n\n @if (item.children?.length) {\n <!-- Expandable group -->\n <li>\n <button\n type=\"button\"\n (click)=\"toggleGroup(item)\"\n class=\"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200\"\n [class._shk-bg-primary]=\"isGroupActive(item)\"\n [class._shk-text-white]=\"isGroupActive(item)\"\n [class.shadow-md]=\"isGroupActive(item)\"\n [class._shk-text-surface-700]=\"!isGroupActive(item)\"\n [class.dark:[color:var(--shk-surface-600)]]=\"!isGroupActive(item)\"\n [class.hover:[background-color:var(--shk-surface-100)]]=\"!isGroupActive(item)\"\n [class.dark:hover:[background-color:var(--shk-surface-200)]]=\"!isGroupActive(item)\"\n >\n @if (item.icon) {\n <svg [lucideIcon]=\"getIcon(item.icon)\" class=\"w-5 h-5 shrink-0\"></svg>\n }\n <span class=\"flex-1 text-left whitespace-nowrap overflow-hidden\">{{ label(item.label) }}</span>\n <svg\n [lucideIcon]=\"getIcon('chevron-down')\"\n class=\"w-4 h-4 transition-transform duration-200 shrink-0\"\n [class.rotate-180]=\"isGroupExpanded(item)\"\n ></svg>\n </button>\n\n @if (isGroupExpanded(item)) {\n <ul class=\"ml-3 mt-1 space-y-1 border-l-2 _shk-border dark:[border-color:var(--shk-surface-200)] pl-2\">\n @for (child of item.children; track child.id) {\n <li>\n <button\n type=\"button\"\n (click)=\"onItemClick(child)\"\n class=\"w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-all duration-200\"\n [class._shk-bg-primary-soft]=\"isItemActive(child)\"\n [class._shk-bg-primary-soft-dark]=\"isItemActive(child)\"\n [class._shk-text-primary-700]=\"isItemActive(child)\"\n [class.dark:[color:var(--shk-primary-300)]]=\"isItemActive(child)\"\n [class._shk-text-surface-600]=\"!isItemActive(child)\"\n [class.dark:[color:var(--shk-surface-400)]]=\"!isItemActive(child)\"\n [class.hover:[background-color:var(--shk-surface-100)]]=\"!isItemActive(child)\"\n [class.dark:hover:[background-color:var(--shk-surface-200)]]=\"!isItemActive(child)\"\n [class.hover:[color:var(--shk-surface-900)]]=\"!isItemActive(child)\"\n [class.dark:hover:[color:var(--shk-surface-700)]]=\"!isItemActive(child)\"\n >\n @if (child.icon) {\n <svg [lucideIcon]=\"getIcon(child.icon)\" class=\"w-4 h-4 shrink-0\"></svg>\n }\n <span class=\"whitespace-nowrap overflow-hidden\">{{ label(child.label) }}</span>\n @if (isItemActive(child)) {\n <span class=\"w-1.5 h-1.5 rounded-full _shk-bg-primary shrink-0 ml-auto\"></span>\n }\n </button>\n </li>\n }\n </ul>\n }\n </li>\n } @else {\n <!-- Standalone item -->\n <li>\n <button\n type=\"button\"\n (click)=\"onItemClick(item)\"\n class=\"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200\"\n [class._shk-bg-primary]=\"isItemActive(item)\"\n [class._shk-text-white]=\"isItemActive(item)\"\n [class.shadow-md]=\"isItemActive(item)\"\n [class._shk-text-surface-700]=\"!isItemActive(item)\"\n [class.dark:[color:var(--shk-surface-600)]]=\"!isItemActive(item)\"\n [class.hover:[background-color:var(--shk-surface-100)]]=\"!isItemActive(item)\"\n [class.dark:hover:[background-color:var(--shk-surface-200)]]=\"!isItemActive(item)\"\n >\n @if (item.icon) {\n <svg [lucideIcon]=\"getIcon(item.icon)\" class=\"w-5 h-5 shrink-0\"></svg>\n }\n <span class=\"flex-1 text-left whitespace-nowrap overflow-hidden\">{{ label(item.label) }}</span>\n @if (item.badge !== undefined) {\n <span class=\"text-xs font-bold px-2 py-0.5 rounded-full _shk-bg-primary _shk-text-white shrink-0\">\n {{ item.badge }}\n </span>\n }\n </button>\n </li>\n }\n }\n </ul>\n </nav>\n </div>\n }\n</aside>\n", styles: [":host{display:block;height:100%}:host(.rail-is-mobile){position:relative;width:0;min-width:0;flex:0 0 0;overflow:visible}.rail-hamburger{position:absolute;top:.75rem;left:.75rem;z-index:30;display:grid;place-items:center;width:2.5rem;height:2.5rem;border-radius:.625rem;box-shadow:0 1px 3px #0000001f;cursor:pointer;transition:background-color .15s ease}.rail-hamburger:hover{background-color:var(--shk-surface-100)}.rail-hamburger:focus-visible{outline:2px solid var(--shk-primary-500);outline-offset:2px}.rail-backdrop{position:fixed;inset:0;z-index:49;background-color:var(--shk-bg-overlay, rgba(0, 0, 0, .4));opacity:0;pointer-events:none;transition:opacity .25s ease}.rail-backdrop.is-open{opacity:1;pointer-events:auto}.rail-drawer{position:fixed;top:0;left:0;bottom:0;z-index:50;height:100dvh;max-width:85vw;transform:translate(-100%);visibility:hidden;transition:transform .25s ease,visibility 0s linear .25s}.rail-drawer.is-open{transform:translate(0);visibility:visible;box-shadow:0 10px 30px #00000040;transition:transform .25s ease}@media(prefers-reduced-motion:reduce){.rail-drawer,.rail-drawer.is-open,.rail-backdrop{transition:none}}.rail-workspace{cursor:pointer;transition:opacity .2s ease,box-shadow .2s ease}.rail-workspace.is-collapsed:hover{cursor:col-resize}.rail-workspace .rail-app-icon,.rail-workspace .rail-toggle-icon{grid-area:1 / 1 / 2 / 2;transition:opacity .2s ease}.rail-toggle-icon,.rail-workspace.is-collapsed:hover .rail-app-icon{opacity:0}.rail-workspace.is-collapsed:hover .rail-toggle-icon{opacity:1}.rail-icon{background:transparent;color:var(--shk-surface-700);border:1px solid transparent;transition:transform .18s ease,color .18s ease,background-color .18s ease,box-shadow .18s ease}.rail-icon svg{stroke-width:1.8}.rail-icon:hover{background:var(--shk-surface-100);color:var(--shk-primary-600)}.dark .rail-icon:hover{background:var(--shk-surface-200);color:var(--shk-primary-400)}.rail-icon.is-active{background:var(--shk-primary-600);color:#fff;box-shadow:0 1px 2px #0003}.dark .rail-icon.is-active{background:var(--shk-primary-500);color:#fff}.rail-logout:hover{color:var(--shk-error-500)}.dark .rail-logout:hover{color:var(--shk-error-400)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: LucideDynamicIcon, selector: "svg[lucideIcon]", inputs: ["lucideIcon"] }, { kind: "component", type: TooltipComponent, selector: "shk-tooltip", inputs: ["text", "position", "mode", "offset"] }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }] }); }
272
- }
273
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: RailSidebarComponent, decorators: [{
274
- type: Component,
275
- args: [{ selector: 'shk-rail-sidebar', standalone: true, imports: [CommonModule, LucideDynamicIcon, TooltipComponent], host: {
276
- '[class.rail-is-mobile]': 'isMobile()',
277
- }, template: "@if (isMobile()) {\n <!-- Mobile: hamburger button + backdrop (the aside becomes a drawer) -->\n @if (showMobileToggle() && !mobileOpen()) {\n <button\n #hamburger\n type=\"button\"\n class=\"rail-hamburger _shk-bg-white dark:[background-color:var(--shk-surface-100)] border _shk-border dark:[border-color:var(--shk-surface-200)] _shk-text-surface-700 dark:[color:var(--shk-surface-700)]\"\n [attr.aria-label]=\"openMenuLabel()\"\n aria-expanded=\"false\"\n [attr.aria-controls]=\"uid\"\n (click)=\"openMobile()\"\n >\n <svg [lucideIcon]=\"getIcon('menu')\" class=\"w-5 h-5\"></svg>\n </button>\n }\n <div class=\"rail-backdrop\" [class.is-open]=\"mobileOpen()\" (click)=\"closeMobile()\"></div>\n}\n\n<aside\n [id]=\"uid\"\n class=\"h-full flex overflow-hidden shrink-0 _shk-bg-white dark:[background-color:var(--shk-surface-50)] border-r _shk-border dark:[border-color:var(--shk-surface-100)]\"\n [class.rail-drawer]=\"isMobile()\"\n [class.is-open]=\"isMobile() && mobileOpen()\"\n [attr.role]=\"isMobile() ? 'dialog' : null\"\n [attr.aria-modal]=\"isMobile() && mobileOpen() ? 'true' : null\"\n [attr.aria-label]=\"isMobile() ? appName() || openMenuLabel() : null\"\n [attr.inert]=\"isMobile() && !mobileOpen() ? '' : null\"\n [style.width]=\"width()\"\n>\n <!-- Rail: vertical icon column -->\n <div\n class=\"h-full flex flex-col items-center shrink-0 px-[0.3rem] py-2 gap-1 border-r _shk-border dark:[border-color:var(--shk-surface-100)]\"\n [style.width]=\"railWidth()\"\n >\n <!-- Workspace / logo -->\n <div class=\"flex items-center justify-center w-full\">\n <button\n type=\"button\"\n (click)=\"onWorkspace()\"\n [class.is-collapsed]=\"!expanded()\"\n class=\"rail-workspace w-[3.2rem] h-[3.2rem] rounded-xl _shk-bg-surface-100 dark:[background-color:var(--shk-surface-200)] border-none grid place-items-center p-0 relative transition-all\"\n [title]=\"workspaceTooltip()\"\n >\n @if (logo()) {\n <img [src]=\"logo()\" alt=\"Logo\" class=\"rail-app-icon w-8 h-8 object-contain\" />\n } @else {\n <svg [lucideIcon]=\"getIcon('menu')\" class=\"rail-app-icon w-6 h-6 _shk-text-surface-700 dark:[color:var(--shk-surface-700)]\"></svg>\n }\n @if (!expanded()) {\n <svg [lucideIcon]=\"getIcon('panel-right')\" class=\"rail-toggle-icon w-5 h-5 _shk-text-surface-700 dark:[color:var(--shk-surface-700)]\"></svg>\n }\n </button>\n </div>\n\n <!-- Section actions -->\n <div class=\"rail-actions flex-1 flex flex-col items-center gap-1 pt-1\">\n @for (section of sections(); track section.key) {\n <shk-tooltip [text]=\"label(section.label)\" position=\"right\" mode=\"fixed\">\n <button\n type=\"button\"\n (click)=\"onSectionClick(section)\"\n class=\"rail-icon w-[3.4rem] h-[3.4rem] rounded-[0.85rem] grid place-items-center transition-all cursor-pointer\"\n [class.is-active]=\"isSectionActive(section)\"\n [attr.aria-label]=\"label(section.label)\"\n >\n <svg [lucideIcon]=\"getIcon(section.icon)\" class=\"w-5 h-5\"></svg>\n </button>\n </shk-tooltip>\n }\n </div>\n\n <!-- Bottom: language + logout -->\n <div class=\"rail-bottom mt-auto flex flex-col items-center gap-1\">\n <button\n type=\"button\"\n (click)=\"onToggleLang()\"\n class=\"rail-icon w-[3.4rem] h-[3.4rem] rounded-[0.85rem] grid place-items-center transition-all cursor-pointer\"\n [title]=\"activeLang()\"\n >\n <div class=\"flex flex-col items-center gap-[0.15rem]\">\n <svg [lucideIcon]=\"getIcon('languages')\" class=\"w-5 h-5\"></svg>\n <span class=\"rail-lang-code text-[0.5rem] font-bold tracking-[0.05em] leading-none\">{{ activeLang() | uppercase }}</span>\n </div>\n </button>\n\n <button\n type=\"button\"\n (click)=\"onLogout()\"\n class=\"rail-icon rail-logout w-[3.4rem] h-[3.4rem] rounded-[0.85rem] grid place-items-center transition-all cursor-pointer\"\n [title]=\"logoutTooltip()\"\n >\n <svg [lucideIcon]=\"getIcon('log-out')\" class=\"w-5 h-5\"></svg>\n </button>\n </div>\n </div>\n\n <!-- Nav: section panel (hidden when collapsed) -->\n @if (expanded()) {\n <div class=\"flex-1 min-w-0 flex flex-col _shk-bg-white dark:[background-color:var(--shk-surface-50)]\">\n <!-- Brand header -->\n <div class=\"flex items-center justify-between gap-2 px-3 py-4 border-b _shk-border dark:[border-color:var(--shk-surface-100)]\">\n <span class=\"nav-app text-base font-bold whitespace-nowrap overflow-hidden text-ellipsis _shk-text-surface-800 dark:[color:var(--shk-surface-800)]\">\n {{ appName() }}\n </span>\n <button\n #closeBtn\n type=\"button\"\n (click)=\"onToggleSidebar()\"\n class=\"nav-toggle w-[1.8rem] h-[1.8rem] rounded-lg border-none bg-transparent grid place-items-center cursor-pointer shrink-0 transition-colors _shk-text-surface-700 dark:[color:var(--shk-surface-700)] hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)]\"\n [title]=\"isMobile() ? closeMenuLabel() : collapseTooltip()\"\n [attr.aria-label]=\"isMobile() ? closeMenuLabel() : collapseTooltip()\"\n >\n <svg [lucideIcon]=\"isMobile() ? closeIcon : getIcon('panel-right')\" class=\"w-4 h-4\"></svg>\n </button>\n </div>\n\n <!-- Menu -->\n <nav class=\"flex-1 overflow-y-auto _shk-scrollbar px-2 py-3\">\n @if (activeSection()) {\n <div class=\"px-2 pb-3\">\n <span class=\"nav-section-label text-xs font-bold tracking-[0.08em] uppercase _shk-text-surface-400 dark:[color:var(--shk-surface-500)] block whitespace-nowrap overflow-hidden text-ellipsis\">\n {{ label(activeSection()!.label) }}\n </span>\n </div>\n }\n\n <ul class=\"space-y-1\">\n @for (item of navItems(); track item.id) {\n @if (item.separator) {\n <li class=\"my-2 border-t _shk-border dark:[border-color:var(--shk-surface-200)]\"></li>\n }\n\n @if (item.children?.length) {\n <!-- Expandable group -->\n <li>\n <button\n type=\"button\"\n (click)=\"toggleGroup(item)\"\n class=\"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200\"\n [class._shk-bg-primary]=\"isGroupActive(item)\"\n [class._shk-text-white]=\"isGroupActive(item)\"\n [class.shadow-md]=\"isGroupActive(item)\"\n [class._shk-text-surface-700]=\"!isGroupActive(item)\"\n [class.dark:[color:var(--shk-surface-600)]]=\"!isGroupActive(item)\"\n [class.hover:[background-color:var(--shk-surface-100)]]=\"!isGroupActive(item)\"\n [class.dark:hover:[background-color:var(--shk-surface-200)]]=\"!isGroupActive(item)\"\n >\n @if (item.icon) {\n <svg [lucideIcon]=\"getIcon(item.icon)\" class=\"w-5 h-5 shrink-0\"></svg>\n }\n <span class=\"flex-1 text-left whitespace-nowrap overflow-hidden\">{{ label(item.label) }}</span>\n <svg\n [lucideIcon]=\"getIcon('chevron-down')\"\n class=\"w-4 h-4 transition-transform duration-200 shrink-0\"\n [class.rotate-180]=\"isGroupExpanded(item)\"\n ></svg>\n </button>\n\n @if (isGroupExpanded(item)) {\n <ul class=\"ml-3 mt-1 space-y-1 border-l-2 _shk-border dark:[border-color:var(--shk-surface-200)] pl-2\">\n @for (child of item.children; track child.id) {\n <li>\n <button\n type=\"button\"\n (click)=\"onItemClick(child)\"\n class=\"w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-all duration-200\"\n [class._shk-bg-primary-soft]=\"isItemActive(child)\"\n [class._shk-bg-primary-soft-dark]=\"isItemActive(child)\"\n [class._shk-text-primary-700]=\"isItemActive(child)\"\n [class.dark:[color:var(--shk-primary-300)]]=\"isItemActive(child)\"\n [class._shk-text-surface-600]=\"!isItemActive(child)\"\n [class.dark:[color:var(--shk-surface-400)]]=\"!isItemActive(child)\"\n [class.hover:[background-color:var(--shk-surface-100)]]=\"!isItemActive(child)\"\n [class.dark:hover:[background-color:var(--shk-surface-200)]]=\"!isItemActive(child)\"\n [class.hover:[color:var(--shk-surface-900)]]=\"!isItemActive(child)\"\n [class.dark:hover:[color:var(--shk-surface-700)]]=\"!isItemActive(child)\"\n >\n @if (child.icon) {\n <svg [lucideIcon]=\"getIcon(child.icon)\" class=\"w-4 h-4 shrink-0\"></svg>\n }\n <span class=\"whitespace-nowrap overflow-hidden\">{{ label(child.label) }}</span>\n @if (isItemActive(child)) {\n <span class=\"w-1.5 h-1.5 rounded-full _shk-bg-primary shrink-0 ml-auto\"></span>\n }\n </button>\n </li>\n }\n </ul>\n }\n </li>\n } @else {\n <!-- Standalone item -->\n <li>\n <button\n type=\"button\"\n (click)=\"onItemClick(item)\"\n class=\"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200\"\n [class._shk-bg-primary]=\"isItemActive(item)\"\n [class._shk-text-white]=\"isItemActive(item)\"\n [class.shadow-md]=\"isItemActive(item)\"\n [class._shk-text-surface-700]=\"!isItemActive(item)\"\n [class.dark:[color:var(--shk-surface-600)]]=\"!isItemActive(item)\"\n [class.hover:[background-color:var(--shk-surface-100)]]=\"!isItemActive(item)\"\n [class.dark:hover:[background-color:var(--shk-surface-200)]]=\"!isItemActive(item)\"\n >\n @if (item.icon) {\n <svg [lucideIcon]=\"getIcon(item.icon)\" class=\"w-5 h-5 shrink-0\"></svg>\n }\n <span class=\"flex-1 text-left whitespace-nowrap overflow-hidden\">{{ label(item.label) }}</span>\n @if (item.badge !== undefined) {\n <span class=\"text-xs font-bold px-2 py-0.5 rounded-full _shk-bg-primary _shk-text-white shrink-0\">\n {{ item.badge }}\n </span>\n }\n </button>\n </li>\n }\n }\n </ul>\n </nav>\n </div>\n }\n</aside>\n", styles: [":host{display:block;height:100%}:host(.rail-is-mobile){position:relative;width:0;min-width:0;flex:0 0 0;overflow:visible}.rail-hamburger{position:absolute;top:.75rem;left:.75rem;z-index:30;display:grid;place-items:center;width:2.5rem;height:2.5rem;border-radius:.625rem;box-shadow:0 1px 3px #0000001f;cursor:pointer;transition:background-color .15s ease}.rail-hamburger:hover{background-color:var(--shk-surface-100)}.rail-hamburger:focus-visible{outline:2px solid var(--shk-primary-500);outline-offset:2px}.rail-backdrop{position:fixed;inset:0;z-index:49;background-color:var(--shk-bg-overlay, rgba(0, 0, 0, .4));opacity:0;pointer-events:none;transition:opacity .25s ease}.rail-backdrop.is-open{opacity:1;pointer-events:auto}.rail-drawer{position:fixed;top:0;left:0;bottom:0;z-index:50;height:100dvh;max-width:85vw;transform:translate(-100%);visibility:hidden;transition:transform .25s ease,visibility 0s linear .25s}.rail-drawer.is-open{transform:translate(0);visibility:visible;box-shadow:0 10px 30px #00000040;transition:transform .25s ease}@media(prefers-reduced-motion:reduce){.rail-drawer,.rail-drawer.is-open,.rail-backdrop{transition:none}}.rail-workspace{cursor:pointer;transition:opacity .2s ease,box-shadow .2s ease}.rail-workspace.is-collapsed:hover{cursor:col-resize}.rail-workspace .rail-app-icon,.rail-workspace .rail-toggle-icon{grid-area:1 / 1 / 2 / 2;transition:opacity .2s ease}.rail-toggle-icon,.rail-workspace.is-collapsed:hover .rail-app-icon{opacity:0}.rail-workspace.is-collapsed:hover .rail-toggle-icon{opacity:1}.rail-icon{background:transparent;color:var(--shk-surface-700);border:1px solid transparent;transition:transform .18s ease,color .18s ease,background-color .18s ease,box-shadow .18s ease}.rail-icon svg{stroke-width:1.8}.rail-icon:hover{background:var(--shk-surface-100);color:var(--shk-primary-600)}.dark .rail-icon:hover{background:var(--shk-surface-200);color:var(--shk-primary-400)}.rail-icon.is-active{background:var(--shk-primary-600);color:#fff;box-shadow:0 1px 2px #0003}.dark .rail-icon.is-active{background:var(--shk-primary-500);color:#fff}.rail-logout:hover{color:var(--shk-error-500)}.dark .rail-logout:hover{color:var(--shk-error-400)}\n"] }]
278
- }], ctorParameters: () => [], propDecorators: { sections: [{ type: i0.Input, args: [{ isSignal: true, alias: "sections", required: false }] }], activeUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeUrl", required: false }] }], activeSectionKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeSectionKey", required: false }] }, { type: i0.Output, args: ["activeSectionKeyChange"] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }, { type: i0.Output, args: ["collapsedChange"] }], activeLang: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeLang", required: false }] }], langs: [{ type: i0.Input, args: [{ isSignal: true, alias: "langs", required: false }] }], logo: [{ type: i0.Input, args: [{ isSignal: true, alias: "logo", required: false }] }], appName: [{ type: i0.Input, args: [{ isSignal: true, alias: "appName", required: false }] }], userRole: [{ type: i0.Input, args: [{ isSignal: true, alias: "userRole", required: false }] }], labelPipe: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPipe", required: false }] }], railWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "railWidth", required: false }] }], expandedWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedWidth", required: false }] }], workspaceTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "workspaceTooltip", required: false }] }], logoutTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoutTooltip", required: false }] }], collapseTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseTooltip", required: false }] }], expandTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandTooltip", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], mobileBreakpoint: [{ type: i0.Input, args: [{ isSignal: true, alias: "mobileBreakpoint", required: false }] }], showMobileToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMobileToggle", required: false }] }], mobileOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "mobileOpen", required: false }] }, { type: i0.Output, args: ["mobileOpenChange"] }], openMenuLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "openMenuLabel", required: false }] }], closeMenuLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeMenuLabel", required: false }] }], sectionSelected: [{ type: i0.Output, args: ["sectionSelected"] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], setLang: [{ type: i0.Output, args: ["setLang"] }], logoutRequested: [{ type: i0.Output, args: ["logoutRequested"] }], toggleSidebar: [{ type: i0.Output, args: ["toggleSidebar"] }], workspaceClick: [{ type: i0.Output, args: ["workspaceClick"] }], hamburgerBtn: [{ type: i0.ViewChild, args: ['hamburger', { isSignal: true }] }], closeBtn: [{ type: i0.ViewChild, args: ['closeBtn', { isSignal: true }] }], onResize: [{
279
- type: HostListener,
280
- args: ['window:resize']
281
- }], onEscape: [{
282
- type: HostListener,
283
- args: ['document:keydown.escape']
284
- }] } });
285
-
286
- /**
287
- * Generated bundle index. Do not edit.
288
- */
289
-
9
+ var RailSidebarComponent = class RailSidebarComponent {
10
+ constructor() {
11
+ this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
12
+ this.injector = inject(Injector);
13
+ this.uid = `shk-rail-${nextRailId++}`;
14
+ this.sections = input([], ...ngDevMode ? [{ debugName: "sections" }] : /* istanbul ignore next */ []);
15
+ this.activeUrl = input("", ...ngDevMode ? [{ debugName: "activeUrl" }] : /* istanbul ignore next */ []);
16
+ this.activeSectionKey = model("", ...ngDevMode ? [{ debugName: "activeSectionKey" }] : /* istanbul ignore next */ []);
17
+ this.collapsed = model(false, ...ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []);
18
+ this.activeLang = input("es", ...ngDevMode ? [{ debugName: "activeLang" }] : /* istanbul ignore next */ []);
19
+ this.langs = input(["es", "en"], ...ngDevMode ? [{ debugName: "langs" }] : /* istanbul ignore next */ []);
20
+ this.logo = input("", ...ngDevMode ? [{ debugName: "logo" }] : /* istanbul ignore next */ []);
21
+ this.appName = input("", ...ngDevMode ? [{ debugName: "appName" }] : /* istanbul ignore next */ []);
22
+ this.userRole = input("", ...ngDevMode ? [{ debugName: "userRole" }] : /* istanbul ignore next */ []);
23
+ this.labelPipe = input((label) => label, ...ngDevMode ? [{ debugName: "labelPipe" }] : /* istanbul ignore next */ []);
24
+ this.railWidth = input("4.5rem", ...ngDevMode ? [{ debugName: "railWidth" }] : /* istanbul ignore next */ []);
25
+ this.expandedWidth = input("16.5rem", ...ngDevMode ? [{ debugName: "expandedWidth" }] : /* istanbul ignore next */ []);
26
+ this.workspaceTooltip = input("Inicio", ...ngDevMode ? [{ debugName: "workspaceTooltip" }] : /* istanbul ignore next */ []);
27
+ this.logoutTooltip = input("Cerrar sesión", ...ngDevMode ? [{ debugName: "logoutTooltip" }] : /* istanbul ignore next */ []);
28
+ this.collapseTooltip = input("Colapsar", ...ngDevMode ? [{ debugName: "collapseTooltip" }] : /* istanbul ignore next */ []);
29
+ this.expandTooltip = input("Expandir", ...ngDevMode ? [{ debugName: "expandTooltip" }] : /* istanbul ignore next */ []);
30
+ this.responsive = input(true, ...ngDevMode ? [{ debugName: "responsive" }] : /* istanbul ignore next */ []);
31
+ this.mobileBreakpoint = input(1024, ...ngDevMode ? [{ debugName: "mobileBreakpoint" }] : /* istanbul ignore next */ []);
32
+ this.showMobileToggle = input(true, ...ngDevMode ? [{ debugName: "showMobileToggle" }] : /* istanbul ignore next */ []);
33
+ this.mobileOpen = model(false, ...ngDevMode ? [{ debugName: "mobileOpen" }] : /* istanbul ignore next */ []);
34
+ this.openMenuLabel = input("Abrir menú", ...ngDevMode ? [{ debugName: "openMenuLabel" }] : /* istanbul ignore next */ []);
35
+ this.closeMenuLabel = input("Cerrar menú", ...ngDevMode ? [{ debugName: "closeMenuLabel" }] : /* istanbul ignore next */ []);
36
+ this.sectionSelected = output();
37
+ this.itemClick = output();
38
+ this.setLang = output();
39
+ this.logoutRequested = output();
40
+ this.toggleSidebar = output();
41
+ this.workspaceClick = output();
42
+ this.getIcon = (name) => getIcon(name, LucideMenu);
43
+ this.closeIcon = LucideX;
44
+ this.viewportWidth = signal(this.isBrowser ? window.innerWidth : Number.MAX_SAFE_INTEGER, ...ngDevMode ? [{ debugName: "viewportWidth" }] : /* istanbul ignore next */ []);
45
+ this.isMobile = computed(() => this.responsive() && this.viewportWidth() < this.mobileBreakpoint(), ...ngDevMode ? [{ debugName: "isMobile" }] : /* istanbul ignore next */ []);
46
+ this.expanded = computed(() => this.isMobile() || !this.collapsed(), ...ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []);
47
+ this.hamburgerBtn = viewChild("hamburger", ...ngDevMode ? [{ debugName: "hamburgerBtn" }] : /* istanbul ignore next */ []);
48
+ this.closeBtn = viewChild("closeBtn", ...ngDevMode ? [{ debugName: "closeBtn" }] : /* istanbul ignore next */ []);
49
+ this.expandedGroups = signal(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "expandedGroups" }] : /* istanbul ignore next */ []);
50
+ this.width = computed(() => this.expanded() ? this.expandedWidth() : this.railWidth(), ...ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []);
51
+ this.activeSection = computed(() => this.sections().find((s) => s.key === this.activeSectionKey()) ?? null, ...ngDevMode ? [{ debugName: "activeSection" }] : /* istanbul ignore next */ []);
52
+ this.navItems = computed(() => {
53
+ const role = this.userRole();
54
+ return (this.activeSection()?.items ?? []).filter((item) => {
55
+ if (!item.roles || item.roles.length === 0) return true;
56
+ return role ? item.roles.includes(role) : false;
57
+ });
58
+ }, ...ngDevMode ? [{ debugName: "navItems" }] : /* istanbul ignore next */ []);
59
+ effect(() => {
60
+ if (!this.isMobile() && untracked(this.mobileOpen)) this.mobileOpen.set(false);
61
+ });
62
+ effect((onCleanup) => {
63
+ if (!this.isBrowser || !(this.isMobile() && this.mobileOpen())) return;
64
+ const body = document.body;
65
+ const previous = body.style.overflow;
66
+ body.style.overflow = "hidden";
67
+ onCleanup(() => body.style.overflow = previous);
68
+ });
69
+ effect(() => {
70
+ const url = this.activeUrl();
71
+ if (!url) return;
72
+ const section = this.sections().find((s) => {
73
+ if (s.matchPrefixes?.length) return s.matchPrefixes.some((prefix) => url.startsWith(prefix));
74
+ return s.routerLink ? url.startsWith(s.routerLink) : false;
75
+ });
76
+ if (section) this.activeSectionKey.set(section.key);
77
+ });
78
+ }
79
+ onResize() {
80
+ if (this.isBrowser) this.viewportWidth.set(window.innerWidth);
81
+ }
82
+ onEscape() {
83
+ if (this.isMobile() && this.mobileOpen()) this.closeMobile();
84
+ }
85
+ openMobile() {
86
+ this.mobileOpen.set(true);
87
+ afterNextRender(() => this.closeBtn()?.nativeElement.focus(), { injector: this.injector });
88
+ }
89
+ closeMobile() {
90
+ if (!this.mobileOpen()) return;
91
+ this.mobileOpen.set(false);
92
+ afterNextRender(() => this.hamburgerBtn()?.nativeElement.focus(), { injector: this.injector });
93
+ }
94
+ label(label) {
95
+ return this.labelPipe()(label);
96
+ }
97
+ isSectionActive(section) {
98
+ return section.key === this.activeSectionKey();
99
+ }
100
+ isItemActive(item) {
101
+ if (!item.routerLink) return false;
102
+ return this.bestMatchItem() === item;
103
+ }
104
+ isGroupActive(item) {
105
+ return item.children?.some((c) => c.routerLink && this.matchesUrl(c.routerLink, this.activeUrl())) ?? false;
106
+ }
107
+ matchesUrl(routerLink, url) {
108
+ return url === routerLink || url.startsWith(routerLink + "/");
109
+ }
110
+ bestMatchItem() {
111
+ const url = this.activeUrl();
112
+ let best = null;
113
+ for (const item of this.navItems()) {
114
+ if (item.routerLink && this.matchesUrl(item.routerLink, url)) {
115
+ if (!best || item.routerLink.length > best.routerLink.length) best = item;
116
+ }
117
+ for (const child of item.children ?? []) {
118
+ if (!child.routerLink || !this.matchesUrl(child.routerLink, url)) continue;
119
+ if (!best || child.routerLink.length > best.routerLink.length) best = child;
120
+ }
121
+ }
122
+ return best;
123
+ }
124
+ isGroupExpanded(item) {
125
+ return this.expandedGroups().has(item.id);
126
+ }
127
+ toggleGroup(item) {
128
+ this.expandedGroups.update((set) => {
129
+ const next = new Set(set);
130
+ if (next.has(item.id)) next.delete(item.id);
131
+ else next.add(item.id);
132
+ return next;
133
+ });
134
+ }
135
+ onSectionClick(section) {
136
+ this.activeSectionKey.set(section.key);
137
+ this.sectionSelected.emit({
138
+ key: section.key,
139
+ routerLink: section.routerLink
140
+ });
141
+ if (!this.isMobile() && this.collapsed()) {
142
+ this.collapsed.set(false);
143
+ this.toggleSidebar.emit(false);
144
+ }
145
+ }
146
+ onItemClick(item) {
147
+ if (item.disabled) return;
148
+ this.itemClick.emit(item);
149
+ if (this.isMobile()) this.closeMobile();
150
+ }
151
+ onWorkspace() {
152
+ this.workspaceClick.emit();
153
+ if (!this.isMobile() && this.collapsed()) {
154
+ this.collapsed.set(false);
155
+ this.toggleSidebar.emit(false);
156
+ }
157
+ }
158
+ onLogout() {
159
+ this.logoutRequested.emit();
160
+ if (this.isMobile()) this.closeMobile();
161
+ }
162
+ onToggleLang() {
163
+ const langs = this.langs();
164
+ if (langs.length === 0) return;
165
+ const next = langs[(langs.indexOf(this.activeLang()) + 1) % langs.length] ?? langs[0];
166
+ this.setLang.emit(next);
167
+ }
168
+ onToggleSidebar() {
169
+ if (this.isMobile()) {
170
+ this.closeMobile();
171
+ return;
172
+ }
173
+ this.collapsed.update((v) => !v);
174
+ this.toggleSidebar.emit(this.collapsed());
175
+ }
176
+ static {
177
+ this.ɵfac = i0.ɵɵngDeclareFactory({
178
+ minVersion: "12.0.0",
179
+ version: "22.3.2",
180
+ ngImport: i0,
181
+ type: RailSidebarComponent,
182
+ deps: [],
183
+ target: i0.ɵɵFactoryTarget.Component
184
+ });
185
+ }
186
+ static {
187
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
188
+ minVersion: "17.0.0",
189
+ version: "22.3.2",
190
+ type: RailSidebarComponent,
191
+ isStandalone: true,
192
+ selector: "shk-rail-sidebar",
193
+ inputs: {
194
+ sections: {
195
+ classPropertyName: "sections",
196
+ publicName: "sections",
197
+ isSignal: true,
198
+ isRequired: false,
199
+ transformFunction: null
200
+ },
201
+ activeUrl: {
202
+ classPropertyName: "activeUrl",
203
+ publicName: "activeUrl",
204
+ isSignal: true,
205
+ isRequired: false,
206
+ transformFunction: null
207
+ },
208
+ activeSectionKey: {
209
+ classPropertyName: "activeSectionKey",
210
+ publicName: "activeSectionKey",
211
+ isSignal: true,
212
+ isRequired: false,
213
+ transformFunction: null
214
+ },
215
+ collapsed: {
216
+ classPropertyName: "collapsed",
217
+ publicName: "collapsed",
218
+ isSignal: true,
219
+ isRequired: false,
220
+ transformFunction: null
221
+ },
222
+ activeLang: {
223
+ classPropertyName: "activeLang",
224
+ publicName: "activeLang",
225
+ isSignal: true,
226
+ isRequired: false,
227
+ transformFunction: null
228
+ },
229
+ langs: {
230
+ classPropertyName: "langs",
231
+ publicName: "langs",
232
+ isSignal: true,
233
+ isRequired: false,
234
+ transformFunction: null
235
+ },
236
+ logo: {
237
+ classPropertyName: "logo",
238
+ publicName: "logo",
239
+ isSignal: true,
240
+ isRequired: false,
241
+ transformFunction: null
242
+ },
243
+ appName: {
244
+ classPropertyName: "appName",
245
+ publicName: "appName",
246
+ isSignal: true,
247
+ isRequired: false,
248
+ transformFunction: null
249
+ },
250
+ userRole: {
251
+ classPropertyName: "userRole",
252
+ publicName: "userRole",
253
+ isSignal: true,
254
+ isRequired: false,
255
+ transformFunction: null
256
+ },
257
+ labelPipe: {
258
+ classPropertyName: "labelPipe",
259
+ publicName: "labelPipe",
260
+ isSignal: true,
261
+ isRequired: false,
262
+ transformFunction: null
263
+ },
264
+ railWidth: {
265
+ classPropertyName: "railWidth",
266
+ publicName: "railWidth",
267
+ isSignal: true,
268
+ isRequired: false,
269
+ transformFunction: null
270
+ },
271
+ expandedWidth: {
272
+ classPropertyName: "expandedWidth",
273
+ publicName: "expandedWidth",
274
+ isSignal: true,
275
+ isRequired: false,
276
+ transformFunction: null
277
+ },
278
+ workspaceTooltip: {
279
+ classPropertyName: "workspaceTooltip",
280
+ publicName: "workspaceTooltip",
281
+ isSignal: true,
282
+ isRequired: false,
283
+ transformFunction: null
284
+ },
285
+ logoutTooltip: {
286
+ classPropertyName: "logoutTooltip",
287
+ publicName: "logoutTooltip",
288
+ isSignal: true,
289
+ isRequired: false,
290
+ transformFunction: null
291
+ },
292
+ collapseTooltip: {
293
+ classPropertyName: "collapseTooltip",
294
+ publicName: "collapseTooltip",
295
+ isSignal: true,
296
+ isRequired: false,
297
+ transformFunction: null
298
+ },
299
+ expandTooltip: {
300
+ classPropertyName: "expandTooltip",
301
+ publicName: "expandTooltip",
302
+ isSignal: true,
303
+ isRequired: false,
304
+ transformFunction: null
305
+ },
306
+ responsive: {
307
+ classPropertyName: "responsive",
308
+ publicName: "responsive",
309
+ isSignal: true,
310
+ isRequired: false,
311
+ transformFunction: null
312
+ },
313
+ mobileBreakpoint: {
314
+ classPropertyName: "mobileBreakpoint",
315
+ publicName: "mobileBreakpoint",
316
+ isSignal: true,
317
+ isRequired: false,
318
+ transformFunction: null
319
+ },
320
+ showMobileToggle: {
321
+ classPropertyName: "showMobileToggle",
322
+ publicName: "showMobileToggle",
323
+ isSignal: true,
324
+ isRequired: false,
325
+ transformFunction: null
326
+ },
327
+ mobileOpen: {
328
+ classPropertyName: "mobileOpen",
329
+ publicName: "mobileOpen",
330
+ isSignal: true,
331
+ isRequired: false,
332
+ transformFunction: null
333
+ },
334
+ openMenuLabel: {
335
+ classPropertyName: "openMenuLabel",
336
+ publicName: "openMenuLabel",
337
+ isSignal: true,
338
+ isRequired: false,
339
+ transformFunction: null
340
+ },
341
+ closeMenuLabel: {
342
+ classPropertyName: "closeMenuLabel",
343
+ publicName: "closeMenuLabel",
344
+ isSignal: true,
345
+ isRequired: false,
346
+ transformFunction: null
347
+ }
348
+ },
349
+ outputs: {
350
+ activeSectionKey: "activeSectionKeyChange",
351
+ collapsed: "collapsedChange",
352
+ mobileOpen: "mobileOpenChange",
353
+ sectionSelected: "sectionSelected",
354
+ itemClick: "itemClick",
355
+ setLang: "setLang",
356
+ logoutRequested: "logoutRequested",
357
+ toggleSidebar: "toggleSidebar",
358
+ workspaceClick: "workspaceClick"
359
+ },
360
+ host: {
361
+ listeners: {
362
+ "window:resize": "onResize()",
363
+ "document:keydown.escape": "onEscape()"
364
+ },
365
+ properties: { "class.rail-is-mobile": "isMobile()" }
366
+ },
367
+ viewQueries: [{
368
+ propertyName: "hamburgerBtn",
369
+ first: true,
370
+ predicate: ["hamburger"],
371
+ descendants: true,
372
+ isSignal: true
373
+ }, {
374
+ propertyName: "closeBtn",
375
+ first: true,
376
+ predicate: ["closeBtn"],
377
+ descendants: true,
378
+ isSignal: true
379
+ }],
380
+ ngImport: i0,
381
+ template: "@if (isMobile()) {\n <!-- Mobile: hamburger button + backdrop (the aside becomes a drawer) -->\n @if (showMobileToggle() && !mobileOpen()) {\n <button\n #hamburger\n type=\"button\"\n class=\"rail-hamburger _shk-bg-panel-raised border _shk-border _shk-text-surface-700\"\n [attr.aria-label]=\"openMenuLabel()\"\n aria-expanded=\"false\"\n [attr.aria-controls]=\"uid\"\n (click)=\"openMobile()\"\n >\n <svg [shkIcon]=\"getIcon('menu')\" class=\"w-5 h-5\"></svg>\n </button>\n }\n <div class=\"rail-backdrop\" [class.is-open]=\"mobileOpen()\" (click)=\"closeMobile()\"></div>\n}\n\n<aside\n [id]=\"uid\"\n class=\"h-full flex overflow-hidden shrink-0 _shk-bg-panel border-r _shk-border\"\n [class.rail-drawer]=\"isMobile()\"\n [class.is-open]=\"isMobile() && mobileOpen()\"\n [attr.role]=\"isMobile() ? 'dialog' : null\"\n [attr.aria-modal]=\"isMobile() && mobileOpen() ? 'true' : null\"\n [attr.aria-label]=\"isMobile() ? appName() || openMenuLabel() : null\"\n [attr.inert]=\"isMobile() && !mobileOpen() ? '' : null\"\n [style.width]=\"width()\"\n>\n <!-- Rail: vertical icon column -->\n <div\n class=\"h-full flex flex-col items-center shrink-0 px-[0.3rem] py-2 gap-1 border-r _shk-border\"\n [style.width]=\"railWidth()\"\n >\n <!-- Workspace / logo -->\n <div class=\"flex items-center justify-center w-full\">\n <button\n type=\"button\"\n (click)=\"onWorkspace()\"\n [class.is-collapsed]=\"!expanded()\"\n class=\"rail-workspace w-[3.2rem] h-[3.2rem] rounded-xl _shk-bg-surface-100 border-none grid place-items-center p-0 relative transition-all\"\n [title]=\"workspaceTooltip()\"\n >\n @if (logo()) {\n <img [src]=\"logo()\" alt=\"Logo\" class=\"rail-app-icon w-8 h-8 object-contain\" />\n } @else {\n <svg [shkIcon]=\"getIcon('menu')\" class=\"rail-app-icon w-6 h-6 _shk-text-surface-700\"></svg>\n }\n @if (!expanded()) {\n <svg [shkIcon]=\"getIcon('panel-right')\" class=\"rail-toggle-icon w-5 h-5 _shk-text-surface-700\"></svg>\n }\n </button>\n </div>\n\n <!-- Section actions -->\n <div class=\"rail-actions flex-1 flex flex-col items-center gap-1 pt-1\">\n @for (section of sections(); track section.key) {\n <shk-tooltip [text]=\"label(section.label)\" position=\"right\" mode=\"fixed\">\n <button\n type=\"button\"\n (click)=\"onSectionClick(section)\"\n class=\"rail-icon w-[3.4rem] h-[3.4rem] rounded-[0.85rem] grid place-items-center transition-all cursor-pointer\"\n [class.is-active]=\"isSectionActive(section)\"\n [attr.aria-label]=\"label(section.label)\"\n >\n <svg [shkIcon]=\"getIcon(section.icon)\" class=\"w-5 h-5\"></svg>\n </button>\n </shk-tooltip>\n }\n </div>\n\n <!-- Bottom: language + logout -->\n <div class=\"rail-bottom mt-auto flex flex-col items-center gap-1\">\n <button\n type=\"button\"\n (click)=\"onToggleLang()\"\n class=\"rail-icon w-[3.4rem] h-[3.4rem] rounded-[0.85rem] grid place-items-center transition-all cursor-pointer\"\n [title]=\"activeLang()\"\n >\n <div class=\"flex flex-col items-center gap-[0.15rem]\">\n <svg [shkIcon]=\"getIcon('languages')\" class=\"w-5 h-5\"></svg>\n <span class=\"rail-lang-code text-[0.5rem] font-bold tracking-[0.05em] leading-none\">{{ activeLang() | uppercase }}</span>\n </div>\n </button>\n\n <button\n type=\"button\"\n (click)=\"onLogout()\"\n class=\"rail-icon rail-logout w-[3.4rem] h-[3.4rem] rounded-[0.85rem] grid place-items-center transition-all cursor-pointer\"\n [title]=\"logoutTooltip()\"\n >\n <svg [shkIcon]=\"getIcon('log-out')\" class=\"w-5 h-5\"></svg>\n </button>\n </div>\n </div>\n\n <!-- Nav: section panel (hidden when collapsed) -->\n @if (expanded()) {\n <div class=\"flex-1 min-w-0 flex flex-col _shk-bg-panel\">\n <!-- Brand header -->\n <div class=\"flex items-center justify-between gap-2 px-3 py-4 border-b _shk-border\">\n <span class=\"nav-app text-base font-bold whitespace-nowrap overflow-hidden text-ellipsis _shk-text-surface-800\">\n {{ appName() }}\n </span>\n <button\n #closeBtn\n type=\"button\"\n (click)=\"onToggleSidebar()\"\n class=\"nav-toggle w-[1.8rem] h-[1.8rem] rounded-lg border-none bg-transparent grid place-items-center cursor-pointer shrink-0 transition-colors _shk-text-surface-700 hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)]\"\n [title]=\"isMobile() ? closeMenuLabel() : collapseTooltip()\"\n [attr.aria-label]=\"isMobile() ? closeMenuLabel() : collapseTooltip()\"\n >\n <svg [shkIcon]=\"isMobile() ? closeIcon : getIcon('panel-right')\" class=\"w-4 h-4\"></svg>\n </button>\n </div>\n\n <!-- Menu -->\n <nav class=\"flex-1 overflow-y-auto _shk-scrollbar px-2 py-3\">\n @if (activeSection()) {\n <div class=\"px-2 pb-3\">\n <span class=\"nav-section-label text-xs font-bold tracking-[0.08em] uppercase _shk-text-surface-400 block whitespace-nowrap overflow-hidden text-ellipsis\">\n {{ label(activeSection()!.label) }}\n </span>\n </div>\n }\n\n <ul class=\"space-y-1\">\n @for (item of navItems(); track item.id) {\n @if (item.separator) {\n <li class=\"my-2 border-t _shk-border\"></li>\n }\n\n @if (item.children?.length) {\n <!-- Expandable group -->\n <li>\n <button\n type=\"button\"\n (click)=\"toggleGroup(item)\"\n class=\"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200\"\n [class._shk-bg-primary]=\"isGroupActive(item)\"\n [class._shk-text-white]=\"isGroupActive(item)\"\n [class.shadow-md]=\"isGroupActive(item)\"\n [class._shk-text-surface-700]=\"!isGroupActive(item)\"\n [class.hover:[background-color:var(--shk-surface-100)]]=\"!isGroupActive(item)\"\n [class.dark:hover:[background-color:var(--shk-surface-200)]]=\"!isGroupActive(item)\"\n >\n @if (item.icon) {\n <svg [shkIcon]=\"getIcon(item.icon)\" class=\"w-5 h-5 shrink-0\"></svg>\n }\n <span class=\"flex-1 text-left whitespace-nowrap overflow-hidden\">{{ label(item.label) }}</span>\n <svg\n [shkIcon]=\"getIcon('chevron-down')\"\n class=\"w-4 h-4 transition-transform duration-200 shrink-0\"\n [class.rotate-180]=\"isGroupExpanded(item)\"\n ></svg>\n </button>\n\n @if (isGroupExpanded(item)) {\n <ul class=\"ml-3 mt-1 space-y-1 border-l-2 _shk-border pl-2\">\n @for (child of item.children; track child.id) {\n <li>\n <button\n type=\"button\"\n (click)=\"onItemClick(child)\"\n class=\"w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-all duration-200\"\n [class._shk-bg-primary-soft]=\"isItemActive(child)\"\n [class._shk-bg-primary-soft-dark]=\"isItemActive(child)\"\n [class._shk-text-primary-700]=\"isItemActive(child)\"\n [class.dark:[color:var(--shk-primary-300)]]=\"isItemActive(child)\"\n [class._shk-text-surface-600]=\"!isItemActive(child)\"\n [class.hover:[background-color:var(--shk-surface-100)]]=\"!isItemActive(child)\"\n [class.dark:hover:[background-color:var(--shk-surface-200)]]=\"!isItemActive(child)\"\n [class.hover:[color:var(--shk-surface-900)]]=\"!isItemActive(child)\"\n [class.dark:hover:[color:var(--shk-surface-700)]]=\"!isItemActive(child)\"\n >\n @if (child.icon) {\n <svg [shkIcon]=\"getIcon(child.icon)\" class=\"w-4 h-4 shrink-0\"></svg>\n }\n <span class=\"whitespace-nowrap overflow-hidden\">{{ label(child.label) }}</span>\n @if (isItemActive(child)) {\n <span class=\"w-1.5 h-1.5 rounded-full _shk-bg-primary shrink-0 ml-auto\"></span>\n }\n </button>\n </li>\n }\n </ul>\n }\n </li>\n } @else {\n <!-- Standalone item -->\n <li>\n <button\n type=\"button\"\n (click)=\"onItemClick(item)\"\n class=\"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200\"\n [class._shk-bg-primary]=\"isItemActive(item)\"\n [class._shk-text-white]=\"isItemActive(item)\"\n [class.shadow-md]=\"isItemActive(item)\"\n [class._shk-text-surface-700]=\"!isItemActive(item)\"\n [class.hover:[background-color:var(--shk-surface-100)]]=\"!isItemActive(item)\"\n [class.dark:hover:[background-color:var(--shk-surface-200)]]=\"!isItemActive(item)\"\n >\n @if (item.icon) {\n <svg [shkIcon]=\"getIcon(item.icon)\" class=\"w-5 h-5 shrink-0\"></svg>\n }\n <span class=\"flex-1 text-left whitespace-nowrap overflow-hidden\">{{ label(item.label) }}</span>\n @if (item.badge !== undefined) {\n <span class=\"text-xs font-bold px-2 py-0.5 rounded-full _shk-bg-primary _shk-text-white shrink-0\">\n {{ item.badge }}\n </span>\n }\n </button>\n </li>\n }\n }\n </ul>\n </nav>\n </div>\n }\n</aside>\n",
382
+ styles: [":host{display:block;height:100%}:host(.rail-is-mobile){position:relative;width:0;min-width:0;flex:0 0 0;overflow:visible}.rail-hamburger{position:absolute;top:.75rem;left:.75rem;z-index:var(--shk-rail-hamburger-z, 1);display:grid;place-items:center;width:2.5rem;height:2.5rem;border-radius:.625rem;box-shadow:0 1px 3px #0000001f;cursor:pointer;transition:background-color .15s ease}.rail-hamburger:hover{background-color:var(--shk-surface-100)}.rail-hamburger:focus-visible{outline:2px solid var(--shk-primary-500);outline-offset:2px}.rail-backdrop{position:fixed;inset:0;z-index:49;background-color:var(--shk-bg-overlay, rgba(0, 0, 0, .4));opacity:0;pointer-events:none;transition:opacity .25s ease}.rail-backdrop.is-open{opacity:1;pointer-events:auto}.rail-drawer{position:fixed;top:0;left:0;bottom:0;z-index:50;height:100dvh;max-width:85vw;transform:translate(-100%);visibility:hidden;transition:transform .25s ease,visibility 0s linear .25s}.rail-drawer.is-open{transform:translate(0);visibility:visible;box-shadow:0 10px 30px #00000040;transition:transform .25s ease}@media(prefers-reduced-motion:reduce){.rail-drawer,.rail-drawer.is-open,.rail-backdrop{transition:none}}.rail-workspace{cursor:pointer;transition:opacity .2s ease,box-shadow .2s ease}.rail-workspace.is-collapsed:hover{cursor:col-resize}.rail-workspace .rail-app-icon,.rail-workspace .rail-toggle-icon{grid-area:1 / 1 / 2 / 2;transition:opacity .2s ease}.rail-toggle-icon,.rail-workspace.is-collapsed:hover .rail-app-icon{opacity:0}.rail-workspace.is-collapsed:hover .rail-toggle-icon{opacity:1}.rail-icon{background:transparent;color:var(--shk-surface-700);border:1px solid transparent;transition:transform .18s ease,color .18s ease,background-color .18s ease,box-shadow .18s ease}.rail-icon svg{stroke-width:1.8}.rail-icon:hover{background:var(--shk-surface-100);color:var(--shk-primary-600)}.dark .rail-icon:hover{background:var(--shk-surface-200);color:var(--shk-primary-400)}.rail-icon.is-active{background:var(--shk-primary-600);color:#fff;box-shadow:0 1px 2px #0003}.dark .rail-icon.is-active{background:var(--shk-primary-500);color:#fff}.rail-logout:hover{color:var(--shk-error-500)}.dark .rail-logout:hover{color:var(--shk-error-400)}\n"],
383
+ dependencies: [
384
+ {
385
+ kind: "ngmodule",
386
+ type: CommonModule
387
+ },
388
+ {
389
+ kind: "directive",
390
+ type: ShkIconDirective,
391
+ selector: "svg[shkIcon]",
392
+ inputs: [
393
+ "shkIcon",
394
+ "size",
395
+ "strokeWidth",
396
+ "color"
397
+ ]
398
+ },
399
+ {
400
+ kind: "component",
401
+ type: TooltipComponent,
402
+ selector: "shk-tooltip",
403
+ inputs: [
404
+ "text",
405
+ "position",
406
+ "mode",
407
+ "offset"
408
+ ]
409
+ },
410
+ {
411
+ kind: "pipe",
412
+ type: i1.UpperCasePipe,
413
+ name: "uppercase"
414
+ }
415
+ ],
416
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
417
+ });
418
+ }
419
+ };
420
+ i0.ɵɵngDeclareClassMetadata({
421
+ minVersion: "12.0.0",
422
+ version: "22.3.2",
423
+ ngImport: i0,
424
+ type: RailSidebarComponent,
425
+ decorators: [{
426
+ type: Component,
427
+ args: [{
428
+ selector: "shk-rail-sidebar",
429
+ changeDetection: ChangeDetectionStrategy.OnPush,
430
+ imports: [
431
+ CommonModule,
432
+ ShkIconDirective,
433
+ TooltipComponent
434
+ ],
435
+ host: { "[class.rail-is-mobile]": "isMobile()" },
436
+ template: "@if (isMobile()) {\n <!-- Mobile: hamburger button + backdrop (the aside becomes a drawer) -->\n @if (showMobileToggle() && !mobileOpen()) {\n <button\n #hamburger\n type=\"button\"\n class=\"rail-hamburger _shk-bg-panel-raised border _shk-border _shk-text-surface-700\"\n [attr.aria-label]=\"openMenuLabel()\"\n aria-expanded=\"false\"\n [attr.aria-controls]=\"uid\"\n (click)=\"openMobile()\"\n >\n <svg [shkIcon]=\"getIcon('menu')\" class=\"w-5 h-5\"></svg>\n </button>\n }\n <div class=\"rail-backdrop\" [class.is-open]=\"mobileOpen()\" (click)=\"closeMobile()\"></div>\n}\n\n<aside\n [id]=\"uid\"\n class=\"h-full flex overflow-hidden shrink-0 _shk-bg-panel border-r _shk-border\"\n [class.rail-drawer]=\"isMobile()\"\n [class.is-open]=\"isMobile() && mobileOpen()\"\n [attr.role]=\"isMobile() ? 'dialog' : null\"\n [attr.aria-modal]=\"isMobile() && mobileOpen() ? 'true' : null\"\n [attr.aria-label]=\"isMobile() ? appName() || openMenuLabel() : null\"\n [attr.inert]=\"isMobile() && !mobileOpen() ? '' : null\"\n [style.width]=\"width()\"\n>\n <!-- Rail: vertical icon column -->\n <div\n class=\"h-full flex flex-col items-center shrink-0 px-[0.3rem] py-2 gap-1 border-r _shk-border\"\n [style.width]=\"railWidth()\"\n >\n <!-- Workspace / logo -->\n <div class=\"flex items-center justify-center w-full\">\n <button\n type=\"button\"\n (click)=\"onWorkspace()\"\n [class.is-collapsed]=\"!expanded()\"\n class=\"rail-workspace w-[3.2rem] h-[3.2rem] rounded-xl _shk-bg-surface-100 border-none grid place-items-center p-0 relative transition-all\"\n [title]=\"workspaceTooltip()\"\n >\n @if (logo()) {\n <img [src]=\"logo()\" alt=\"Logo\" class=\"rail-app-icon w-8 h-8 object-contain\" />\n } @else {\n <svg [shkIcon]=\"getIcon('menu')\" class=\"rail-app-icon w-6 h-6 _shk-text-surface-700\"></svg>\n }\n @if (!expanded()) {\n <svg [shkIcon]=\"getIcon('panel-right')\" class=\"rail-toggle-icon w-5 h-5 _shk-text-surface-700\"></svg>\n }\n </button>\n </div>\n\n <!-- Section actions -->\n <div class=\"rail-actions flex-1 flex flex-col items-center gap-1 pt-1\">\n @for (section of sections(); track section.key) {\n <shk-tooltip [text]=\"label(section.label)\" position=\"right\" mode=\"fixed\">\n <button\n type=\"button\"\n (click)=\"onSectionClick(section)\"\n class=\"rail-icon w-[3.4rem] h-[3.4rem] rounded-[0.85rem] grid place-items-center transition-all cursor-pointer\"\n [class.is-active]=\"isSectionActive(section)\"\n [attr.aria-label]=\"label(section.label)\"\n >\n <svg [shkIcon]=\"getIcon(section.icon)\" class=\"w-5 h-5\"></svg>\n </button>\n </shk-tooltip>\n }\n </div>\n\n <!-- Bottom: language + logout -->\n <div class=\"rail-bottom mt-auto flex flex-col items-center gap-1\">\n <button\n type=\"button\"\n (click)=\"onToggleLang()\"\n class=\"rail-icon w-[3.4rem] h-[3.4rem] rounded-[0.85rem] grid place-items-center transition-all cursor-pointer\"\n [title]=\"activeLang()\"\n >\n <div class=\"flex flex-col items-center gap-[0.15rem]\">\n <svg [shkIcon]=\"getIcon('languages')\" class=\"w-5 h-5\"></svg>\n <span class=\"rail-lang-code text-[0.5rem] font-bold tracking-[0.05em] leading-none\">{{ activeLang() | uppercase }}</span>\n </div>\n </button>\n\n <button\n type=\"button\"\n (click)=\"onLogout()\"\n class=\"rail-icon rail-logout w-[3.4rem] h-[3.4rem] rounded-[0.85rem] grid place-items-center transition-all cursor-pointer\"\n [title]=\"logoutTooltip()\"\n >\n <svg [shkIcon]=\"getIcon('log-out')\" class=\"w-5 h-5\"></svg>\n </button>\n </div>\n </div>\n\n <!-- Nav: section panel (hidden when collapsed) -->\n @if (expanded()) {\n <div class=\"flex-1 min-w-0 flex flex-col _shk-bg-panel\">\n <!-- Brand header -->\n <div class=\"flex items-center justify-between gap-2 px-3 py-4 border-b _shk-border\">\n <span class=\"nav-app text-base font-bold whitespace-nowrap overflow-hidden text-ellipsis _shk-text-surface-800\">\n {{ appName() }}\n </span>\n <button\n #closeBtn\n type=\"button\"\n (click)=\"onToggleSidebar()\"\n class=\"nav-toggle w-[1.8rem] h-[1.8rem] rounded-lg border-none bg-transparent grid place-items-center cursor-pointer shrink-0 transition-colors _shk-text-surface-700 hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)]\"\n [title]=\"isMobile() ? closeMenuLabel() : collapseTooltip()\"\n [attr.aria-label]=\"isMobile() ? closeMenuLabel() : collapseTooltip()\"\n >\n <svg [shkIcon]=\"isMobile() ? closeIcon : getIcon('panel-right')\" class=\"w-4 h-4\"></svg>\n </button>\n </div>\n\n <!-- Menu -->\n <nav class=\"flex-1 overflow-y-auto _shk-scrollbar px-2 py-3\">\n @if (activeSection()) {\n <div class=\"px-2 pb-3\">\n <span class=\"nav-section-label text-xs font-bold tracking-[0.08em] uppercase _shk-text-surface-400 block whitespace-nowrap overflow-hidden text-ellipsis\">\n {{ label(activeSection()!.label) }}\n </span>\n </div>\n }\n\n <ul class=\"space-y-1\">\n @for (item of navItems(); track item.id) {\n @if (item.separator) {\n <li class=\"my-2 border-t _shk-border\"></li>\n }\n\n @if (item.children?.length) {\n <!-- Expandable group -->\n <li>\n <button\n type=\"button\"\n (click)=\"toggleGroup(item)\"\n class=\"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200\"\n [class._shk-bg-primary]=\"isGroupActive(item)\"\n [class._shk-text-white]=\"isGroupActive(item)\"\n [class.shadow-md]=\"isGroupActive(item)\"\n [class._shk-text-surface-700]=\"!isGroupActive(item)\"\n [class.hover:[background-color:var(--shk-surface-100)]]=\"!isGroupActive(item)\"\n [class.dark:hover:[background-color:var(--shk-surface-200)]]=\"!isGroupActive(item)\"\n >\n @if (item.icon) {\n <svg [shkIcon]=\"getIcon(item.icon)\" class=\"w-5 h-5 shrink-0\"></svg>\n }\n <span class=\"flex-1 text-left whitespace-nowrap overflow-hidden\">{{ label(item.label) }}</span>\n <svg\n [shkIcon]=\"getIcon('chevron-down')\"\n class=\"w-4 h-4 transition-transform duration-200 shrink-0\"\n [class.rotate-180]=\"isGroupExpanded(item)\"\n ></svg>\n </button>\n\n @if (isGroupExpanded(item)) {\n <ul class=\"ml-3 mt-1 space-y-1 border-l-2 _shk-border pl-2\">\n @for (child of item.children; track child.id) {\n <li>\n <button\n type=\"button\"\n (click)=\"onItemClick(child)\"\n class=\"w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-all duration-200\"\n [class._shk-bg-primary-soft]=\"isItemActive(child)\"\n [class._shk-bg-primary-soft-dark]=\"isItemActive(child)\"\n [class._shk-text-primary-700]=\"isItemActive(child)\"\n [class.dark:[color:var(--shk-primary-300)]]=\"isItemActive(child)\"\n [class._shk-text-surface-600]=\"!isItemActive(child)\"\n [class.hover:[background-color:var(--shk-surface-100)]]=\"!isItemActive(child)\"\n [class.dark:hover:[background-color:var(--shk-surface-200)]]=\"!isItemActive(child)\"\n [class.hover:[color:var(--shk-surface-900)]]=\"!isItemActive(child)\"\n [class.dark:hover:[color:var(--shk-surface-700)]]=\"!isItemActive(child)\"\n >\n @if (child.icon) {\n <svg [shkIcon]=\"getIcon(child.icon)\" class=\"w-4 h-4 shrink-0\"></svg>\n }\n <span class=\"whitespace-nowrap overflow-hidden\">{{ label(child.label) }}</span>\n @if (isItemActive(child)) {\n <span class=\"w-1.5 h-1.5 rounded-full _shk-bg-primary shrink-0 ml-auto\"></span>\n }\n </button>\n </li>\n }\n </ul>\n }\n </li>\n } @else {\n <!-- Standalone item -->\n <li>\n <button\n type=\"button\"\n (click)=\"onItemClick(item)\"\n class=\"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200\"\n [class._shk-bg-primary]=\"isItemActive(item)\"\n [class._shk-text-white]=\"isItemActive(item)\"\n [class.shadow-md]=\"isItemActive(item)\"\n [class._shk-text-surface-700]=\"!isItemActive(item)\"\n [class.hover:[background-color:var(--shk-surface-100)]]=\"!isItemActive(item)\"\n [class.dark:hover:[background-color:var(--shk-surface-200)]]=\"!isItemActive(item)\"\n >\n @if (item.icon) {\n <svg [shkIcon]=\"getIcon(item.icon)\" class=\"w-5 h-5 shrink-0\"></svg>\n }\n <span class=\"flex-1 text-left whitespace-nowrap overflow-hidden\">{{ label(item.label) }}</span>\n @if (item.badge !== undefined) {\n <span class=\"text-xs font-bold px-2 py-0.5 rounded-full _shk-bg-primary _shk-text-white shrink-0\">\n {{ item.badge }}\n </span>\n }\n </button>\n </li>\n }\n }\n </ul>\n </nav>\n </div>\n }\n</aside>\n",
437
+ styles: [":host{display:block;height:100%}:host(.rail-is-mobile){position:relative;width:0;min-width:0;flex:0 0 0;overflow:visible}.rail-hamburger{position:absolute;top:.75rem;left:.75rem;z-index:var(--shk-rail-hamburger-z, 1);display:grid;place-items:center;width:2.5rem;height:2.5rem;border-radius:.625rem;box-shadow:0 1px 3px #0000001f;cursor:pointer;transition:background-color .15s ease}.rail-hamburger:hover{background-color:var(--shk-surface-100)}.rail-hamburger:focus-visible{outline:2px solid var(--shk-primary-500);outline-offset:2px}.rail-backdrop{position:fixed;inset:0;z-index:49;background-color:var(--shk-bg-overlay, rgba(0, 0, 0, .4));opacity:0;pointer-events:none;transition:opacity .25s ease}.rail-backdrop.is-open{opacity:1;pointer-events:auto}.rail-drawer{position:fixed;top:0;left:0;bottom:0;z-index:50;height:100dvh;max-width:85vw;transform:translate(-100%);visibility:hidden;transition:transform .25s ease,visibility 0s linear .25s}.rail-drawer.is-open{transform:translate(0);visibility:visible;box-shadow:0 10px 30px #00000040;transition:transform .25s ease}@media(prefers-reduced-motion:reduce){.rail-drawer,.rail-drawer.is-open,.rail-backdrop{transition:none}}.rail-workspace{cursor:pointer;transition:opacity .2s ease,box-shadow .2s ease}.rail-workspace.is-collapsed:hover{cursor:col-resize}.rail-workspace .rail-app-icon,.rail-workspace .rail-toggle-icon{grid-area:1 / 1 / 2 / 2;transition:opacity .2s ease}.rail-toggle-icon,.rail-workspace.is-collapsed:hover .rail-app-icon{opacity:0}.rail-workspace.is-collapsed:hover .rail-toggle-icon{opacity:1}.rail-icon{background:transparent;color:var(--shk-surface-700);border:1px solid transparent;transition:transform .18s ease,color .18s ease,background-color .18s ease,box-shadow .18s ease}.rail-icon svg{stroke-width:1.8}.rail-icon:hover{background:var(--shk-surface-100);color:var(--shk-primary-600)}.dark .rail-icon:hover{background:var(--shk-surface-200);color:var(--shk-primary-400)}.rail-icon.is-active{background:var(--shk-primary-600);color:#fff;box-shadow:0 1px 2px #0003}.dark .rail-icon.is-active{background:var(--shk-primary-500);color:#fff}.rail-logout:hover{color:var(--shk-error-500)}.dark .rail-logout:hover{color:var(--shk-error-400)}\n"]
438
+ }]
439
+ }],
440
+ ctorParameters: () => [],
441
+ propDecorators: {
442
+ sections: [{
443
+ type: i0.Input,
444
+ args: [{
445
+ isSignal: true,
446
+ alias: "sections",
447
+ required: false
448
+ }]
449
+ }],
450
+ activeUrl: [{
451
+ type: i0.Input,
452
+ args: [{
453
+ isSignal: true,
454
+ alias: "activeUrl",
455
+ required: false
456
+ }]
457
+ }],
458
+ activeSectionKey: [{
459
+ type: i0.Input,
460
+ args: [{
461
+ isSignal: true,
462
+ alias: "activeSectionKey",
463
+ required: false
464
+ }]
465
+ }, {
466
+ type: i0.Output,
467
+ args: ["activeSectionKeyChange"]
468
+ }],
469
+ collapsed: [{
470
+ type: i0.Input,
471
+ args: [{
472
+ isSignal: true,
473
+ alias: "collapsed",
474
+ required: false
475
+ }]
476
+ }, {
477
+ type: i0.Output,
478
+ args: ["collapsedChange"]
479
+ }],
480
+ activeLang: [{
481
+ type: i0.Input,
482
+ args: [{
483
+ isSignal: true,
484
+ alias: "activeLang",
485
+ required: false
486
+ }]
487
+ }],
488
+ langs: [{
489
+ type: i0.Input,
490
+ args: [{
491
+ isSignal: true,
492
+ alias: "langs",
493
+ required: false
494
+ }]
495
+ }],
496
+ logo: [{
497
+ type: i0.Input,
498
+ args: [{
499
+ isSignal: true,
500
+ alias: "logo",
501
+ required: false
502
+ }]
503
+ }],
504
+ appName: [{
505
+ type: i0.Input,
506
+ args: [{
507
+ isSignal: true,
508
+ alias: "appName",
509
+ required: false
510
+ }]
511
+ }],
512
+ userRole: [{
513
+ type: i0.Input,
514
+ args: [{
515
+ isSignal: true,
516
+ alias: "userRole",
517
+ required: false
518
+ }]
519
+ }],
520
+ labelPipe: [{
521
+ type: i0.Input,
522
+ args: [{
523
+ isSignal: true,
524
+ alias: "labelPipe",
525
+ required: false
526
+ }]
527
+ }],
528
+ railWidth: [{
529
+ type: i0.Input,
530
+ args: [{
531
+ isSignal: true,
532
+ alias: "railWidth",
533
+ required: false
534
+ }]
535
+ }],
536
+ expandedWidth: [{
537
+ type: i0.Input,
538
+ args: [{
539
+ isSignal: true,
540
+ alias: "expandedWidth",
541
+ required: false
542
+ }]
543
+ }],
544
+ workspaceTooltip: [{
545
+ type: i0.Input,
546
+ args: [{
547
+ isSignal: true,
548
+ alias: "workspaceTooltip",
549
+ required: false
550
+ }]
551
+ }],
552
+ logoutTooltip: [{
553
+ type: i0.Input,
554
+ args: [{
555
+ isSignal: true,
556
+ alias: "logoutTooltip",
557
+ required: false
558
+ }]
559
+ }],
560
+ collapseTooltip: [{
561
+ type: i0.Input,
562
+ args: [{
563
+ isSignal: true,
564
+ alias: "collapseTooltip",
565
+ required: false
566
+ }]
567
+ }],
568
+ expandTooltip: [{
569
+ type: i0.Input,
570
+ args: [{
571
+ isSignal: true,
572
+ alias: "expandTooltip",
573
+ required: false
574
+ }]
575
+ }],
576
+ responsive: [{
577
+ type: i0.Input,
578
+ args: [{
579
+ isSignal: true,
580
+ alias: "responsive",
581
+ required: false
582
+ }]
583
+ }],
584
+ mobileBreakpoint: [{
585
+ type: i0.Input,
586
+ args: [{
587
+ isSignal: true,
588
+ alias: "mobileBreakpoint",
589
+ required: false
590
+ }]
591
+ }],
592
+ showMobileToggle: [{
593
+ type: i0.Input,
594
+ args: [{
595
+ isSignal: true,
596
+ alias: "showMobileToggle",
597
+ required: false
598
+ }]
599
+ }],
600
+ mobileOpen: [{
601
+ type: i0.Input,
602
+ args: [{
603
+ isSignal: true,
604
+ alias: "mobileOpen",
605
+ required: false
606
+ }]
607
+ }, {
608
+ type: i0.Output,
609
+ args: ["mobileOpenChange"]
610
+ }],
611
+ openMenuLabel: [{
612
+ type: i0.Input,
613
+ args: [{
614
+ isSignal: true,
615
+ alias: "openMenuLabel",
616
+ required: false
617
+ }]
618
+ }],
619
+ closeMenuLabel: [{
620
+ type: i0.Input,
621
+ args: [{
622
+ isSignal: true,
623
+ alias: "closeMenuLabel",
624
+ required: false
625
+ }]
626
+ }],
627
+ sectionSelected: [{
628
+ type: i0.Output,
629
+ args: ["sectionSelected"]
630
+ }],
631
+ itemClick: [{
632
+ type: i0.Output,
633
+ args: ["itemClick"]
634
+ }],
635
+ setLang: [{
636
+ type: i0.Output,
637
+ args: ["setLang"]
638
+ }],
639
+ logoutRequested: [{
640
+ type: i0.Output,
641
+ args: ["logoutRequested"]
642
+ }],
643
+ toggleSidebar: [{
644
+ type: i0.Output,
645
+ args: ["toggleSidebar"]
646
+ }],
647
+ workspaceClick: [{
648
+ type: i0.Output,
649
+ args: ["workspaceClick"]
650
+ }],
651
+ hamburgerBtn: [{
652
+ type: i0.ViewChild,
653
+ args: ["hamburger", { isSignal: true }]
654
+ }],
655
+ closeBtn: [{
656
+ type: i0.ViewChild,
657
+ args: ["closeBtn", { isSignal: true }]
658
+ }],
659
+ onResize: [{
660
+ type: HostListener,
661
+ args: ["window:resize"]
662
+ }],
663
+ onEscape: [{
664
+ type: HostListener,
665
+ args: ["document:keydown.escape"]
666
+ }]
667
+ }
668
+ });
290
669
  export { RailSidebarComponent };
291
- //# sourceMappingURL=shirkasoft-ui-components-rail-sidebar.mjs.map
670
+
671
+ //# sourceMappingURL=shirkasoft-ui-components-rail-sidebar.mjs.map