yukit-web 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npm/_logs/2026-08-20T08_40_55_706Z-debug-0.log +38 -0
- package/.npm/_logs/2026-08-20T08_40_56_280Z-debug-0.log +14 -0
- package/README.md +1465 -0
- package/fesm2022/yukit-web-helm-accordion.mjs +141 -0
- package/fesm2022/yukit-web-helm-accordion.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-alert-dialog.mjs +250 -0
- package/fesm2022/yukit-web-helm-alert-dialog.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-alert.mjs +94 -0
- package/fesm2022/yukit-web-helm-alert.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-aspect-ratio.mjs +47 -0
- package/fesm2022/yukit-web-helm-aspect-ratio.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-attachment.mjs +211 -0
- package/fesm2022/yukit-web-helm-attachment.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-autocomplete.mjs +361 -0
- package/fesm2022/yukit-web-helm-autocomplete.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-avatar.mjs +152 -0
- package/fesm2022/yukit-web-helm-avatar.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-badge.mjs +47 -0
- package/fesm2022/yukit-web-helm-badge.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-breadcrumb.mjs +196 -0
- package/fesm2022/yukit-web-helm-breadcrumb.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-bubble.mjs +121 -0
- package/fesm2022/yukit-web-helm-bubble.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-button-group.mjs +86 -0
- package/fesm2022/yukit-web-helm-button-group.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-button.mjs +77 -0
- package/fesm2022/yukit-web-helm-button.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-calendar.mjs +937 -0
- package/fesm2022/yukit-web-helm-calendar.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-card.mjs +141 -0
- package/fesm2022/yukit-web-helm-card.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-carousel.mjs +270 -0
- package/fesm2022/yukit-web-helm-carousel.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-checkbox.mjs +147 -0
- package/fesm2022/yukit-web-helm-checkbox.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-collapsible.mjs +62 -0
- package/fesm2022/yukit-web-helm-collapsible.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-combobox.mjs +624 -0
- package/fesm2022/yukit-web-helm-combobox.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-command.mjs +315 -0
- package/fesm2022/yukit-web-helm-command.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-context-menu.mjs +71 -0
- package/fesm2022/yukit-web-helm-context-menu.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-date-picker.mjs +1517 -0
- package/fesm2022/yukit-web-helm-date-picker.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-dialog.mjs +271 -0
- package/fesm2022/yukit-web-helm-dialog.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-drawer.mjs +233 -0
- package/fesm2022/yukit-web-helm-drawer.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-dropdown-menu.mjs +508 -0
- package/fesm2022/yukit-web-helm-dropdown-menu.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-empty.mjs +125 -0
- package/fesm2022/yukit-web-helm-empty.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-field.mjs +325 -0
- package/fesm2022/yukit-web-helm-field.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-hover-card.mjs +102 -0
- package/fesm2022/yukit-web-helm-hover-card.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-input-group.mjs +171 -0
- package/fesm2022/yukit-web-helm-input-group.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-input-otp.mjs +127 -0
- package/fesm2022/yukit-web-helm-input-otp.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-input.mjs +32 -0
- package/fesm2022/yukit-web-helm-input.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-item.mjs +242 -0
- package/fesm2022/yukit-web-helm-item.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-kbd.mjs +46 -0
- package/fesm2022/yukit-web-helm-kbd.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-label.mjs +30 -0
- package/fesm2022/yukit-web-helm-label.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-marker.mjs +77 -0
- package/fesm2022/yukit-web-helm-marker.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-menubar.mjs +90 -0
- package/fesm2022/yukit-web-helm-menubar.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-message.mjs +115 -0
- package/fesm2022/yukit-web-helm-message.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-native-select.mjs +180 -0
- package/fesm2022/yukit-web-helm-native-select.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-navigation-menu.mjs +173 -0
- package/fesm2022/yukit-web-helm-navigation-menu.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-pagination.mjs +745 -0
- package/fesm2022/yukit-web-helm-pagination.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-popover.mjs +136 -0
- package/fesm2022/yukit-web-helm-popover.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-progress.mjs +60 -0
- package/fesm2022/yukit-web-helm-progress.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-radio-group.mjs +185 -0
- package/fesm2022/yukit-web-helm-radio-group.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-resizable.mjs +98 -0
- package/fesm2022/yukit-web-helm-resizable.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-scroll-area.mjs +36 -0
- package/fesm2022/yukit-web-helm-scroll-area.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-select.mjs +412 -0
- package/fesm2022/yukit-web-helm-select.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-separator.mjs +33 -0
- package/fesm2022/yukit-web-helm-separator.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-sheet.mjs +254 -0
- package/fesm2022/yukit-web-helm-sheet.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-sidebar.mjs +857 -0
- package/fesm2022/yukit-web-helm-sidebar.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-skeleton.mjs +29 -0
- package/fesm2022/yukit-web-helm-skeleton.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-slider.mjs +123 -0
- package/fesm2022/yukit-web-helm-slider.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-sonner.mjs +126 -0
- package/fesm2022/yukit-web-helm-sonner.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-spinner.mjs +48 -0
- package/fesm2022/yukit-web-helm-spinner.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-switch.mjs +126 -0
- package/fesm2022/yukit-web-helm-switch.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-table.mjs +180 -0
- package/fesm2022/yukit-web-helm-table.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-tabs.mjs +251 -0
- package/fesm2022/yukit-web-helm-tabs.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-textarea.mjs +32 -0
- package/fesm2022/yukit-web-helm-textarea.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-toggle-group.mjs +95 -0
- package/fesm2022/yukit-web-helm-toggle-group.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-toggle.mjs +61 -0
- package/fesm2022/yukit-web-helm-toggle.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-tooltip.mjs +57 -0
- package/fesm2022/yukit-web-helm-tooltip.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-typography.mjs +205 -0
- package/fesm2022/yukit-web-helm-typography.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-utils.mjs +272 -0
- package/fesm2022/yukit-web-helm-utils.mjs.map +1 -0
- package/fesm2022/yukit-web.mjs +3592 -0
- package/fesm2022/yukit-web.mjs.map +1 -0
- package/package.json +291 -0
- package/src/lib/theme/spartan-overwrites/accordion.css +4 -0
- package/src/lib/theme/theme.css +161 -0
- package/src/lib/theme/tokens/color.css +356 -0
- package/src/lib/theme/tokens/component-colors.css +167 -0
- package/src/lib/theme/tokens/radius.css +18 -0
- package/src/lib/theme/tokens/typography.css +201 -0
- package/types/yukit-web-helm-accordion.d.ts +32 -0
- package/types/yukit-web-helm-alert-dialog.d.ts +85 -0
- package/types/yukit-web-helm-alert.d.ts +37 -0
- package/types/yukit-web-helm-aspect-ratio.d.ts +16 -0
- package/types/yukit-web-helm-attachment.d.ts +80 -0
- package/types/yukit-web-helm-autocomplete.d.ts +91 -0
- package/types/yukit-web-helm-avatar.d.ts +45 -0
- package/types/yukit-web-helm-badge.d.ts +19 -0
- package/types/yukit-web-helm-breadcrumb.d.ts +52 -0
- package/types/yukit-web-helm-bubble.d.ts +46 -0
- package/types/yukit-web-helm-button-group.d.ts +25 -0
- package/types/yukit-web-helm-button.d.ts +33 -0
- package/types/yukit-web-helm-calendar.d.ts +89 -0
- package/types/yukit-web-helm-card.d.ts +49 -0
- package/types/yukit-web-helm-carousel.d.ts +79 -0
- package/types/yukit-web-helm-checkbox.d.ts +60 -0
- package/types/yukit-web-helm-collapsible.d.ts +22 -0
- package/types/yukit-web-helm-combobox.d.ts +150 -0
- package/types/yukit-web-helm-command.d.ts +84 -0
- package/types/yukit-web-helm-context-menu.d.ts +29 -0
- package/types/yukit-web-helm-date-picker.d.ts +574 -0
- package/types/yukit-web-helm-dialog.d.ts +90 -0
- package/types/yukit-web-helm-drawer.d.ts +71 -0
- package/types/yukit-web-helm-dropdown-menu.d.ts +171 -0
- package/types/yukit-web-helm-empty.d.ts +49 -0
- package/types/yukit-web-helm-field.d.ts +102 -0
- package/types/yukit-web-helm-hover-card.d.ts +31 -0
- package/types/yukit-web-helm-input-group.d.ts +47 -0
- package/types/yukit-web-helm-input-otp.d.ts +40 -0
- package/types/yukit-web-helm-input.d.ts +13 -0
- package/types/yukit-web-helm-item.d.ts +96 -0
- package/types/yukit-web-helm-kbd.d.ts +17 -0
- package/types/yukit-web-helm-label.d.ts +12 -0
- package/types/yukit-web-helm-marker.d.ts +31 -0
- package/types/yukit-web-helm-menubar.d.ts +35 -0
- package/types/yukit-web-helm-message.d.ts +44 -0
- package/types/yukit-web-helm-native-select.d.ts +65 -0
- package/types/yukit-web-helm-navigation-menu.d.ts +49 -0
- package/types/yukit-web-helm-pagination.d.ts +187 -0
- package/types/yukit-web-helm-popover.d.ts +49 -0
- package/types/yukit-web-helm-progress.d.ts +22 -0
- package/types/yukit-web-helm-radio-group.d.ts +66 -0
- package/types/yukit-web-helm-resizable.d.ts +27 -0
- package/types/yukit-web-helm-scroll-area.d.ts +11 -0
- package/types/yukit-web-helm-select.d.ts +114 -0
- package/types/yukit-web-helm-separator.d.ts +13 -0
- package/types/yukit-web-helm-sheet.d.ts +75 -0
- package/types/yukit-web-helm-sidebar.d.ts +232 -0
- package/types/yukit-web-helm-skeleton.d.ts +11 -0
- package/types/yukit-web-helm-slider.d.ts +14 -0
- package/types/yukit-web-helm-sonner.d.ts +52 -0
- package/types/yukit-web-helm-spinner.d.ts +18 -0
- package/types/yukit-web-helm-switch.d.ts +54 -0
- package/types/yukit-web-helm-table.d.ts +82 -0
- package/types/yukit-web-helm-tabs.d.ts +66 -0
- package/types/yukit-web-helm-textarea.d.ts +13 -0
- package/types/yukit-web-helm-toggle-group.d.ts +34 -0
- package/types/yukit-web-helm-toggle.d.ts +22 -0
- package/types/yukit-web-helm-tooltip.d.ts +17 -0
- package/types/yukit-web-helm-typography.d.ts +89 -0
- package/types/yukit-web-helm-utils.d.ts +44 -0
- package/types/yukit-web.d.ts +2426 -0
|
@@ -0,0 +1,857 @@
|
|
|
1
|
+
import { isPlatformServer, NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { InjectionToken, inject, PLATFORM_ID, REQUEST, DOCUMENT, signal, computed, DestroyRef, afterNextRender, Injectable, input, effect, ChangeDetectionStrategy, Component, Directive, booleanAttribute } from '@angular/core';
|
|
4
|
+
import * as i1 from 'yukit-web/helm/sheet';
|
|
5
|
+
import { HlmSheetImports } from 'yukit-web/helm/sheet';
|
|
6
|
+
import { hlm, classes } from 'yukit-web/helm/utils';
|
|
7
|
+
import * as i1$1 from 'yukit-web/helm/input';
|
|
8
|
+
import { HlmInput } from 'yukit-web/helm/input';
|
|
9
|
+
import * as i1$2 from '@spartan-ng/brain/tooltip';
|
|
10
|
+
import { BrnTooltip, provideBrnTooltipDefaultOptions } from '@spartan-ng/brain/tooltip';
|
|
11
|
+
import { tooltipPositionVariants, DEFAULT_TOOLTIP_SVG_CLASS, DEFAULT_TOOLTIP_CONTENT_CLASSES } from 'yukit-web/helm/tooltip';
|
|
12
|
+
import { cva } from 'class-variance-authority';
|
|
13
|
+
import * as i1$3 from 'yukit-web/helm/skeleton';
|
|
14
|
+
import { HlmSkeletonImports } from 'yukit-web/helm/skeleton';
|
|
15
|
+
import * as i1$4 from 'yukit-web/helm/separator';
|
|
16
|
+
import { HlmSeparator } from 'yukit-web/helm/separator';
|
|
17
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
18
|
+
import { lucidePanelLeft } from '@ng-icons/lucide';
|
|
19
|
+
import * as i1$5 from 'yukit-web/helm/button';
|
|
20
|
+
import { provideBrnButtonConfig, HlmButton } from 'yukit-web/helm/button';
|
|
21
|
+
|
|
22
|
+
const defaultConfig = {
|
|
23
|
+
sidebarWidth: '16rem',
|
|
24
|
+
sidebarWidthMobile: '18rem',
|
|
25
|
+
sidebarWidthIcon: '3rem',
|
|
26
|
+
sidebarCookieName: 'sidebar_state',
|
|
27
|
+
sidebarCookieMaxAge: 60 * 60 * 24 * 7, // 7 days in seconds
|
|
28
|
+
sidebarKeyboardShortcut: 'b',
|
|
29
|
+
mobileBreakpoint: '768px',
|
|
30
|
+
closeMobileSidebarOnMenuButtonClick: false,
|
|
31
|
+
};
|
|
32
|
+
const HlmSidebarConfigToken = new InjectionToken('HlmSidebarConfig');
|
|
33
|
+
function provideHlmSidebarConfig(config) {
|
|
34
|
+
return { provide: HlmSidebarConfigToken, useValue: { ...defaultConfig, ...config } };
|
|
35
|
+
}
|
|
36
|
+
function injectHlmSidebarConfig() {
|
|
37
|
+
return inject(HlmSidebarConfigToken, { optional: true }) ?? defaultConfig;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
class HlmSidebarService {
|
|
41
|
+
constructor() {
|
|
42
|
+
this._platformId = inject(PLATFORM_ID);
|
|
43
|
+
this._request = inject(REQUEST, { optional: true });
|
|
44
|
+
this._config = injectHlmSidebarConfig();
|
|
45
|
+
this._document = inject(DOCUMENT);
|
|
46
|
+
this._window = this._document.defaultView;
|
|
47
|
+
this._open = signal(true, ...(ngDevMode ? [{ debugName: "_open" }] : /* istanbul ignore next */ []));
|
|
48
|
+
this._openMobile = signal(false, ...(ngDevMode ? [{ debugName: "_openMobile" }] : /* istanbul ignore next */ []));
|
|
49
|
+
this._isMobile = signal(false, ...(ngDevMode ? [{ debugName: "_isMobile" }] : /* istanbul ignore next */ []));
|
|
50
|
+
this._variant = signal('sidebar', ...(ngDevMode ? [{ debugName: "_variant" }] : /* istanbul ignore next */ []));
|
|
51
|
+
this._mediaQuery = null;
|
|
52
|
+
this.open = this._open.asReadonly();
|
|
53
|
+
this.openMobile = this._openMobile.asReadonly();
|
|
54
|
+
this.isMobile = this._isMobile.asReadonly();
|
|
55
|
+
this.variant = this._variant.asReadonly();
|
|
56
|
+
this.state = computed(() => (this._open() ? 'expanded' : 'collapsed'), ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
57
|
+
const destroyRef = inject(DestroyRef);
|
|
58
|
+
this.restoreStateFromCookie();
|
|
59
|
+
afterNextRender(() => {
|
|
60
|
+
if (!this._window || typeof this._window.matchMedia !== 'function')
|
|
61
|
+
return;
|
|
62
|
+
// Initialize MediaQueryList
|
|
63
|
+
this._mediaQuery = this._window.matchMedia(`(max-width: ${this._config.mobileBreakpoint})`);
|
|
64
|
+
this._isMobile.set(this._mediaQuery.matches);
|
|
65
|
+
// Add media query listener
|
|
66
|
+
const mediaQueryHandler = (e) => {
|
|
67
|
+
this._isMobile.set(e.matches);
|
|
68
|
+
// If switching from mobile to desktop, close mobile sidebar
|
|
69
|
+
if (!e.matches)
|
|
70
|
+
this._openMobile.set(false);
|
|
71
|
+
};
|
|
72
|
+
this._mediaQuery.addEventListener('change', mediaQueryHandler);
|
|
73
|
+
// Add keyboard shortcut listener
|
|
74
|
+
const keydownHandler = (event) => {
|
|
75
|
+
if (event.key === this._config.sidebarKeyboardShortcut && (event.ctrlKey || event.metaKey)) {
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
this.toggleSidebar();
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
this._window.addEventListener('keydown', keydownHandler);
|
|
81
|
+
// Add resize listener with debounce
|
|
82
|
+
let resizeTimeout;
|
|
83
|
+
const resizeHandler = () => {
|
|
84
|
+
if (!this._window)
|
|
85
|
+
return;
|
|
86
|
+
if (resizeTimeout)
|
|
87
|
+
this._window.clearTimeout(resizeTimeout);
|
|
88
|
+
resizeTimeout = this._window.setTimeout(() => {
|
|
89
|
+
if (this._mediaQuery)
|
|
90
|
+
this._isMobile.set(this._mediaQuery.matches);
|
|
91
|
+
}, 100);
|
|
92
|
+
};
|
|
93
|
+
this._window.addEventListener('resize', resizeHandler);
|
|
94
|
+
// Cleanup listeners on destroy
|
|
95
|
+
destroyRef.onDestroy(() => {
|
|
96
|
+
if (!this._window)
|
|
97
|
+
return;
|
|
98
|
+
if (this._mediaQuery)
|
|
99
|
+
this._mediaQuery.removeEventListener('change', mediaQueryHandler);
|
|
100
|
+
this._window.removeEventListener('keydown', keydownHandler);
|
|
101
|
+
this._window.removeEventListener('resize', resizeHandler);
|
|
102
|
+
if (resizeTimeout)
|
|
103
|
+
this._window.clearTimeout(resizeTimeout);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
setOpen(open) {
|
|
108
|
+
this._open.set(open);
|
|
109
|
+
this._document.cookie = `${this._config.sidebarCookieName}=${open}; path=/; max-age=${this._config.sidebarCookieMaxAge}`;
|
|
110
|
+
}
|
|
111
|
+
setOpenMobile(open) {
|
|
112
|
+
if (this._isMobile()) {
|
|
113
|
+
this._openMobile.set(open);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
setVariant(variant) {
|
|
117
|
+
this._variant.set(variant);
|
|
118
|
+
}
|
|
119
|
+
toggleSidebar() {
|
|
120
|
+
if (this._isMobile()) {
|
|
121
|
+
this._openMobile.update((value) => !value);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
this.setOpen(!this._open());
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
restoreStateFromCookie() {
|
|
128
|
+
const cookieString = isPlatformServer(this._platformId)
|
|
129
|
+
? this._request?.headers.get('cookie')
|
|
130
|
+
: this._document.cookie;
|
|
131
|
+
if (!cookieString)
|
|
132
|
+
return;
|
|
133
|
+
const prefix = `${this._config.sidebarCookieName}=`;
|
|
134
|
+
const cookieValue = cookieString
|
|
135
|
+
.split(';')
|
|
136
|
+
.map((c) => c.trim())
|
|
137
|
+
.find((c) => c.startsWith(prefix))
|
|
138
|
+
?.slice(prefix.length);
|
|
139
|
+
if (cookieValue !== undefined) {
|
|
140
|
+
this._open.set(cookieValue === 'true');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
144
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarService, providedIn: 'root' }); }
|
|
145
|
+
}
|
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarService, decorators: [{
|
|
147
|
+
type: Injectable,
|
|
148
|
+
args: [{ providedIn: 'root' }]
|
|
149
|
+
}], ctorParameters: () => [] });
|
|
150
|
+
|
|
151
|
+
class HlmSidebar {
|
|
152
|
+
constructor() {
|
|
153
|
+
this._sidebarService = inject(HlmSidebarService);
|
|
154
|
+
this._config = injectHlmSidebarConfig();
|
|
155
|
+
this.sidebarWidthMobile = input(this._config.sidebarWidthMobile, ...(ngDevMode ? [{ debugName: "sidebarWidthMobile" }] : /* istanbul ignore next */ []));
|
|
156
|
+
this.side = input('left', ...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
|
|
157
|
+
this.variant = input(this._sidebarService.variant(), ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
158
|
+
this.collapsible = input('offcanvas', ...(ngDevMode ? [{ debugName: "collapsible" }] : /* istanbul ignore next */ []));
|
|
159
|
+
this._sidebarGapComputedClass = computed(() => hlm('transition-[width] duration-200 ease-linear relative w-(--sidebar-width) bg-transparent', 'group-data-[collapsible=offcanvas]:w-0', 'group-data-[side=right]:rotate-180', this.variant() === 'floating' || this.variant() === 'inset'
|
|
160
|
+
? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]'
|
|
161
|
+
: 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)'), ...(ngDevMode ? [{ debugName: "_sidebarGapComputedClass" }] : /* istanbul ignore next */ []));
|
|
162
|
+
this.sidebarContainerClass = input('', ...(ngDevMode ? [{ debugName: "sidebarContainerClass" }] : /* istanbul ignore next */ []));
|
|
163
|
+
this._sidebarContainerComputedClass = computed(() => hlm('fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex', this.variant() === 'floating' || this.variant() === 'inset'
|
|
164
|
+
? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]'
|
|
165
|
+
: 'group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l', this.sidebarContainerClass()), ...(ngDevMode ? [{ debugName: "_sidebarContainerComputedClass" }] : /* istanbul ignore next */ []));
|
|
166
|
+
this._dataSlot = computed(() => {
|
|
167
|
+
return !this._sidebarService.isMobile() ? 'sidebar' : undefined;
|
|
168
|
+
}, ...(ngDevMode ? [{ debugName: "_dataSlot" }] : /* istanbul ignore next */ []));
|
|
169
|
+
this._collapsibleAndNonMobile = computed(() => {
|
|
170
|
+
return this.collapsible() !== 'none' && !this._sidebarService.isMobile();
|
|
171
|
+
}, ...(ngDevMode ? [{ debugName: "_collapsibleAndNonMobile" }] : /* istanbul ignore next */ []));
|
|
172
|
+
this._dataState = computed(() => {
|
|
173
|
+
return this._collapsibleAndNonMobile() ? this._sidebarService.state() : undefined;
|
|
174
|
+
}, ...(ngDevMode ? [{ debugName: "_dataState" }] : /* istanbul ignore next */ []));
|
|
175
|
+
this._dataCollapsible = computed(() => {
|
|
176
|
+
if (this._collapsibleAndNonMobile()) {
|
|
177
|
+
return this._sidebarService.state() === 'collapsed' ? this.collapsible() : '';
|
|
178
|
+
}
|
|
179
|
+
return undefined;
|
|
180
|
+
}, ...(ngDevMode ? [{ debugName: "_dataCollapsible" }] : /* istanbul ignore next */ []));
|
|
181
|
+
this._dataVariant = computed(() => {
|
|
182
|
+
return this._collapsibleAndNonMobile() ? this.variant() : undefined;
|
|
183
|
+
}, ...(ngDevMode ? [{ debugName: "_dataVariant" }] : /* istanbul ignore next */ []));
|
|
184
|
+
this._dataSide = computed(() => {
|
|
185
|
+
return this._collapsibleAndNonMobile() ? this.side() : undefined;
|
|
186
|
+
}, ...(ngDevMode ? [{ debugName: "_dataSide" }] : /* istanbul ignore next */ []));
|
|
187
|
+
// Sync variant input with service
|
|
188
|
+
effect(() => {
|
|
189
|
+
this._sidebarService.setVariant(this.variant());
|
|
190
|
+
});
|
|
191
|
+
classes(() => {
|
|
192
|
+
if (this.collapsible() === 'none') {
|
|
193
|
+
return hlm('bg-sidebar text-sidebar-foreground flex h-svh w-(--sidebar-width) flex-col');
|
|
194
|
+
}
|
|
195
|
+
else if (this._sidebarService.isMobile()) {
|
|
196
|
+
return '';
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
return hlm('group peer text-sidebar-foreground hidden md:block');
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
204
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: HlmSidebar, isStandalone: true, selector: "hlm-sidebar", inputs: { sidebarWidthMobile: { classPropertyName: "sidebarWidthMobile", publicName: "sidebarWidthMobile", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, sidebarContainerClass: { classPropertyName: "sidebarContainerClass", publicName: "sidebarContainerClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-slot": "_dataSlot()", "attr.data-state": "_dataState()", "attr.data-collapsible": "_dataCollapsible()", "attr.data-variant": "_dataVariant()", "attr.data-side": "_dataSide()" } }, ngImport: i0, template: `
|
|
205
|
+
<ng-template #contentContainer>
|
|
206
|
+
<ng-content />
|
|
207
|
+
</ng-template>
|
|
208
|
+
|
|
209
|
+
@if (collapsible() === 'none') {
|
|
210
|
+
<ng-container *ngTemplateOutlet="contentContainer"></ng-container>
|
|
211
|
+
} @else if (_sidebarService.isMobile()) {
|
|
212
|
+
<hlm-sheet
|
|
213
|
+
[side]="side()"
|
|
214
|
+
[state]="_sidebarService.openMobile() ? 'open' : 'closed'"
|
|
215
|
+
(stateChanged)="_sidebarService.setOpenMobile($event === 'open')"
|
|
216
|
+
>
|
|
217
|
+
<hlm-sheet-content
|
|
218
|
+
*hlmSheetPortal="let ctx"
|
|
219
|
+
data-slot="sidebar"
|
|
220
|
+
data-sidebar="sidebar"
|
|
221
|
+
data-mobile="true"
|
|
222
|
+
class="bg-sidebar text-sidebar-foreground h-svh w-(--sidebar-width) p-0 [&>button]:hidden"
|
|
223
|
+
[style.--sidebar-width]="sidebarWidthMobile()"
|
|
224
|
+
>
|
|
225
|
+
<div class="flex h-full w-full flex-col">
|
|
226
|
+
<ng-container *ngTemplateOutlet="contentContainer" />
|
|
227
|
+
</div>
|
|
228
|
+
</hlm-sheet-content>
|
|
229
|
+
</hlm-sheet>
|
|
230
|
+
} @else {
|
|
231
|
+
<!-- Sidebar gap on desktop -->
|
|
232
|
+
<div data-slot="sidebar-gap" [class]="_sidebarGapComputedClass()"></div>
|
|
233
|
+
<div data-slot="sidebar-container" [attr.data-side]="_dataSide()" [class]="_sidebarContainerComputedClass()">
|
|
234
|
+
<div data-sidebar="sidebar" data-slot="sidebar-inner" class="bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col">
|
|
235
|
+
<ng-container *ngTemplateOutlet="contentContainer" />
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
}
|
|
239
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i1.HlmSheet, selector: "hlm-sheet", exportAs: ["hlmSheet"] }, { kind: "component", type: i1.HlmSheetContent, selector: "hlm-sheet-content", inputs: ["showCloseButton"] }, { kind: "directive", type: i1.HlmSheetPortal, selector: "[hlmSheetPortal]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
240
|
+
}
|
|
241
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebar, decorators: [{
|
|
242
|
+
type: Component,
|
|
243
|
+
args: [{
|
|
244
|
+
selector: 'hlm-sidebar',
|
|
245
|
+
imports: [NgTemplateOutlet, HlmSheetImports],
|
|
246
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
247
|
+
host: {
|
|
248
|
+
'[attr.data-slot]': '_dataSlot()',
|
|
249
|
+
'[attr.data-state]': '_dataState()',
|
|
250
|
+
'[attr.data-collapsible]': '_dataCollapsible()',
|
|
251
|
+
'[attr.data-variant]': '_dataVariant()',
|
|
252
|
+
'[attr.data-side]': '_dataSide()',
|
|
253
|
+
},
|
|
254
|
+
template: `
|
|
255
|
+
<ng-template #contentContainer>
|
|
256
|
+
<ng-content />
|
|
257
|
+
</ng-template>
|
|
258
|
+
|
|
259
|
+
@if (collapsible() === 'none') {
|
|
260
|
+
<ng-container *ngTemplateOutlet="contentContainer"></ng-container>
|
|
261
|
+
} @else if (_sidebarService.isMobile()) {
|
|
262
|
+
<hlm-sheet
|
|
263
|
+
[side]="side()"
|
|
264
|
+
[state]="_sidebarService.openMobile() ? 'open' : 'closed'"
|
|
265
|
+
(stateChanged)="_sidebarService.setOpenMobile($event === 'open')"
|
|
266
|
+
>
|
|
267
|
+
<hlm-sheet-content
|
|
268
|
+
*hlmSheetPortal="let ctx"
|
|
269
|
+
data-slot="sidebar"
|
|
270
|
+
data-sidebar="sidebar"
|
|
271
|
+
data-mobile="true"
|
|
272
|
+
class="bg-sidebar text-sidebar-foreground h-svh w-(--sidebar-width) p-0 [&>button]:hidden"
|
|
273
|
+
[style.--sidebar-width]="sidebarWidthMobile()"
|
|
274
|
+
>
|
|
275
|
+
<div class="flex h-full w-full flex-col">
|
|
276
|
+
<ng-container *ngTemplateOutlet="contentContainer" />
|
|
277
|
+
</div>
|
|
278
|
+
</hlm-sheet-content>
|
|
279
|
+
</hlm-sheet>
|
|
280
|
+
} @else {
|
|
281
|
+
<!-- Sidebar gap on desktop -->
|
|
282
|
+
<div data-slot="sidebar-gap" [class]="_sidebarGapComputedClass()"></div>
|
|
283
|
+
<div data-slot="sidebar-container" [attr.data-side]="_dataSide()" [class]="_sidebarContainerComputedClass()">
|
|
284
|
+
<div data-sidebar="sidebar" data-slot="sidebar-inner" class="bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col">
|
|
285
|
+
<ng-container *ngTemplateOutlet="contentContainer" />
|
|
286
|
+
</div>
|
|
287
|
+
</div>
|
|
288
|
+
}
|
|
289
|
+
`,
|
|
290
|
+
}]
|
|
291
|
+
}], ctorParameters: () => [], propDecorators: { sidebarWidthMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebarWidthMobile", required: false }] }], side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }], sidebarContainerClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebarContainerClass", required: false }] }] } });
|
|
292
|
+
|
|
293
|
+
class HlmSidebarContent {
|
|
294
|
+
constructor() {
|
|
295
|
+
classes(() => 'no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden');
|
|
296
|
+
}
|
|
297
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
298
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarContent, isStandalone: true, selector: "[hlmSidebarContent],hlm-sidebar-content", host: { attributes: { "data-slot": "sidebar-content", "data-sidebar": "content" } }, ngImport: i0 }); }
|
|
299
|
+
}
|
|
300
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarContent, decorators: [{
|
|
301
|
+
type: Directive,
|
|
302
|
+
args: [{
|
|
303
|
+
selector: '[hlmSidebarContent],hlm-sidebar-content',
|
|
304
|
+
host: {
|
|
305
|
+
'data-slot': 'sidebar-content',
|
|
306
|
+
'data-sidebar': 'content',
|
|
307
|
+
},
|
|
308
|
+
}]
|
|
309
|
+
}], ctorParameters: () => [] });
|
|
310
|
+
|
|
311
|
+
class HlmSidebarFooter {
|
|
312
|
+
constructor() {
|
|
313
|
+
classes(() => 'gap-2 p-2 flex flex-col');
|
|
314
|
+
}
|
|
315
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarFooter, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
316
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarFooter, isStandalone: true, selector: "[hlmSidebarFooter],hlm-sidebar-footer", host: { attributes: { "data-slot": "sidebar-footer", "data-sidebar": "footer" } }, ngImport: i0 }); }
|
|
317
|
+
}
|
|
318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarFooter, decorators: [{
|
|
319
|
+
type: Directive,
|
|
320
|
+
args: [{
|
|
321
|
+
selector: '[hlmSidebarFooter],hlm-sidebar-footer',
|
|
322
|
+
host: {
|
|
323
|
+
'data-slot': 'sidebar-footer',
|
|
324
|
+
'data-sidebar': 'footer',
|
|
325
|
+
},
|
|
326
|
+
}]
|
|
327
|
+
}], ctorParameters: () => [] });
|
|
328
|
+
|
|
329
|
+
class HlmSidebarGroup {
|
|
330
|
+
constructor() {
|
|
331
|
+
classes(() => 'p-2 relative flex w-full min-w-0 flex-col');
|
|
332
|
+
}
|
|
333
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
334
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarGroup, isStandalone: true, selector: "[hlmSidebarGroup],hlm-sidebar-group", host: { attributes: { "data-slot": "sidebar-group", "data-sidebar": "group" } }, ngImport: i0 }); }
|
|
335
|
+
}
|
|
336
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarGroup, decorators: [{
|
|
337
|
+
type: Directive,
|
|
338
|
+
args: [{
|
|
339
|
+
selector: '[hlmSidebarGroup],hlm-sidebar-group',
|
|
340
|
+
host: {
|
|
341
|
+
'data-slot': 'sidebar-group',
|
|
342
|
+
'data-sidebar': 'group',
|
|
343
|
+
},
|
|
344
|
+
}]
|
|
345
|
+
}], ctorParameters: () => [] });
|
|
346
|
+
|
|
347
|
+
class HlmSidebarGroupAction {
|
|
348
|
+
constructor() {
|
|
349
|
+
classes(() => 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute end-3 top-3.5 w-5 rounded-md p-0 focus-visible:ring-2 [&>ng-icon]:text-[length:--spacing(4)] flex aspect-square items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>ng-icon]:shrink-0');
|
|
350
|
+
}
|
|
351
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarGroupAction, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
352
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarGroupAction, isStandalone: true, selector: "button[hlmSidebarGroupAction]", host: { attributes: { "data-slot": "sidebar-group-action", "data-sidebar": "group-action" } }, ngImport: i0 }); }
|
|
353
|
+
}
|
|
354
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarGroupAction, decorators: [{
|
|
355
|
+
type: Directive,
|
|
356
|
+
args: [{
|
|
357
|
+
selector: 'button[hlmSidebarGroupAction]',
|
|
358
|
+
host: {
|
|
359
|
+
'data-slot': 'sidebar-group-action',
|
|
360
|
+
'data-sidebar': 'group-action',
|
|
361
|
+
},
|
|
362
|
+
}]
|
|
363
|
+
}], ctorParameters: () => [] });
|
|
364
|
+
|
|
365
|
+
class HlmSidebarGroupContent {
|
|
366
|
+
constructor() {
|
|
367
|
+
classes(() => 'text-sm w-full');
|
|
368
|
+
}
|
|
369
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarGroupContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
370
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarGroupContent, isStandalone: true, selector: "div[hlmSidebarGroupContent]", host: { attributes: { "data-slot": "sidebar-group-content", "data-sidebar": "group-content" } }, ngImport: i0 }); }
|
|
371
|
+
}
|
|
372
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarGroupContent, decorators: [{
|
|
373
|
+
type: Directive,
|
|
374
|
+
args: [{
|
|
375
|
+
selector: 'div[hlmSidebarGroupContent]',
|
|
376
|
+
host: {
|
|
377
|
+
'data-slot': 'sidebar-group-content',
|
|
378
|
+
'data-sidebar': 'group-content',
|
|
379
|
+
},
|
|
380
|
+
}]
|
|
381
|
+
}], ctorParameters: () => [] });
|
|
382
|
+
|
|
383
|
+
class HlmSidebarGroupLabel {
|
|
384
|
+
constructor() {
|
|
385
|
+
classes(() => 'text-sidebar-foreground/70 ring-sidebar-ring h-8 rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>ng-icon]:text-[length:--spacing(4)] flex shrink-0 items-center outline-hidden [&>ng-icon]:shrink-0');
|
|
386
|
+
}
|
|
387
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarGroupLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
388
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarGroupLabel, isStandalone: true, selector: "div[hlmSidebarGroupLabel], button[hlmSidebarGroupLabel]", host: { attributes: { "data-slot": "sidebar-group-label", "data-sidebar": "group-label" } }, ngImport: i0 }); }
|
|
389
|
+
}
|
|
390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarGroupLabel, decorators: [{
|
|
391
|
+
type: Directive,
|
|
392
|
+
args: [{
|
|
393
|
+
selector: 'div[hlmSidebarGroupLabel], button[hlmSidebarGroupLabel]',
|
|
394
|
+
host: {
|
|
395
|
+
'data-slot': 'sidebar-group-label',
|
|
396
|
+
'data-sidebar': 'group-label',
|
|
397
|
+
},
|
|
398
|
+
}]
|
|
399
|
+
}], ctorParameters: () => [] });
|
|
400
|
+
|
|
401
|
+
class HlmSidebarHeader {
|
|
402
|
+
constructor() {
|
|
403
|
+
classes(() => 'gap-2 p-2 flex flex-col');
|
|
404
|
+
}
|
|
405
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarHeader, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
406
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarHeader, isStandalone: true, selector: "[hlmSidebarHeader],hlm-sidebar-header", host: { attributes: { "data-slot": "sidebar-header", "data-sidebar": "header" } }, ngImport: i0 }); }
|
|
407
|
+
}
|
|
408
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarHeader, decorators: [{
|
|
409
|
+
type: Directive,
|
|
410
|
+
args: [{
|
|
411
|
+
selector: '[hlmSidebarHeader],hlm-sidebar-header',
|
|
412
|
+
host: {
|
|
413
|
+
'data-slot': 'sidebar-header',
|
|
414
|
+
'data-sidebar': 'header',
|
|
415
|
+
},
|
|
416
|
+
}]
|
|
417
|
+
}], ctorParameters: () => [] });
|
|
418
|
+
|
|
419
|
+
class HlmSidebarInput {
|
|
420
|
+
constructor() {
|
|
421
|
+
classes(() => 'bg-background h-8 w-full shadow-none');
|
|
422
|
+
}
|
|
423
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
424
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarInput, isStandalone: true, selector: "input[hlmSidebarInput]", host: { attributes: { "data-slot": "sidebar-input", "data-sidebar": "input" } }, hostDirectives: [{ directive: i1$1.HlmInput }], ngImport: i0 }); }
|
|
425
|
+
}
|
|
426
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarInput, decorators: [{
|
|
427
|
+
type: Directive,
|
|
428
|
+
args: [{
|
|
429
|
+
selector: 'input[hlmSidebarInput]',
|
|
430
|
+
hostDirectives: [HlmInput],
|
|
431
|
+
host: {
|
|
432
|
+
'data-slot': 'sidebar-input',
|
|
433
|
+
'data-sidebar': 'input',
|
|
434
|
+
},
|
|
435
|
+
}]
|
|
436
|
+
}], ctorParameters: () => [] });
|
|
437
|
+
|
|
438
|
+
class HlmSidebarInset {
|
|
439
|
+
constructor() {
|
|
440
|
+
classes(() => 'bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2 relative flex w-full flex-1 flex-col');
|
|
441
|
+
}
|
|
442
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarInset, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
443
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarInset, isStandalone: true, selector: "main[hlmSidebarInset]", host: { attributes: { "data-slot": "sidebar-inset" } }, ngImport: i0 }); }
|
|
444
|
+
}
|
|
445
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarInset, decorators: [{
|
|
446
|
+
type: Directive,
|
|
447
|
+
args: [{
|
|
448
|
+
selector: 'main[hlmSidebarInset]',
|
|
449
|
+
host: { 'data-slot': 'sidebar-inset' },
|
|
450
|
+
}]
|
|
451
|
+
}], ctorParameters: () => [] });
|
|
452
|
+
|
|
453
|
+
class HlmSidebarMenu {
|
|
454
|
+
constructor() {
|
|
455
|
+
classes(() => 'gap-0 flex w-full min-w-0 flex-col');
|
|
456
|
+
}
|
|
457
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
458
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarMenu, isStandalone: true, selector: "ul[hlmSidebarMenu]", host: { attributes: { "data-slot": "sidebar-menu", "data-sidebar": "menu" } }, ngImport: i0 }); }
|
|
459
|
+
}
|
|
460
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenu, decorators: [{
|
|
461
|
+
type: Directive,
|
|
462
|
+
args: [{
|
|
463
|
+
selector: 'ul[hlmSidebarMenu]',
|
|
464
|
+
host: {
|
|
465
|
+
'data-slot': 'sidebar-menu',
|
|
466
|
+
'data-sidebar': 'menu',
|
|
467
|
+
},
|
|
468
|
+
}]
|
|
469
|
+
}], ctorParameters: () => [] });
|
|
470
|
+
|
|
471
|
+
class HlmSidebarMenuAction {
|
|
472
|
+
constructor() {
|
|
473
|
+
this.showOnHover = input(false, { ...(ngDevMode ? { debugName: "showOnHover" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
474
|
+
classes(() => [
|
|
475
|
+
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute end-1 top-1.5 aspect-square w-5 rounded-md p-0 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 focus-visible:ring-2 [&>ng-icon]:text-[length:--spacing(4)] flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>ng-icon]:shrink-0',
|
|
476
|
+
this.showOnHover() &&
|
|
477
|
+
'peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0',
|
|
478
|
+
]);
|
|
479
|
+
}
|
|
480
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuAction, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
481
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: HlmSidebarMenuAction, isStandalone: true, selector: "button[hlmSidebarMenuAction]", inputs: { showOnHover: { classPropertyName: "showOnHover", publicName: "showOnHover", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-menu-action", "data-sidebar": "menu-action" } }, ngImport: i0 }); }
|
|
482
|
+
}
|
|
483
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuAction, decorators: [{
|
|
484
|
+
type: Directive,
|
|
485
|
+
args: [{
|
|
486
|
+
selector: 'button[hlmSidebarMenuAction]',
|
|
487
|
+
host: {
|
|
488
|
+
'data-slot': 'sidebar-menu-action',
|
|
489
|
+
'data-sidebar': 'menu-action',
|
|
490
|
+
},
|
|
491
|
+
}]
|
|
492
|
+
}], ctorParameters: () => [], propDecorators: { showOnHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOnHover", required: false }] }] } });
|
|
493
|
+
|
|
494
|
+
class HlmSidebarMenuBadge {
|
|
495
|
+
constructor() {
|
|
496
|
+
classes(() => 'text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute end-1 h-5 min-w-5 rounded-md px-1 text-xs font-medium peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 flex items-center justify-center tabular-nums select-none group-data-[collapsible=icon]:hidden');
|
|
497
|
+
}
|
|
498
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuBadge, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
499
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarMenuBadge, isStandalone: true, selector: "[hlmSidebarMenuBadge],hlm-sidebar-menu-badge", host: { attributes: { "data-slot": "sidebar-menu-badge", "data-sidebar": "menu-badge" } }, ngImport: i0 }); }
|
|
500
|
+
}
|
|
501
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuBadge, decorators: [{
|
|
502
|
+
type: Directive,
|
|
503
|
+
args: [{
|
|
504
|
+
selector: '[hlmSidebarMenuBadge],hlm-sidebar-menu-badge',
|
|
505
|
+
host: {
|
|
506
|
+
'data-slot': 'sidebar-menu-badge',
|
|
507
|
+
'data-sidebar': 'menu-badge',
|
|
508
|
+
},
|
|
509
|
+
}]
|
|
510
|
+
}], ctorParameters: () => [] });
|
|
511
|
+
|
|
512
|
+
const sidebarMenuButtonVariants = cva('ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-start text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button group/menu-button flex w-full items-center overflow-hidden outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_ng-icon]:shrink-0 [&_ng-icon]:text-[length:--spacing(4)] [&>span:last-child]:truncate', {
|
|
513
|
+
variants: {
|
|
514
|
+
variant: {
|
|
515
|
+
default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
|
516
|
+
outline: 'bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_var(--sidebar-border)] hover:shadow-[0_0_0_1px_var(--sidebar-accent)]',
|
|
517
|
+
},
|
|
518
|
+
size: {
|
|
519
|
+
default: 'h-8 text-sm',
|
|
520
|
+
sm: 'h-7 text-xs',
|
|
521
|
+
lg: 'h-12 text-sm group-data-[collapsible=icon]:p-0!',
|
|
522
|
+
},
|
|
523
|
+
},
|
|
524
|
+
defaultVariants: {
|
|
525
|
+
variant: 'default',
|
|
526
|
+
size: 'default',
|
|
527
|
+
},
|
|
528
|
+
});
|
|
529
|
+
class HlmSidebarMenuButton {
|
|
530
|
+
constructor() {
|
|
531
|
+
this._config = injectHlmSidebarConfig();
|
|
532
|
+
this._sidebarService = inject(HlmSidebarService);
|
|
533
|
+
this._brnTooltip = inject(BrnTooltip);
|
|
534
|
+
this.variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
535
|
+
this.size = input('default', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
536
|
+
this.isActive = input(false, { ...(ngDevMode ? { debugName: "isActive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
537
|
+
this.closeMobileSidebarOnClick = input(this._config.closeMobileSidebarOnMenuButtonClick, { ...(ngDevMode ? { debugName: "closeMobileSidebarOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
538
|
+
this._isTooltipHidden = computed(() => this._sidebarService.state() !== 'collapsed' || this._sidebarService.isMobile(), ...(ngDevMode ? [{ debugName: "_isTooltipHidden" }] : /* istanbul ignore next */ []));
|
|
539
|
+
classes(() => sidebarMenuButtonVariants({ variant: this.variant(), size: this.size() }));
|
|
540
|
+
effect(() => this._brnTooltip.mutableTooltipDisabled.set(this._isTooltipHidden()));
|
|
541
|
+
}
|
|
542
|
+
onClick() {
|
|
543
|
+
if (this.closeMobileSidebarOnClick()) {
|
|
544
|
+
this._sidebarService.setOpenMobile(false);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
548
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: HlmSidebarMenuButton, isStandalone: true, selector: "button[hlmSidebarMenuButton], a[hlmSidebarMenuButton]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, isActive: { classPropertyName: "isActive", publicName: "isActive", isSignal: true, isRequired: false, transformFunction: null }, closeMobileSidebarOnClick: { classPropertyName: "closeMobileSidebarOnClick", publicName: "closeMobileSidebarOnClick", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-menu-button", "data-sidebar": "menu-button" }, listeners: { "click": "onClick()" }, properties: { "attr.data-size": "size()", "attr.data-active": "isActive()" } }, providers: [
|
|
549
|
+
provideBrnTooltipDefaultOptions({
|
|
550
|
+
showDelay: 150,
|
|
551
|
+
hideDelay: 0,
|
|
552
|
+
tooltipContentClasses: DEFAULT_TOOLTIP_CONTENT_CLASSES,
|
|
553
|
+
svgClasses: DEFAULT_TOOLTIP_SVG_CLASS,
|
|
554
|
+
arrowClasses: (position) => hlm(tooltipPositionVariants({ position })),
|
|
555
|
+
position: 'right',
|
|
556
|
+
}),
|
|
557
|
+
], hostDirectives: [{ directive: i1$2.BrnTooltip, inputs: ["brnTooltip", "tooltip"] }], ngImport: i0 }); }
|
|
558
|
+
}
|
|
559
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuButton, decorators: [{
|
|
560
|
+
type: Directive,
|
|
561
|
+
args: [{
|
|
562
|
+
selector: 'button[hlmSidebarMenuButton], a[hlmSidebarMenuButton]',
|
|
563
|
+
providers: [
|
|
564
|
+
provideBrnTooltipDefaultOptions({
|
|
565
|
+
showDelay: 150,
|
|
566
|
+
hideDelay: 0,
|
|
567
|
+
tooltipContentClasses: DEFAULT_TOOLTIP_CONTENT_CLASSES,
|
|
568
|
+
svgClasses: DEFAULT_TOOLTIP_SVG_CLASS,
|
|
569
|
+
arrowClasses: (position) => hlm(tooltipPositionVariants({ position })),
|
|
570
|
+
position: 'right',
|
|
571
|
+
}),
|
|
572
|
+
],
|
|
573
|
+
hostDirectives: [
|
|
574
|
+
{
|
|
575
|
+
directive: BrnTooltip,
|
|
576
|
+
inputs: ['brnTooltip: tooltip'],
|
|
577
|
+
},
|
|
578
|
+
],
|
|
579
|
+
host: {
|
|
580
|
+
'data-slot': 'sidebar-menu-button',
|
|
581
|
+
'data-sidebar': 'menu-button',
|
|
582
|
+
'[attr.data-size]': 'size()',
|
|
583
|
+
'[attr.data-active]': 'isActive()',
|
|
584
|
+
'(click)': 'onClick()',
|
|
585
|
+
},
|
|
586
|
+
}]
|
|
587
|
+
}], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], isActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "isActive", required: false }] }], closeMobileSidebarOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeMobileSidebarOnClick", required: false }] }] } });
|
|
588
|
+
|
|
589
|
+
class HlmSidebarMenuItem {
|
|
590
|
+
constructor() {
|
|
591
|
+
classes(() => 'group/menu-item relative');
|
|
592
|
+
}
|
|
593
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
594
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarMenuItem, isStandalone: true, selector: "li[hlmSidebarMenuItem]", host: { attributes: { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item" } }, ngImport: i0 }); }
|
|
595
|
+
}
|
|
596
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuItem, decorators: [{
|
|
597
|
+
type: Directive,
|
|
598
|
+
args: [{
|
|
599
|
+
selector: 'li[hlmSidebarMenuItem]',
|
|
600
|
+
host: {
|
|
601
|
+
'data-slot': 'sidebar-menu-item',
|
|
602
|
+
'data-sidebar': 'menu-item',
|
|
603
|
+
},
|
|
604
|
+
}]
|
|
605
|
+
}], ctorParameters: () => [] });
|
|
606
|
+
|
|
607
|
+
class HlmSidebarMenuSkeleton {
|
|
608
|
+
constructor() {
|
|
609
|
+
this.showIcon = input(false, { ...(ngDevMode ? { debugName: "showIcon" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
610
|
+
this._width = `${Math.floor(Math.random() * 40) + 50}%`;
|
|
611
|
+
classes(() => 'h-8 gap-2 rounded-md px-2 flex items-center');
|
|
612
|
+
}
|
|
613
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuSkeleton, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
614
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: HlmSidebarMenuSkeleton, isStandalone: true, selector: "hlm-sidebar-menu-skeleton,div[hlmSidebarMenuSkeleton]", inputs: { showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-menu-skeleton", "data-sidebar": "menu-skeleton" } }, ngImport: i0, template: `
|
|
615
|
+
@if (showIcon()) {
|
|
616
|
+
<hlm-skeleton data-sidebar="menu-skeleton-icon" class="size-4 rounded-md" />
|
|
617
|
+
} @else {
|
|
618
|
+
<hlm-skeleton
|
|
619
|
+
data-sidebar="menu-skeleton-text"
|
|
620
|
+
class="h-4 max-w-(--skeleton-width) flex-1"
|
|
621
|
+
[style.--skeleton-width]="_width"
|
|
622
|
+
/>
|
|
623
|
+
}
|
|
624
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1$3.HlmSkeleton, selector: "[hlmSkeleton],hlm-skeleton" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
625
|
+
}
|
|
626
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuSkeleton, decorators: [{
|
|
627
|
+
type: Component,
|
|
628
|
+
args: [{
|
|
629
|
+
selector: 'hlm-sidebar-menu-skeleton,div[hlmSidebarMenuSkeleton]',
|
|
630
|
+
imports: [HlmSkeletonImports],
|
|
631
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
632
|
+
host: {
|
|
633
|
+
'data-slot': 'sidebar-menu-skeleton',
|
|
634
|
+
'data-sidebar': 'menu-skeleton',
|
|
635
|
+
},
|
|
636
|
+
template: `
|
|
637
|
+
@if (showIcon()) {
|
|
638
|
+
<hlm-skeleton data-sidebar="menu-skeleton-icon" class="size-4 rounded-md" />
|
|
639
|
+
} @else {
|
|
640
|
+
<hlm-skeleton
|
|
641
|
+
data-sidebar="menu-skeleton-text"
|
|
642
|
+
class="h-4 max-w-(--skeleton-width) flex-1"
|
|
643
|
+
[style.--skeleton-width]="_width"
|
|
644
|
+
/>
|
|
645
|
+
}
|
|
646
|
+
`,
|
|
647
|
+
}]
|
|
648
|
+
}], ctorParameters: () => [], propDecorators: { showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }] } });
|
|
649
|
+
|
|
650
|
+
class HlmSidebarMenuSub {
|
|
651
|
+
constructor() {
|
|
652
|
+
classes(() => 'border-sidebar-border mx-3.5 translate-x-px gap-1 border-s px-2.5 py-0.5 group-data-[collapsible=icon]:hidden rtl:-translate-x-px flex min-w-0 flex-col');
|
|
653
|
+
}
|
|
654
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuSub, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
655
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarMenuSub, isStandalone: true, selector: "ul[hlmSidebarMenuSub]", host: { attributes: { "data-slot": "sidebar-menu-sub", "data-sidebar": "menu-sub" } }, ngImport: i0 }); }
|
|
656
|
+
}
|
|
657
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuSub, decorators: [{
|
|
658
|
+
type: Directive,
|
|
659
|
+
args: [{
|
|
660
|
+
selector: 'ul[hlmSidebarMenuSub]',
|
|
661
|
+
host: {
|
|
662
|
+
'data-slot': 'sidebar-menu-sub',
|
|
663
|
+
'data-sidebar': 'menu-sub',
|
|
664
|
+
},
|
|
665
|
+
}]
|
|
666
|
+
}], ctorParameters: () => [] });
|
|
667
|
+
|
|
668
|
+
class HlmSidebarMenuSubButton {
|
|
669
|
+
constructor() {
|
|
670
|
+
this._sidebarService = inject(HlmSidebarService);
|
|
671
|
+
this._config = injectHlmSidebarConfig();
|
|
672
|
+
this.closeMobileSidebarOnClick = input(this._config.closeMobileSidebarOnMenuButtonClick, { ...(ngDevMode ? { debugName: "closeMobileSidebarOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
673
|
+
this.size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
674
|
+
this.isActive = input(false, { ...(ngDevMode ? { debugName: "isActive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
675
|
+
classes(() => 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-sm data-[size=sm]:text-xs [&>ng-icon]:text-[length:--spacing(4)] flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>ng-icon]:shrink-0 [&>span:last-child]:truncate');
|
|
676
|
+
}
|
|
677
|
+
onClick() {
|
|
678
|
+
if (this.closeMobileSidebarOnClick()) {
|
|
679
|
+
this._sidebarService.setOpenMobile(false);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuSubButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
683
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: HlmSidebarMenuSubButton, isStandalone: true, selector: "a[hlmSidebarMenuSubButton], button[hlmSidebarMenuSubButton]", inputs: { closeMobileSidebarOnClick: { classPropertyName: "closeMobileSidebarOnClick", publicName: "closeMobileSidebarOnClick", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, isActive: { classPropertyName: "isActive", publicName: "isActive", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-menu-sub-button", "data-sidebar": "menu-sub-button" }, listeners: { "click": "onClick()" }, properties: { "attr.data-active": "isActive()", "attr.data-size": "size()" } }, ngImport: i0 }); }
|
|
684
|
+
}
|
|
685
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuSubButton, decorators: [{
|
|
686
|
+
type: Directive,
|
|
687
|
+
args: [{
|
|
688
|
+
selector: 'a[hlmSidebarMenuSubButton], button[hlmSidebarMenuSubButton]',
|
|
689
|
+
host: {
|
|
690
|
+
'data-slot': 'sidebar-menu-sub-button',
|
|
691
|
+
'data-sidebar': 'menu-sub-button',
|
|
692
|
+
'[attr.data-active]': 'isActive()',
|
|
693
|
+
'[attr.data-size]': 'size()',
|
|
694
|
+
'(click)': 'onClick()',
|
|
695
|
+
},
|
|
696
|
+
}]
|
|
697
|
+
}], ctorParameters: () => [], propDecorators: { closeMobileSidebarOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeMobileSidebarOnClick", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], isActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "isActive", required: false }] }] } });
|
|
698
|
+
|
|
699
|
+
class HlmSidebarMenuSubItem {
|
|
700
|
+
constructor() {
|
|
701
|
+
classes(() => 'group/menu-sub-item relative');
|
|
702
|
+
}
|
|
703
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuSubItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
704
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarMenuSubItem, isStandalone: true, selector: "li[hlmSidebarMenuSubItem]", host: { attributes: { "data-slot": "sidebar-menu-sub-item", "data-sidebar": "menu-sub-item" } }, ngImport: i0 }); }
|
|
705
|
+
}
|
|
706
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarMenuSubItem, decorators: [{
|
|
707
|
+
type: Directive,
|
|
708
|
+
args: [{
|
|
709
|
+
selector: 'li[hlmSidebarMenuSubItem]',
|
|
710
|
+
host: {
|
|
711
|
+
'data-slot': 'sidebar-menu-sub-item',
|
|
712
|
+
'data-sidebar': 'menu-sub-item',
|
|
713
|
+
},
|
|
714
|
+
}]
|
|
715
|
+
}], ctorParameters: () => [] });
|
|
716
|
+
|
|
717
|
+
class HlmSidebarRail {
|
|
718
|
+
constructor() {
|
|
719
|
+
this._sidebarService = inject(HlmSidebarService);
|
|
720
|
+
this.ariaLabel = input('Toggle Sidebar', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
721
|
+
classes(() => [
|
|
722
|
+
'hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2',
|
|
723
|
+
'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',
|
|
724
|
+
'[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',
|
|
725
|
+
'hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full',
|
|
726
|
+
'[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',
|
|
727
|
+
'[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',
|
|
728
|
+
]);
|
|
729
|
+
}
|
|
730
|
+
onClick() {
|
|
731
|
+
this._sidebarService.toggleSidebar();
|
|
732
|
+
}
|
|
733
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarRail, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
734
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: HlmSidebarRail, isStandalone: true, selector: "button[hlmSidebarRail]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-sidebar": "rail", "data-slot": "sidebar-rail", "tabindex": "-1" }, listeners: { "click": "onClick()" }, properties: { "attr.aria-label": "ariaLabel()" } }, ngImport: i0 }); }
|
|
735
|
+
}
|
|
736
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarRail, decorators: [{
|
|
737
|
+
type: Directive,
|
|
738
|
+
args: [{
|
|
739
|
+
selector: 'button[hlmSidebarRail]',
|
|
740
|
+
host: {
|
|
741
|
+
'data-sidebar': 'rail',
|
|
742
|
+
'data-slot': 'sidebar-rail',
|
|
743
|
+
'[attr.aria-label]': 'ariaLabel()',
|
|
744
|
+
tabindex: '-1',
|
|
745
|
+
'(click)': 'onClick()',
|
|
746
|
+
},
|
|
747
|
+
}]
|
|
748
|
+
}], ctorParameters: () => [], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }] } });
|
|
749
|
+
|
|
750
|
+
class HlmSidebarSeparator {
|
|
751
|
+
constructor() {
|
|
752
|
+
classes(() => 'bg-sidebar-border mx-2 w-auto');
|
|
753
|
+
}
|
|
754
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarSeparator, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
755
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmSidebarSeparator, isStandalone: true, selector: "[hlmSidebarSeparator],hlm-sidebar-separator", host: { attributes: { "data-slot": "sidebar-separator", "data-sidebar": "separator" } }, hostDirectives: [{ directive: i1$4.HlmSeparator }], ngImport: i0 }); }
|
|
756
|
+
}
|
|
757
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarSeparator, decorators: [{
|
|
758
|
+
type: Directive,
|
|
759
|
+
args: [{
|
|
760
|
+
selector: '[hlmSidebarSeparator],hlm-sidebar-separator',
|
|
761
|
+
hostDirectives: [HlmSeparator],
|
|
762
|
+
host: {
|
|
763
|
+
'data-slot': 'sidebar-separator',
|
|
764
|
+
'data-sidebar': 'separator',
|
|
765
|
+
},
|
|
766
|
+
}]
|
|
767
|
+
}], ctorParameters: () => [] });
|
|
768
|
+
|
|
769
|
+
class HlmSidebarTrigger {
|
|
770
|
+
constructor() {
|
|
771
|
+
this._sidebarService = inject(HlmSidebarService);
|
|
772
|
+
this.srOnlyText = input('Toggle Sidebar', ...(ngDevMode ? [{ debugName: "srOnlyText" }] : /* istanbul ignore next */ []));
|
|
773
|
+
}
|
|
774
|
+
_onClick() {
|
|
775
|
+
this._sidebarService.toggleSidebar();
|
|
776
|
+
}
|
|
777
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarTrigger, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
778
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: HlmSidebarTrigger, isStandalone: true, selector: "button[hlmSidebarTrigger]", inputs: { srOnlyText: { classPropertyName: "srOnlyText", publicName: "srOnlyText", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-trigger", "data-sidebar": "trigger" }, listeners: { "click": "_onClick()" } }, providers: [provideIcons({ lucidePanelLeft }), provideBrnButtonConfig({ variant: 'ghost', size: 'icon-sm' })], hostDirectives: [{ directive: i1$5.HlmButton, inputs: ["variant", "variant", "size", "size"] }], ngImport: i0, template: `
|
|
779
|
+
<ng-icon name="lucidePanelLeft" />
|
|
780
|
+
<span class="sr-only">{{ srOnlyText() }}</span>
|
|
781
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
782
|
+
}
|
|
783
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarTrigger, decorators: [{
|
|
784
|
+
type: Component,
|
|
785
|
+
args: [{
|
|
786
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
787
|
+
selector: 'button[hlmSidebarTrigger]',
|
|
788
|
+
imports: [NgIcon],
|
|
789
|
+
providers: [provideIcons({ lucidePanelLeft }), provideBrnButtonConfig({ variant: 'ghost', size: 'icon-sm' })],
|
|
790
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
791
|
+
hostDirectives: [{ directive: HlmButton, inputs: ['variant', 'size'] }],
|
|
792
|
+
host: {
|
|
793
|
+
'data-slot': 'sidebar-trigger',
|
|
794
|
+
'data-sidebar': 'trigger',
|
|
795
|
+
'(click)': '_onClick()',
|
|
796
|
+
},
|
|
797
|
+
template: `
|
|
798
|
+
<ng-icon name="lucidePanelLeft" />
|
|
799
|
+
<span class="sr-only">{{ srOnlyText() }}</span>
|
|
800
|
+
`,
|
|
801
|
+
}]
|
|
802
|
+
}], propDecorators: { srOnlyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "srOnlyText", required: false }] }] } });
|
|
803
|
+
|
|
804
|
+
class HlmSidebarWrapper {
|
|
805
|
+
constructor() {
|
|
806
|
+
this._config = injectHlmSidebarConfig();
|
|
807
|
+
this.sidebarWidth = input(this._config.sidebarWidth, ...(ngDevMode ? [{ debugName: "sidebarWidth" }] : /* istanbul ignore next */ []));
|
|
808
|
+
this.sidebarWidthIcon = input(this._config.sidebarWidthIcon, ...(ngDevMode ? [{ debugName: "sidebarWidthIcon" }] : /* istanbul ignore next */ []));
|
|
809
|
+
classes(() => 'group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full');
|
|
810
|
+
}
|
|
811
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarWrapper, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
812
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: HlmSidebarWrapper, isStandalone: true, selector: "[hlmSidebarWrapper],hlm-sidebar-wrapper", inputs: { sidebarWidth: { classPropertyName: "sidebarWidth", publicName: "sidebarWidth", isSignal: true, isRequired: false, transformFunction: null }, sidebarWidthIcon: { classPropertyName: "sidebarWidthIcon", publicName: "sidebarWidthIcon", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-wrapper" }, properties: { "style.--sidebar-width": "sidebarWidth()", "style.--sidebar-width-icon": "sidebarWidthIcon()" } }, ngImport: i0 }); }
|
|
813
|
+
}
|
|
814
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmSidebarWrapper, decorators: [{
|
|
815
|
+
type: Directive,
|
|
816
|
+
args: [{
|
|
817
|
+
selector: '[hlmSidebarWrapper],hlm-sidebar-wrapper',
|
|
818
|
+
host: {
|
|
819
|
+
'data-slot': 'sidebar-wrapper',
|
|
820
|
+
'[style.--sidebar-width]': 'sidebarWidth()',
|
|
821
|
+
'[style.--sidebar-width-icon]': 'sidebarWidthIcon()',
|
|
822
|
+
},
|
|
823
|
+
}]
|
|
824
|
+
}], ctorParameters: () => [], propDecorators: { sidebarWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebarWidth", required: false }] }], sidebarWidthIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebarWidthIcon", required: false }] }] } });
|
|
825
|
+
|
|
826
|
+
const HlmSidebarImports = [
|
|
827
|
+
HlmSidebar,
|
|
828
|
+
HlmSidebarContent,
|
|
829
|
+
HlmSidebarFooter,
|
|
830
|
+
HlmSidebarGroup,
|
|
831
|
+
HlmSidebarGroupAction,
|
|
832
|
+
HlmSidebarGroupContent,
|
|
833
|
+
HlmSidebarGroupLabel,
|
|
834
|
+
HlmSidebarHeader,
|
|
835
|
+
HlmSidebarInput,
|
|
836
|
+
HlmSidebarInset,
|
|
837
|
+
HlmSidebarMenu,
|
|
838
|
+
HlmSidebarMenuSkeleton,
|
|
839
|
+
HlmSidebarMenuAction,
|
|
840
|
+
HlmSidebarMenuBadge,
|
|
841
|
+
HlmSidebarMenuButton,
|
|
842
|
+
HlmSidebarMenuItem,
|
|
843
|
+
HlmSidebarMenuSub,
|
|
844
|
+
HlmSidebarMenuSubButton,
|
|
845
|
+
HlmSidebarRail,
|
|
846
|
+
HlmSidebarSeparator,
|
|
847
|
+
HlmSidebarTrigger,
|
|
848
|
+
HlmSidebarWrapper,
|
|
849
|
+
HlmSidebarMenuSubItem,
|
|
850
|
+
];
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* Generated bundle index. Do not edit.
|
|
854
|
+
*/
|
|
855
|
+
|
|
856
|
+
export { HlmSidebar, HlmSidebarContent, HlmSidebarFooter, HlmSidebarGroup, HlmSidebarGroupAction, HlmSidebarGroupContent, HlmSidebarGroupLabel, HlmSidebarHeader, HlmSidebarImports, HlmSidebarInput, HlmSidebarInset, HlmSidebarMenu, HlmSidebarMenuAction, HlmSidebarMenuBadge, HlmSidebarMenuButton, HlmSidebarMenuItem, HlmSidebarMenuSkeleton, HlmSidebarMenuSub, HlmSidebarMenuSubButton, HlmSidebarMenuSubItem, HlmSidebarRail, HlmSidebarSeparator, HlmSidebarService, HlmSidebarTrigger, HlmSidebarWrapper, injectHlmSidebarConfig, provideHlmSidebarConfig };
|
|
857
|
+
//# sourceMappingURL=yukit-web-helm-sidebar.mjs.map
|