shirkasoft-ui-components 1.3.10 → 1.3.12

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.
@@ -261,9 +261,12 @@ class ModalComponent {
261
261
  Object.values(control.controls).forEach((child) => this.markAllAsTouched(child));
262
262
  }
263
263
  }
264
- /** True when the component exposes both `onSubmit` and a `form`. */
264
+ /**
265
+ * True when the component exposes `onSubmit`. The `form` is optional:
266
+ * without it, validation is skipped and `onSubmit` runs directly.
267
+ */
265
268
  isDynamicComponent(instance) {
266
- return typeof instance?.onSubmit === 'function' && instance?.form !== undefined;
269
+ return typeof instance?.onSubmit === 'function';
267
270
  }
268
271
  /** Unsubscribes outputs and destroys the dynamic component. */
269
272
  cleanup() {
@@ -1 +1 @@
1
- {"version":3,"file":"shirkasoft-ui-components-modal.mjs","sources":["../../../projects/ui-components/modal/modal.service.ts","../../../projects/ui-components/modal/modal.component.ts","../../../projects/ui-components/modal/modal.component.html","../../../projects/ui-components/modal/shirkasoft-ui-components-modal.ts"],"sourcesContent":["import { Injectable, Type, signal, computed, inject, DestroyRef } from '@angular/core';\nimport { Router } from '@angular/router';\n\n/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\n\n/** Options for opening a modal through the service. */\nexport interface ModalConfig {\n /** Title shown in the modal header. */\n title: string;\n /** Component rendered inside the modal body. */\n component: Type<any>;\n /** Data passed to the modal component via inputs. */\n data?: Record<string, any>;\n /** Modal width (CSS value). */\n width?: string;\n /** Whether the accept/cancel buttons are shown. */\n showButtons?: boolean;\n /** Whether the expand (fullscreen) button is shown. */\n showExpandButton?: boolean;\n /** Label of the accept button. */\n acceptLabel?: string;\n /** Label of the cancel button. */\n cancelLabel?: string;\n /** Optional callback invoked when the modal closes. */\n onClose?: () => void;\n}\n\n/**\n * Global modal manager. Opens modals on a stack, exposing reactive access to\n * the current modal and the top-most opened config.\n */\n@Injectable({ providedIn: 'root' })\nexport class ModalService {\n /** Stack of open modals (top-most renders on top). */\n private stackSignal = signal<ModalConfig[]>([]);\n /** Counter emitted on each close, used to trigger close animations. */\n private closeRequestSignal = signal<number>(0);\n private router = inject(Router);\n private destroyRef = inject(DestroyRef);\n\n constructor() {\n // Close all modals on navigation and on service destruction.\n this.router.events.subscribe(() => {\n this.stackSignal.set([]);\n });\n this.destroyRef.onDestroy(() => this.stackSignal.set([]));\n }\n\n /** Reactive list of open modals. */\n modalStack = computed(() => this.stackSignal());\n /** Top-most modal on the stack, or null. */\n currentModal = computed<ModalConfig | null>(() => {\n const stack = this.stackSignal();\n return stack.length > 0 ? stack[stack.length - 1] : null;\n });\n /** Reactive close-request counter. */\n closeRequest = computed(() => this.closeRequestSignal());\n\n /** Opens a new modal on top of the stack. */\n open(config: ModalConfig) {\n this.stackSignal.update((stack) => [...stack, config]);\n }\n\n /** Alias of `close()` used by the accept button. */\n accept() {\n this.close();\n }\n\n /** Closes the top-most modal, invoking its onClose callback. */\n close() {\n const stack = this.stackSignal();\n if (stack.length > 0) {\n stack[stack.length - 1]?.onClose?.();\n this.stackSignal.set(stack.slice(0, -1));\n this.closeRequestSignal.update((v) => v + 1);\n }\n }\n\n /** Closes all open modals at once. */\n clear() {\n this.stackSignal.set([]);\n }\n}","import {\n Component,\n viewChild,\n ViewContainerRef,\n ComponentRef,\n inject,\n effect,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n signal,\n DestroyRef,\n computed,\n untracked,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport {\n LucideDynamicIcon,\n LucideX,\n} from '@lucide/angular';\nimport { Subscription } from 'rxjs';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { TranslocoService } from '@jsverse/transloco';\nimport { ModalService, ModalConfig } from './modal.service';\nimport { NotificationService } from 'shirkasoft-ui-components/notification';\nimport { getIcon as getIconFromCentral } from 'shirkasoft-ui-components/utils';\n\n/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\n\n/**\n * Modal dialog that renders a dynamically loaded component, tracks its\n * form validity and submit outputs, and delegates accept/cancel to the\n * shared ModalService.\n */\n@Component({\n selector: 'shk-modal',\n standalone: true,\n imports: [CommonModule, LucideDynamicIcon],\n templateUrl: './modal.component.html',\n styles: [\n `\n /* Own enter animation (the animate-in/zoom-in utilities used before\n need a Tailwind plugin that isn't part of the library). */\n .shk-dialog-backdrop {\n animation: shk-dialog-fade 0.15s ease-out;\n }\n .shk-dialog-panel {\n border: 1px solid var(--shk-surface-200);\n box-shadow:\n 0 24px 48px -12px rgba(0, 0, 0, 0.25),\n 0 8px 16px -8px rgba(0, 0, 0, 0.1);\n animation: shk-dialog-in 0.2s cubic-bezier(0.21, 1.02, 0.73, 1);\n }\n :host-context(.dark) .shk-dialog-panel {\n box-shadow:\n 0 24px 48px -12px rgba(0, 0, 0, 0.7),\n 0 8px 16px -8px rgba(0, 0, 0, 0.5);\n }\n @keyframes shk-dialog-fade {\n from {\n opacity: 0;\n }\n }\n @keyframes shk-dialog-in {\n from {\n opacity: 0;\n transform: translateY(8px) scale(0.97);\n }\n }\n .shk-modal-header {\n padding-top: 1.25rem;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ModalComponent {\n protected getIcon = (name: any) => getIconFromCentral(name, LucideX);\n\n private notificationSrv = inject(NotificationService);\n private destroyRef = inject(DestroyRef);\n private modalSrv = inject(ModalService);\n private transloco = inject(TranslocoService);\n private cdr = inject(ChangeDetectorRef);\n\n /** Reference where the dynamic content is rendered. */\n container = viewChild('dynamicContent', { read: ViewContainerRef });\n\n /** Configuration of the modal currently open (from the service). */\n currentConfig = signal<ModalConfig | null>(null);\n /** Modal title. */\n title = signal('');\n /** Whether the modal is visible. */\n visible = signal(false);\n /** Generic loading flag for the footer actions. */\n loading = signal(false);\n /** Whether the accept action is being processed. */\n isProcessing = signal(false);\n /** Whether the modal is currently expanded to fullscreen. */\n isExpanded = signal(false);\n /** True when the dynamic component reports a valid form. */\n isFormValid = signal(false);\n\n /** Reference to the dynamically created component. */\n componentRef: ComponentRef<any> | null = null;\n /** Subscriptions to the dynamic component outputs. */\n private subscriptions: Subscription[] = [];\n\n /** Width of the modal (fullscreen when expanded). */\n computedModalWidth = computed(() => {\n return this.isExpanded() ? '100vw' : (this.currentConfig()?.width ?? '560px');\n });\n\n /** Whether the footer buttons should be rendered. */\n modalButtonsVisible = computed(() => this.currentConfig()?.showButtons ?? true);\n /** Whether the expand/fullscreen button is shown. */\n showExpandButton = computed(() => this.currentConfig()?.showExpandButton ?? false);\n /** Resolved cancel button label. */\n cancelLabel = computed(() => this.currentConfig()?.cancelLabel || 'Cancelar');\n /** Resolved accept button label. */\n acceptLabel = computed(() => this.currentConfig()?.acceptLabel || 'Aceptar');\n\n constructor() {\n effect(() => {\n const config = this.modalSrv.currentModal();\n if (config) {\n this.currentConfig.set(config);\n this.title.set(config.title);\n this.isExpanded.set(false);\n this.visible.set(true);\n this.isProcessing.set(false);\n this.loading.set(false);\n this.cdr.markForCheck();\n setTimeout(() => {\n untracked(() => this.loadComponent(config));\n });\n } else {\n this.visible.set(false);\n this.currentConfig.set(null);\n this.cdr.markForCheck();\n }\n });\n\n this.destroyRef.onDestroy(() => this.cleanup());\n }\n\n /** Updates visibility when the backdrop/close controls change. */\n onVisibleChange(show: boolean) {\n this.visible.set(show);\n if (!show) {\n this.closeModal();\n }\n this.cdr.markForCheck();\n }\n\n /** Creates the dynamic component and wires its form/submit outputs. */\n private loadComponent(config: ModalConfig) {\n const containerRef = this.container();\n if (!containerRef) return;\n\n this.cleanup();\n containerRef.clear();\n\n this.componentRef = containerRef.createComponent(config.component);\n\n if (config.data) {\n Object.entries(config.data).forEach(([key, value]) => {\n this.componentRef?.setInput(key, value);\n });\n }\n\n const instance = this.componentRef.instance;\n\n this.subscribeToOutput(instance.formValid, (valid: boolean) => {\n this.isFormValid.set(valid);\n this.cdr.markForCheck();\n });\n this.subscribeToOutput(instance.submitSuccess, () =>\n this.handleSubmit(true),\n );\n this.subscribeToOutput(instance.submitError, () =>\n this.handleSubmit(false),\n );\n\n this.componentRef.changeDetectorRef.markForCheck();\n this.cdr.markForCheck();\n }\n\n /** Subscribes to a dynamic component output if it exists. */\n private subscribeToOutput(output: any, callback: (value: any) => void) {\n if (output?.subscribe) {\n this.subscriptions.push(output.subscribe(callback));\n }\n }\n\n /** Finalizes the submit flow, accepting the modal on success. */\n private handleSubmit(success: boolean) {\n this.isProcessing.set(false);\n this.loading.set(false);\n this.cdr.markForCheck();\n if (success) {\n untracked(() => this.modalSrv.accept());\n }\n }\n\n /** Closes the modal, calling the dynamic component's `handleCancel` if any. */\n closeModal() {\n if (this.componentRef?.instance?.handleCancel) {\n this.componentRef.instance.handleCancel();\n }\n this.doClose();\n }\n\n /** Performs the actual close sequence and cleanup. */\n doClose() {\n this.visible.set(false);\n this.isProcessing.set(false);\n this.loading.set(false);\n if (this.isExpanded()) {\n this.isExpanded.set(false);\n }\n this.cdr.markForCheck();\n setTimeout(() => {\n this.cleanup();\n this.modalSrv.close();\n }, 100);\n }\n\n /** Toggles between normal width and fullscreen. */\n toggleExpand() {\n this.isExpanded.update((v) => !v);\n this.cdr.markForCheck();\n }\n\n /** Validates the dynamic component form and triggers its `onSubmit`. */\n onAccept() {\n if (!this.componentRef || !this.isDynamicComponent(this.componentRef.instance)) return;\n\n if (this.isProcessing()) return;\n\n const instance = this.componentRef.instance;\n const form = this.getForm(instance);\n\n if (form) {\n this.markAllAsTouched(form);\n this.componentRef.changeDetectorRef.markForCheck();\n this.cdr.markForCheck();\n\n if (this.hasRealErrors(form)) {\n this.notificationSrv.addNotification(\n this.transloco.translate('modal.formInvalid'),\n 'warning',\n );\n return;\n }\n }\n\n this.isProcessing.set(true);\n this.loading.set(true);\n this.cdr.markForCheck();\n instance.onSubmit();\n }\n\n /** Resolves the dynamic component's form (property or getter function). */\n private getForm(instance: any): FormGroup | null {\n if (!instance['form']) return null;\n return typeof instance['form'] === 'function'\n ? instance['form']()\n : instance['form'];\n }\n\n /** Recursively checks for real validation errors (ignoring 'warning'). */\n private hasRealErrors(control: FormGroup | FormControl): boolean {\n if (control instanceof FormControl) {\n const errors = control.errors;\n return errors\n ? Object.keys(errors).some((key) => key !== 'warning')\n : false;\n }\n\n const groupErrors = control.errors;\n if (\n groupErrors &&\n Object.keys(groupErrors).some((key) => key !== 'warning')\n ) {\n return true;\n }\n\n return Object.values(control.controls).some((child) =>\n this.hasRealErrors(child as any),\n );\n }\n\n /** Marks a form (and all its descendants) as touched. */\n private markAllAsTouched(control: FormGroup | FormControl): void {\n control.markAsTouched();\n control.updateValueAndValidity({ onlySelf: true, emitEvent: true });\n\n if (control instanceof FormGroup) {\n Object.values(control.controls).forEach((child) =>\n this.markAllAsTouched(child as any),\n );\n }\n }\n\n /** True when the component exposes both `onSubmit` and a `form`. */\n private isDynamicComponent(instance: any): boolean {\n return typeof instance?.onSubmit === 'function' && instance?.form !== undefined;\n }\n\n /** Unsubscribes outputs and destroys the dynamic component. */\n private cleanup() {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions = [];\n\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = null;\n }\n }\n}\n","@if (visible()) {\n <div\n class=\"shk-dialog-backdrop fixed inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center z-40 p-4 pt-4 overflow-y-auto _shk-scrollbar\"\n (click)=\"closeModal()\"\n >\n <div\n class=\"shk-dialog-panel bg-white dark:[background-color:var(--shk-surface-100)] rounded-xl shadow-2xl overflow-hidden flex flex-col\"\n [class.w-[95vw]]=\"isExpanded()\"\n [class.h-[90vh]]=\"isExpanded()\"\n [class.w-full]=\"!isExpanded()\"\n [style.max-width]=\"isExpanded() ? undefined : computedModalWidth()\"\n (click)=\"$event.stopPropagation()\"\n >\n <div class=\"shk-modal-header flex items-center justify-between px-6 pt-4 pb-2 shrink-0\">\n <span class=\"font-semibold text-lg _shk-text-surface-800 dark:[color:var(--shk-surface-800)]\">{{ title() }}</span>\n <div class=\"flex items-center gap-2\">\n @if (showExpandButton()) {\n <button\n type=\"button\"\n (click)=\"toggleExpand()\"\n class=\"p-1.5 rounded-lg hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] _shk-text-surface-500 dark:[color:var(--shk-surface-500)] transition-colors\"\n >\n @if (isExpanded()) {\n <svg [lucideIcon]=\"getIcon('minimize-2')\" class=\"w-4 h-4\"></svg>\n } @else {\n <svg [lucideIcon]=\"getIcon('maximize-2')\" class=\"w-4 h-4\"></svg>\n }\n </button>\n }\n <button\n type=\"button\"\n (click)=\"closeModal()\"\n class=\"p-1.5 rounded-lg hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] _shk-text-surface-500 dark:[color:var(--shk-surface-500)] transition-colors\"\n >\n <svg [lucideIcon]=\"getIcon('x')\" class=\"w-4 h-4\"></svg>\n </button>\n </div>\n </div>\n\n <div class=\"overflow-y-auto px-6 py-4 flex-1 max-h-[70vh] _shk-scrollbar\">\n <ng-container #dynamicContent></ng-container>\n </div>\n\n @if (modalButtonsVisible()) {\n <hr class=\"border-t _shk-border dark:[border-color:var(--shk-surface-200)] shrink-0\" />\n <div class=\"flex justify-end gap-3 px-6 py-4 shrink-0\">\n <button\n type=\"button\"\n (click)=\"closeModal()\"\n [disabled]=\"loading()\"\n class=\"px-4 py-2 text-sm font-semibold _shk-text-surface-600 dark:[color:var(--shk-surface-600)] _shk-bg-surface-100 dark:[background-color:var(--shk-surface-200)] hover:[background-color:var(--shk-surface-200)] dark:hover:[background-color:var(--shk-surface-300)] rounded-lg transition-colors flex items-center gap-2 disabled:opacity-50\"\n >\n <svg [lucideIcon]=\"getIcon('x')\" class=\"w-4 h-4\"></svg>\n {{ cancelLabel() }}\n </button>\n <button\n type=\"button\"\n (click)=\"onAccept()\"\n [disabled]=\"loading()\"\n class=\"px-4 py-2 text-sm font-semibold _shk-text-white _shk-bg-emerald hover:[background-color:var(--shk-emerald-700)] rounded-lg shadow-md transition-all flex items-center gap-2 disabled:opacity-50\"\n >\n @if (loading()) {\n <svg [lucideIcon]=\"getIcon('loader-circle')\" class=\"w-4 h-4 animate-spin\"></svg>\n } @else {\n <svg [lucideIcon]=\"getIcon('check')\" class=\"w-4 h-4\"></svg>\n }\n {{ acceptLabel() }}\n </button>\n </div>\n }\n </div>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["getIconFromCentral"],"mappings":";;;;;;;;;;AA+BA;;;AAGG;MAEU,YAAY,CAAA;AAQvB,IAAA,WAAA,GAAA;;AANQ,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAgB,EAAE,kFAAC;;AAEvC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAS,CAAC,yFAAC;AACtC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;QAWvC,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;;AAE/C,QAAA,IAAA,CAAA,YAAY,GAAG,QAAQ,CAAqB,MAAK;AAC/C,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE;YAChC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI;AAC1D,QAAA,CAAC,mFAAC;;QAEF,IAAA,CAAA,YAAY,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,kBAAkB,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,cAAA,EAAA,CAAA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AAiB,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAuC9B,cAAc,EAAA,UAAA,EAAA,CAAA;kBA1C1B,SAAS;+BACE,WAAW,EAAA,UAAA,EACT,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAE,iBAAiB,CAAC,EAAA,eAAA,EAqCzB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,mlHAAA,EAAA,MAAA,EAAA,CAAA,wfAAA,CAAA,EAAA;AAYzB,SAAA,CAAA,EAAA,cAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,gBAAgB,EAAA,EAAA,GAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEzFpE;;AAEG;;;;"}
1
+ {"version":3,"file":"shirkasoft-ui-components-modal.mjs","sources":["../../../projects/ui-components/modal/modal.service.ts","../../../projects/ui-components/modal/modal.component.ts","../../../projects/ui-components/modal/modal.component.html","../../../projects/ui-components/modal/shirkasoft-ui-components-modal.ts"],"sourcesContent":["import { Injectable, Type, signal, computed, inject, DestroyRef } from '@angular/core';\nimport { Router } from '@angular/router';\n\n/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\n\n/** Options for opening a modal through the service. */\nexport interface ModalConfig {\n /** Title shown in the modal header. */\n title: string;\n /** Component rendered inside the modal body. */\n component: Type<any>;\n /** Data passed to the modal component via inputs. */\n data?: Record<string, any>;\n /** Modal width (CSS value). */\n width?: string;\n /** Whether the accept/cancel buttons are shown. */\n showButtons?: boolean;\n /** Whether the expand (fullscreen) button is shown. */\n showExpandButton?: boolean;\n /** Label of the accept button. */\n acceptLabel?: string;\n /** Label of the cancel button. */\n cancelLabel?: string;\n /** Optional callback invoked when the modal closes. */\n onClose?: () => void;\n}\n\n/**\n * Global modal manager. Opens modals on a stack, exposing reactive access to\n * the current modal and the top-most opened config.\n */\n@Injectable({ providedIn: 'root' })\nexport class ModalService {\n /** Stack of open modals (top-most renders on top). */\n private stackSignal = signal<ModalConfig[]>([]);\n /** Counter emitted on each close, used to trigger close animations. */\n private closeRequestSignal = signal<number>(0);\n private router = inject(Router);\n private destroyRef = inject(DestroyRef);\n\n constructor() {\n // Close all modals on navigation and on service destruction.\n this.router.events.subscribe(() => {\n this.stackSignal.set([]);\n });\n this.destroyRef.onDestroy(() => this.stackSignal.set([]));\n }\n\n /** Reactive list of open modals. */\n modalStack = computed(() => this.stackSignal());\n /** Top-most modal on the stack, or null. */\n currentModal = computed<ModalConfig | null>(() => {\n const stack = this.stackSignal();\n return stack.length > 0 ? stack[stack.length - 1] : null;\n });\n /** Reactive close-request counter. */\n closeRequest = computed(() => this.closeRequestSignal());\n\n /** Opens a new modal on top of the stack. */\n open(config: ModalConfig) {\n this.stackSignal.update((stack) => [...stack, config]);\n }\n\n /** Alias of `close()` used by the accept button. */\n accept() {\n this.close();\n }\n\n /** Closes the top-most modal, invoking its onClose callback. */\n close() {\n const stack = this.stackSignal();\n if (stack.length > 0) {\n stack[stack.length - 1]?.onClose?.();\n this.stackSignal.set(stack.slice(0, -1));\n this.closeRequestSignal.update((v) => v + 1);\n }\n }\n\n /** Closes all open modals at once. */\n clear() {\n this.stackSignal.set([]);\n }\n}","import {\n Component,\n viewChild,\n ViewContainerRef,\n ComponentRef,\n inject,\n effect,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n signal,\n DestroyRef,\n computed,\n untracked,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport {\n LucideDynamicIcon,\n LucideX,\n} from '@lucide/angular';\nimport { Subscription } from 'rxjs';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { TranslocoService } from '@jsverse/transloco';\nimport { ModalService, ModalConfig } from './modal.service';\nimport { NotificationService } from 'shirkasoft-ui-components/notification';\nimport { getIcon as getIconFromCentral } from 'shirkasoft-ui-components/utils';\n\n/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\n\n/**\n * Modal dialog that renders a dynamically loaded component, tracks its\n * form validity and submit outputs, and delegates accept/cancel to the\n * shared ModalService.\n */\n@Component({\n selector: 'shk-modal',\n standalone: true,\n imports: [CommonModule, LucideDynamicIcon],\n templateUrl: './modal.component.html',\n styles: [\n `\n /* Own enter animation (the animate-in/zoom-in utilities used before\n need a Tailwind plugin that isn't part of the library). */\n .shk-dialog-backdrop {\n animation: shk-dialog-fade 0.15s ease-out;\n }\n .shk-dialog-panel {\n border: 1px solid var(--shk-surface-200);\n box-shadow:\n 0 24px 48px -12px rgba(0, 0, 0, 0.25),\n 0 8px 16px -8px rgba(0, 0, 0, 0.1);\n animation: shk-dialog-in 0.2s cubic-bezier(0.21, 1.02, 0.73, 1);\n }\n :host-context(.dark) .shk-dialog-panel {\n box-shadow:\n 0 24px 48px -12px rgba(0, 0, 0, 0.7),\n 0 8px 16px -8px rgba(0, 0, 0, 0.5);\n }\n @keyframes shk-dialog-fade {\n from {\n opacity: 0;\n }\n }\n @keyframes shk-dialog-in {\n from {\n opacity: 0;\n transform: translateY(8px) scale(0.97);\n }\n }\n .shk-modal-header {\n padding-top: 1.25rem;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ModalComponent {\n protected getIcon = (name: any) => getIconFromCentral(name, LucideX);\n\n private notificationSrv = inject(NotificationService);\n private destroyRef = inject(DestroyRef);\n private modalSrv = inject(ModalService);\n private transloco = inject(TranslocoService);\n private cdr = inject(ChangeDetectorRef);\n\n /** Reference where the dynamic content is rendered. */\n container = viewChild('dynamicContent', { read: ViewContainerRef });\n\n /** Configuration of the modal currently open (from the service). */\n currentConfig = signal<ModalConfig | null>(null);\n /** Modal title. */\n title = signal('');\n /** Whether the modal is visible. */\n visible = signal(false);\n /** Generic loading flag for the footer actions. */\n loading = signal(false);\n /** Whether the accept action is being processed. */\n isProcessing = signal(false);\n /** Whether the modal is currently expanded to fullscreen. */\n isExpanded = signal(false);\n /** True when the dynamic component reports a valid form. */\n isFormValid = signal(false);\n\n /** Reference to the dynamically created component. */\n componentRef: ComponentRef<any> | null = null;\n /** Subscriptions to the dynamic component outputs. */\n private subscriptions: Subscription[] = [];\n\n /** Width of the modal (fullscreen when expanded). */\n computedModalWidth = computed(() => {\n return this.isExpanded() ? '100vw' : (this.currentConfig()?.width ?? '560px');\n });\n\n /** Whether the footer buttons should be rendered. */\n modalButtonsVisible = computed(() => this.currentConfig()?.showButtons ?? true);\n /** Whether the expand/fullscreen button is shown. */\n showExpandButton = computed(() => this.currentConfig()?.showExpandButton ?? false);\n /** Resolved cancel button label. */\n cancelLabel = computed(() => this.currentConfig()?.cancelLabel || 'Cancelar');\n /** Resolved accept button label. */\n acceptLabel = computed(() => this.currentConfig()?.acceptLabel || 'Aceptar');\n\n constructor() {\n effect(() => {\n const config = this.modalSrv.currentModal();\n if (config) {\n this.currentConfig.set(config);\n this.title.set(config.title);\n this.isExpanded.set(false);\n this.visible.set(true);\n this.isProcessing.set(false);\n this.loading.set(false);\n this.cdr.markForCheck();\n setTimeout(() => {\n untracked(() => this.loadComponent(config));\n });\n } else {\n this.visible.set(false);\n this.currentConfig.set(null);\n this.cdr.markForCheck();\n }\n });\n\n this.destroyRef.onDestroy(() => this.cleanup());\n }\n\n /** Updates visibility when the backdrop/close controls change. */\n onVisibleChange(show: boolean) {\n this.visible.set(show);\n if (!show) {\n this.closeModal();\n }\n this.cdr.markForCheck();\n }\n\n /** Creates the dynamic component and wires its form/submit outputs. */\n private loadComponent(config: ModalConfig) {\n const containerRef = this.container();\n if (!containerRef) return;\n\n this.cleanup();\n containerRef.clear();\n\n this.componentRef = containerRef.createComponent(config.component);\n\n if (config.data) {\n Object.entries(config.data).forEach(([key, value]) => {\n this.componentRef?.setInput(key, value);\n });\n }\n\n const instance = this.componentRef.instance;\n\n this.subscribeToOutput(instance.formValid, (valid: boolean) => {\n this.isFormValid.set(valid);\n this.cdr.markForCheck();\n });\n this.subscribeToOutput(instance.submitSuccess, () =>\n this.handleSubmit(true),\n );\n this.subscribeToOutput(instance.submitError, () =>\n this.handleSubmit(false),\n );\n\n this.componentRef.changeDetectorRef.markForCheck();\n this.cdr.markForCheck();\n }\n\n /** Subscribes to a dynamic component output if it exists. */\n private subscribeToOutput(output: any, callback: (value: any) => void) {\n if (output?.subscribe) {\n this.subscriptions.push(output.subscribe(callback));\n }\n }\n\n /** Finalizes the submit flow, accepting the modal on success. */\n private handleSubmit(success: boolean) {\n this.isProcessing.set(false);\n this.loading.set(false);\n this.cdr.markForCheck();\n if (success) {\n untracked(() => this.modalSrv.accept());\n }\n }\n\n /** Closes the modal, calling the dynamic component's `handleCancel` if any. */\n closeModal() {\n if (this.componentRef?.instance?.handleCancel) {\n this.componentRef.instance.handleCancel();\n }\n this.doClose();\n }\n\n /** Performs the actual close sequence and cleanup. */\n doClose() {\n this.visible.set(false);\n this.isProcessing.set(false);\n this.loading.set(false);\n if (this.isExpanded()) {\n this.isExpanded.set(false);\n }\n this.cdr.markForCheck();\n setTimeout(() => {\n this.cleanup();\n this.modalSrv.close();\n }, 100);\n }\n\n /** Toggles between normal width and fullscreen. */\n toggleExpand() {\n this.isExpanded.update((v) => !v);\n this.cdr.markForCheck();\n }\n\n /** Validates the dynamic component form and triggers its `onSubmit`. */\n onAccept() {\n if (!this.componentRef || !this.isDynamicComponent(this.componentRef.instance)) return;\n\n if (this.isProcessing()) return;\n\n const instance = this.componentRef.instance;\n const form = this.getForm(instance);\n\n if (form) {\n this.markAllAsTouched(form);\n this.componentRef.changeDetectorRef.markForCheck();\n this.cdr.markForCheck();\n\n if (this.hasRealErrors(form)) {\n this.notificationSrv.addNotification(\n this.transloco.translate('modal.formInvalid'),\n 'warning',\n );\n return;\n }\n }\n\n this.isProcessing.set(true);\n this.loading.set(true);\n this.cdr.markForCheck();\n instance.onSubmit();\n }\n\n /** Resolves the dynamic component's form (property or getter function). */\n private getForm(instance: any): FormGroup | null {\n if (!instance['form']) return null;\n return typeof instance['form'] === 'function'\n ? instance['form']()\n : instance['form'];\n }\n\n /** Recursively checks for real validation errors (ignoring 'warning'). */\n private hasRealErrors(control: FormGroup | FormControl): boolean {\n if (control instanceof FormControl) {\n const errors = control.errors;\n return errors\n ? Object.keys(errors).some((key) => key !== 'warning')\n : false;\n }\n\n const groupErrors = control.errors;\n if (\n groupErrors &&\n Object.keys(groupErrors).some((key) => key !== 'warning')\n ) {\n return true;\n }\n\n return Object.values(control.controls).some((child) =>\n this.hasRealErrors(child as any),\n );\n }\n\n /** Marks a form (and all its descendants) as touched. */\n private markAllAsTouched(control: FormGroup | FormControl): void {\n control.markAsTouched();\n control.updateValueAndValidity({ onlySelf: true, emitEvent: true });\n\n if (control instanceof FormGroup) {\n Object.values(control.controls).forEach((child) =>\n this.markAllAsTouched(child as any),\n );\n }\n }\n\n /**\n * True when the component exposes `onSubmit`. The `form` is optional:\n * without it, validation is skipped and `onSubmit` runs directly.\n */\n private isDynamicComponent(instance: any): boolean {\n return typeof instance?.onSubmit === 'function';\n }\n\n /** Unsubscribes outputs and destroys the dynamic component. */\n private cleanup() {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions = [];\n\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = null;\n }\n }\n}\n","@if (visible()) {\n <div\n class=\"shk-dialog-backdrop fixed inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center z-40 p-4 pt-4 overflow-y-auto _shk-scrollbar\"\n (click)=\"closeModal()\"\n >\n <div\n class=\"shk-dialog-panel bg-white dark:[background-color:var(--shk-surface-100)] rounded-xl shadow-2xl overflow-hidden flex flex-col\"\n [class.w-[95vw]]=\"isExpanded()\"\n [class.h-[90vh]]=\"isExpanded()\"\n [class.w-full]=\"!isExpanded()\"\n [style.max-width]=\"isExpanded() ? undefined : computedModalWidth()\"\n (click)=\"$event.stopPropagation()\"\n >\n <div class=\"shk-modal-header flex items-center justify-between px-6 pt-4 pb-2 shrink-0\">\n <span class=\"font-semibold text-lg _shk-text-surface-800 dark:[color:var(--shk-surface-800)]\">{{ title() }}</span>\n <div class=\"flex items-center gap-2\">\n @if (showExpandButton()) {\n <button\n type=\"button\"\n (click)=\"toggleExpand()\"\n class=\"p-1.5 rounded-lg hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] _shk-text-surface-500 dark:[color:var(--shk-surface-500)] transition-colors\"\n >\n @if (isExpanded()) {\n <svg [lucideIcon]=\"getIcon('minimize-2')\" class=\"w-4 h-4\"></svg>\n } @else {\n <svg [lucideIcon]=\"getIcon('maximize-2')\" class=\"w-4 h-4\"></svg>\n }\n </button>\n }\n <button\n type=\"button\"\n (click)=\"closeModal()\"\n class=\"p-1.5 rounded-lg hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] _shk-text-surface-500 dark:[color:var(--shk-surface-500)] transition-colors\"\n >\n <svg [lucideIcon]=\"getIcon('x')\" class=\"w-4 h-4\"></svg>\n </button>\n </div>\n </div>\n\n <div class=\"overflow-y-auto px-6 py-4 flex-1 max-h-[70vh] _shk-scrollbar\">\n <ng-container #dynamicContent></ng-container>\n </div>\n\n @if (modalButtonsVisible()) {\n <hr class=\"border-t _shk-border dark:[border-color:var(--shk-surface-200)] shrink-0\" />\n <div class=\"flex justify-end gap-3 px-6 py-4 shrink-0\">\n <button\n type=\"button\"\n (click)=\"closeModal()\"\n [disabled]=\"loading()\"\n class=\"px-4 py-2 text-sm font-semibold _shk-text-surface-600 dark:[color:var(--shk-surface-600)] _shk-bg-surface-100 dark:[background-color:var(--shk-surface-200)] hover:[background-color:var(--shk-surface-200)] dark:hover:[background-color:var(--shk-surface-300)] rounded-lg transition-colors flex items-center gap-2 disabled:opacity-50\"\n >\n <svg [lucideIcon]=\"getIcon('x')\" class=\"w-4 h-4\"></svg>\n {{ cancelLabel() }}\n </button>\n <button\n type=\"button\"\n (click)=\"onAccept()\"\n [disabled]=\"loading()\"\n class=\"px-4 py-2 text-sm font-semibold _shk-text-white _shk-bg-emerald hover:[background-color:var(--shk-emerald-700)] rounded-lg shadow-md transition-all flex items-center gap-2 disabled:opacity-50\"\n >\n @if (loading()) {\n <svg [lucideIcon]=\"getIcon('loader-circle')\" class=\"w-4 h-4 animate-spin\"></svg>\n } @else {\n <svg [lucideIcon]=\"getIcon('check')\" class=\"w-4 h-4\"></svg>\n }\n {{ acceptLabel() }}\n </button>\n </div>\n }\n </div>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["getIconFromCentral"],"mappings":";;;;;;;;;;AA+BA;;;AAGG;MAEU,YAAY,CAAA;AAQvB,IAAA,WAAA,GAAA;;AANQ,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAgB,EAAE,kFAAC;;AAEvC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAS,CAAC,yFAAC;AACtC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;QAWvC,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;;AAE/C,QAAA,IAAA,CAAA,YAAY,GAAG,QAAQ,CAAqB,MAAK;AAC/C,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE;YAChC,OAAO,KAAK,CAAC,MAAM,GAAG,CAA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EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECzFlE,mlHAyEA,EAAA,MAAA,EAAA,CAAA,wfAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDjCY,YAAY,+BAAE,iBAAiB,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAuC9B,cAAc,EAAA,UAAA,EAAA,CAAA;kBA1C1B,SAAS;+BACE,WAAW,EAAA,UAAA,EACT,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAE,iBAAiB,CAAC,EAAA,eAAA,EAqCzB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,mlHAAA,EAAA,MAAA,EAAA,CAAA,wfAAA,CAAA,EAAA;AAYzB,SAAA,CAAA,EAAA,cAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,gBAAgB,EAAA,EAAA,GAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEzFpE;;AAEG;;;;"}
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, model, output, signal, computed, effect, Component } from '@angular/core';
2
+ import { inject, PLATFORM_ID, Injector, input, model, output, signal, computed, viewChild, effect, untracked, afterNextRender, HostListener, Component } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import { LucideMenu, LucideDynamicIcon } from '@lucide/angular';
4
+ import { isPlatformBrowser, CommonModule } from '@angular/common';
5
+ import { LucideMenu, LucideX, LucideDynamicIcon } from '@lucide/angular';
6
6
  import { getIcon } from 'shirkasoft-ui-components/utils';
7
7
  import { TooltipComponent } from 'shirkasoft-ui-components/tooltip';
8
8
 
@@ -11,12 +11,20 @@ import { TooltipComponent } from 'shirkasoft-ui-components/tooltip';
11
11
  * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
12
12
  * Belongs to Shirkasoft.
13
13
  */
14
+ /** Counter used to generate unique element ids per instance. */
15
+ let nextRailId = 0;
14
16
  /**
15
17
  * Narrow "rail" sidebar that expands into sections. Supports sections, roles,
16
- * language switching, collapse/expand and responsive tooltips.
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.
17
21
  */
18
22
  class RailSidebarComponent {
19
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++}`;
20
28
  /** Sections presented as expandable areas of the rail. */
21
29
  this.sections = input([], ...(ngDevMode ? [{ debugName: "sections" }] : /* istanbul ignore next */ []));
22
30
  /** Current location url used to detect the active section/item. */
@@ -49,6 +57,21 @@ class RailSidebarComponent {
49
57
  this.collapseTooltip = input('Colapsar', ...(ngDevMode ? [{ debugName: "collapseTooltip" }] : /* istanbul ignore next */ []));
50
58
  /** Tooltip for expanding the sidebar. */
51
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 */ []));
52
75
  /** Emitted when a section is selected, with its key and optional route. */
53
76
  this.sectionSelected = output();
54
77
  /** Emitted when a navigation item is clicked. */
@@ -62,10 +85,19 @@ class RailSidebarComponent {
62
85
  /** Emitted when the workspace/home entry is clicked. */
63
86
  this.workspaceClick = output();
64
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 */ []));
65
97
  /** Set of group ids currently expanded. */
66
98
  this.expandedGroups = signal(new Set(), ...(ngDevMode ? [{ debugName: "expandedGroups" }] : /* istanbul ignore next */ []));
67
99
  /** Current sidebar width depending on the collapsed state. */
68
- this.width = computed(() => this.collapsed() ? this.railWidth() : this.expandedWidth(), ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
100
+ this.width = computed(() => this.expanded() ? this.expandedWidth() : this.railWidth(), ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
69
101
  /** The section currently selected. */
70
102
  this.activeSection = computed(() => this.sections().find((s) => s.key === this.activeSectionKey()) ?? null, ...(ngDevMode ? [{ debugName: "activeSection" }] : /* istanbul ignore next */ []));
71
103
  /** Items of the active section, filtered by role. */
@@ -78,6 +110,20 @@ class RailSidebarComponent {
78
110
  return role ? item.roles.includes(role) : false;
79
111
  });
80
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
+ });
81
127
  effect(() => {
82
128
  const url = this.activeUrl();
83
129
  if (!url)
@@ -93,6 +139,26 @@ class RailSidebarComponent {
93
139
  }
94
140
  });
95
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
+ }
96
162
  /** Applies the `labelPipe` transform to a label. */
97
163
  label(label) {
98
164
  return this.labelPipe()(label);
@@ -156,7 +222,7 @@ class RailSidebarComponent {
156
222
  onSectionClick(section) {
157
223
  this.activeSectionKey.set(section.key);
158
224
  this.sectionSelected.emit({ key: section.key, routerLink: section.routerLink });
159
- if (this.collapsed()) {
225
+ if (!this.isMobile() && this.collapsed()) {
160
226
  this.collapsed.set(false);
161
227
  this.toggleSidebar.emit(false);
162
228
  }
@@ -166,15 +232,23 @@ class RailSidebarComponent {
166
232
  if (item.disabled)
167
233
  return;
168
234
  this.itemClick.emit(item);
235
+ if (this.isMobile())
236
+ this.closeMobile();
169
237
  }
170
238
  /** Emits `workspaceClick` and expands the sidebar if it was collapsed. */
171
239
  onWorkspace() {
172
240
  this.workspaceClick.emit();
173
- if (this.collapsed()) {
241
+ if (!this.isMobile() && this.collapsed()) {
174
242
  this.collapsed.set(false);
175
243
  this.toggleSidebar.emit(false);
176
244
  }
177
245
  }
246
+ /** Emits `logoutRequested` (closing the mobile drawer). */
247
+ onLogout() {
248
+ this.logoutRequested.emit();
249
+ if (this.isMobile())
250
+ this.closeMobile();
251
+ }
178
252
  /** Cycles to the next language and emits `setLang`. */
179
253
  onToggleLang() {
180
254
  const langs = this.langs();
@@ -186,16 +260,28 @@ class RailSidebarComponent {
186
260
  }
187
261
  /** Toggles collapse and emits `toggleSidebar`. */
188
262
  onToggleSidebar() {
263
+ if (this.isMobile()) {
264
+ this.closeMobile();
265
+ return;
266
+ }
189
267
  this.collapsed.update((v) => !v);
190
268
  this.toggleSidebar.emit(this.collapsed());
191
269
  }
192
270
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: RailSidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
193
- 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 } }, outputs: { activeSectionKey: "activeSectionKeyChange", collapsed: "collapsedChange", sectionSelected: "sectionSelected", itemClick: "itemClick", setLang: "setLang", logoutRequested: "logoutRequested", toggleSidebar: "toggleSidebar", workspaceClick: "workspaceClick" }, ngImport: i0, template: "<aside\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 [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]=\"collapsed()\"\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 (collapsed()) {\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('globe')\" 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)=\"logoutRequested.emit()\"\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 (!collapsed()) {\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 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)]\"\n [title]=\"collapseTooltip()\"\n >\n <svg [lucideIcon]=\"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%}.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" }] }); }
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" }] }); }
194
272
  }
195
273
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: RailSidebarComponent, decorators: [{
196
274
  type: Component,
197
- args: [{ selector: 'shk-rail-sidebar', standalone: true, imports: [CommonModule, LucideDynamicIcon, TooltipComponent], template: "<aside\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 [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]=\"collapsed()\"\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 (collapsed()) {\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('globe')\" 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)=\"logoutRequested.emit()\"\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 (!collapsed()) {\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 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)]\"\n [title]=\"collapseTooltip()\"\n >\n <svg [lucideIcon]=\"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%}.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"] }]
198
- }], 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 }] }], 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"] }] } });
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
+ }] } });
199
285
 
200
286
  /**
201
287
  * Generated bundle index. Do not edit.