@semantic-components/ui 0.69.0 → 0.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/breadcrumb/breadcrumb-list.js +1 -1
- package/esm2022/lib/components/breadcrumb/breadcrumb-list.js.map +1 -1
- package/esm2022/lib/components/calendar/calendar-day-view.js +2 -2
- package/esm2022/lib/components/calendar/calendar-day-view.js.map +1 -1
- package/esm2022/lib/components/field/field-description.js +1 -1
- package/esm2022/lib/components/field/field-description.js.map +1 -1
- package/esm2022/lib/components/field/field-group.js +1 -1
- package/esm2022/lib/components/field/field-group.js.map +1 -1
- package/esm2022/lib/components/field/field.js +3 -3
- package/esm2022/lib/components/field/field.js.map +1 -1
- package/esm2022/lib/components/file-upload/file-upload-dropzone.js +1 -1
- package/esm2022/lib/components/file-upload/file-upload-dropzone.js.map +1 -1
- package/esm2022/lib/components/file-upload/file-upload-item-progress.js +2 -2
- package/esm2022/lib/components/file-upload/file-upload-item-progress.js.map +1 -1
- package/esm2022/lib/components/index.js +2 -0
- package/esm2022/lib/components/index.js.map +1 -1
- package/esm2022/lib/components/label/label.js +1 -1
- package/esm2022/lib/components/label/label.js.map +1 -1
- package/esm2022/lib/components/menu/menu-trigger.js +3 -7
- package/esm2022/lib/components/menu/menu-trigger.js.map +1 -1
- package/esm2022/lib/components/menu/menu.js +1 -1
- package/esm2022/lib/components/menu/menu.js.map +1 -1
- package/esm2022/lib/components/navigation-menu/navigation-menu-trigger-icon.js +1 -1
- package/esm2022/lib/components/navigation-menu/navigation-menu-trigger-icon.js.map +1 -1
- package/esm2022/lib/components/pagination/pagination.js +2 -2
- package/esm2022/lib/components/pagination/pagination.js.map +1 -1
- package/esm2022/lib/components/range-slider/range-slider-thumb-base.js +2 -2
- package/esm2022/lib/components/range-slider/range-slider-thumb-base.js.map +1 -1
- package/esm2022/lib/components/resizable/index.js +6 -0
- package/esm2022/lib/components/resizable/index.js.map +1 -0
- package/esm2022/lib/components/resizable/resizable-handle-indicator.js +20 -0
- package/esm2022/lib/components/resizable/resizable-handle-indicator.js.map +1 -0
- package/esm2022/lib/components/resizable/resizable-handle.js +116 -0
- package/esm2022/lib/components/resizable/resizable-handle.js.map +1 -0
- package/esm2022/lib/components/resizable/resizable-panel-group.js +38 -0
- package/esm2022/lib/components/resizable/resizable-panel-group.js.map +1 -0
- package/esm2022/lib/components/resizable/resizable-panel.js +39 -0
- package/esm2022/lib/components/resizable/resizable-panel.js.map +1 -0
- package/esm2022/lib/components/resizable/resizable.types.js +1 -0
- package/esm2022/lib/components/resizable/resizable.types.js.map +1 -0
- package/esm2022/lib/components/select/select-label.js +6 -5
- package/esm2022/lib/components/select/select-label.js.map +1 -1
- package/esm2022/lib/components/select/select-trigger.js +1 -1
- package/esm2022/lib/components/select/select-trigger.js.map +1 -1
- package/esm2022/lib/components/select/select.js +0 -2
- package/esm2022/lib/components/select/select.js.map +1 -1
- package/esm2022/lib/components/sidebar/index.js +28 -0
- package/esm2022/lib/components/sidebar/index.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-body.js +20 -0
- package/esm2022/lib/components/sidebar/sidebar-body.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-container.js +26 -0
- package/esm2022/lib/components/sidebar/sidebar-container.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-footer.js +20 -0
- package/esm2022/lib/components/sidebar/sidebar-footer.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-gap.js +23 -0
- package/esm2022/lib/components/sidebar/sidebar-gap.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-group-action.js +21 -0
- package/esm2022/lib/components/sidebar/sidebar-group-action.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-group-content.js +20 -0
- package/esm2022/lib/components/sidebar/sidebar-group-content.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-group-label.js +21 -0
- package/esm2022/lib/components/sidebar/sidebar-group-label.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-group.js +20 -0
- package/esm2022/lib/components/sidebar/sidebar-group.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-header.js +20 -0
- package/esm2022/lib/components/sidebar/sidebar-header.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-inner.js +20 -0
- package/esm2022/lib/components/sidebar/sidebar-inner.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-input.js +20 -0
- package/esm2022/lib/components/sidebar/sidebar-input.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-inset.js +20 -0
- package/esm2022/lib/components/sidebar/sidebar-inset.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-action.js +24 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-action.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-badge.js +20 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-badge.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-button.js +47 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-button.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-item.js +20 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-item.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-skeleton.js +45 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-skeleton.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-sub-button.js +31 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-sub-button.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-sub-item.js +20 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-sub-item.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-sub.js +20 -0
- package/esm2022/lib/components/sidebar/sidebar-menu-sub.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-menu.js +20 -0
- package/esm2022/lib/components/sidebar/sidebar-menu.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-provider.js +102 -0
- package/esm2022/lib/components/sidebar/sidebar-provider.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-rail.js +27 -0
- package/esm2022/lib/components/sidebar/sidebar-rail.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-separator.js +20 -0
- package/esm2022/lib/components/sidebar/sidebar-separator.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-state.js +32 -0
- package/esm2022/lib/components/sidebar/sidebar-state.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar-trigger.js +36 -0
- package/esm2022/lib/components/sidebar/sidebar-trigger.js.map +1 -0
- package/esm2022/lib/components/sidebar/sidebar.js +137 -0
- package/esm2022/lib/components/sidebar/sidebar.js.map +1 -0
- package/esm2022/lib/components/slider/slider.js +1 -1
- package/esm2022/lib/components/slider/slider.js.map +1 -1
- package/esm2022/lib/components/switch/switch-field.js +1 -1
- package/esm2022/lib/components/switch/switch-field.js.map +1 -1
- package/esm2022/lib/components/tabs/tab-panel.js +1 -1
- package/esm2022/lib/components/tabs/tab-panel.js.map +1 -1
- package/esm2022/lib/components/tooltip/tooltip.js +2 -10
- package/esm2022/lib/components/tooltip/tooltip.js.map +1 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/menu/menu-trigger.d.ts +1 -3
- package/lib/components/pagination/pagination.d.ts +1 -1
- package/lib/components/range-slider/range-slider-thumb-base.d.ts +1 -1
- package/lib/components/resizable/index.d.ts +5 -0
- package/lib/components/resizable/resizable-handle-indicator.d.ts +7 -0
- package/lib/components/resizable/resizable-handle.d.ts +18 -0
- package/lib/components/resizable/resizable-panel-group.d.ts +17 -0
- package/lib/components/resizable/resizable-panel.d.ts +16 -0
- package/lib/components/resizable/resizable.types.d.ts +1 -0
- package/lib/components/select/select-label.d.ts +3 -1
- package/lib/components/sidebar/index.d.ts +27 -0
- package/lib/components/sidebar/sidebar-body.d.ts +7 -0
- package/lib/components/sidebar/sidebar-container.d.ts +8 -0
- package/lib/components/sidebar/sidebar-footer.d.ts +7 -0
- package/lib/components/sidebar/sidebar-gap.d.ts +8 -0
- package/lib/components/sidebar/sidebar-group-action.d.ts +8 -0
- package/lib/components/sidebar/sidebar-group-content.d.ts +7 -0
- package/lib/components/sidebar/sidebar-group-label.d.ts +8 -0
- package/lib/components/sidebar/sidebar-group.d.ts +7 -0
- package/lib/components/sidebar/sidebar-header.d.ts +7 -0
- package/lib/components/sidebar/sidebar-inner.d.ts +7 -0
- package/lib/components/sidebar/sidebar-input.d.ts +7 -0
- package/lib/components/sidebar/sidebar-inset.d.ts +7 -0
- package/lib/components/sidebar/sidebar-menu-action.d.ts +9 -0
- package/lib/components/sidebar/sidebar-menu-badge.d.ts +7 -0
- package/lib/components/sidebar/sidebar-menu-button.d.ts +18 -0
- package/lib/components/sidebar/sidebar-menu-item.d.ts +7 -0
- package/lib/components/sidebar/sidebar-menu-skeleton.d.ts +9 -0
- package/lib/components/sidebar/sidebar-menu-sub-button.d.ts +9 -0
- package/lib/components/sidebar/sidebar-menu-sub-item.d.ts +7 -0
- package/lib/components/sidebar/sidebar-menu-sub.d.ts +7 -0
- package/lib/components/sidebar/sidebar-menu.d.ts +7 -0
- package/lib/components/sidebar/sidebar-provider.d.ts +19 -0
- package/lib/components/sidebar/sidebar-rail.d.ts +9 -0
- package/lib/components/sidebar/sidebar-separator.d.ts +7 -0
- package/lib/components/sidebar/sidebar-state.d.ts +14 -0
- package/lib/components/sidebar/sidebar-trigger.d.ts +12 -0
- package/lib/components/sidebar/sidebar.d.ts +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Component, computed, effect, inject, input, model, ViewEncapsulation, } from '@angular/core';
|
|
2
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
3
|
+
import { NavigationEnd, Router } from '@angular/router';
|
|
4
|
+
import { filter } from 'rxjs';
|
|
5
|
+
import { cn } from '../../utils';
|
|
6
|
+
import { ScSidebarState } from './sidebar-state';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
const SIDEBAR_STORAGE_KEY = 'sc-sidebar-state';
|
|
9
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = 'b';
|
|
10
|
+
const MOBILE_BREAKPOINT = 768;
|
|
11
|
+
export class ScSidebarProvider {
|
|
12
|
+
state = inject(ScSidebarState);
|
|
13
|
+
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
14
|
+
// Two-way binding support
|
|
15
|
+
open = model(true, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
16
|
+
class = computed(() => cn('group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
17
|
+
keydownHandler;
|
|
18
|
+
resizeHandler;
|
|
19
|
+
router = inject(Router);
|
|
20
|
+
constructor() {
|
|
21
|
+
// Sync model with state
|
|
22
|
+
effect(() => this.state.setOpen(this.open()));
|
|
23
|
+
effect(() => this.open.set(this.state.open()));
|
|
24
|
+
// Save to localStorage when state changes
|
|
25
|
+
effect(() => {
|
|
26
|
+
this.saveToStorage(this.state.open());
|
|
27
|
+
});
|
|
28
|
+
// Close mobile sidebar on navigation
|
|
29
|
+
this.router.events
|
|
30
|
+
.pipe(filter((event) => event instanceof NavigationEnd), filter(() => this.state.isMobile() && this.state.openMobile()), takeUntilDestroyed())
|
|
31
|
+
.subscribe(() => this.state.setOpenMobile(false));
|
|
32
|
+
}
|
|
33
|
+
ngOnInit() {
|
|
34
|
+
// Load initial state from localStorage
|
|
35
|
+
const savedState = this.loadFromStorage();
|
|
36
|
+
if (savedState !== null) {
|
|
37
|
+
this.open.set(savedState);
|
|
38
|
+
}
|
|
39
|
+
// Setup keyboard shortcut (Cmd/Ctrl + B)
|
|
40
|
+
this.keydownHandler = (event) => {
|
|
41
|
+
if ((event.metaKey || event.ctrlKey) &&
|
|
42
|
+
event.key === SIDEBAR_KEYBOARD_SHORTCUT) {
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
this.state.toggle();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
window.addEventListener('keydown', this.keydownHandler);
|
|
48
|
+
// Setup mobile detection
|
|
49
|
+
this.resizeHandler = () => {
|
|
50
|
+
const isMobile = window.innerWidth < MOBILE_BREAKPOINT;
|
|
51
|
+
this.state.setIsMobile(isMobile);
|
|
52
|
+
};
|
|
53
|
+
this.resizeHandler(); // Initial check
|
|
54
|
+
window.addEventListener('resize', this.resizeHandler);
|
|
55
|
+
}
|
|
56
|
+
ngOnDestroy() {
|
|
57
|
+
if (this.keydownHandler) {
|
|
58
|
+
window.removeEventListener('keydown', this.keydownHandler);
|
|
59
|
+
}
|
|
60
|
+
if (this.resizeHandler) {
|
|
61
|
+
window.removeEventListener('resize', this.resizeHandler);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
saveToStorage(open) {
|
|
65
|
+
try {
|
|
66
|
+
localStorage.setItem(SIDEBAR_STORAGE_KEY, String(open));
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
// localStorage unavailable
|
|
70
|
+
console.warn('Unable to save sidebar state to localStorage:', error);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
loadFromStorage() {
|
|
74
|
+
try {
|
|
75
|
+
const value = localStorage.getItem(SIDEBAR_STORAGE_KEY);
|
|
76
|
+
return value !== null ? value === 'true' : null;
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
console.warn('Unable to load sidebar state from localStorage:', error);
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarProvider, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
84
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: ScSidebarProvider, isStandalone: true, selector: "div[scSidebarProvider]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { attributes: { "data-slot": "sidebar-wrapper" }, properties: { "class": "class()", "style.--sidebar-width": "\"16rem\"", "style.--sidebar-width-mobile": "\"18rem\"", "style.--sidebar-width-icon": "\"3rem\"" } }, providers: [ScSidebarState], ngImport: i0, template: '<ng-content />', isInline: true, encapsulation: i0.ViewEncapsulation.None });
|
|
85
|
+
}
|
|
86
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarProvider, decorators: [{
|
|
87
|
+
type: Component,
|
|
88
|
+
args: [{
|
|
89
|
+
selector: 'div[scSidebarProvider]',
|
|
90
|
+
template: '<ng-content />',
|
|
91
|
+
providers: [ScSidebarState],
|
|
92
|
+
host: {
|
|
93
|
+
'data-slot': 'sidebar-wrapper',
|
|
94
|
+
'[class]': 'class()',
|
|
95
|
+
'[style.--sidebar-width]': '"16rem"',
|
|
96
|
+
'[style.--sidebar-width-mobile]': '"18rem"',
|
|
97
|
+
'[style.--sidebar-width-icon]': '"3rem"',
|
|
98
|
+
},
|
|
99
|
+
encapsulation: ViewEncapsulation.None,
|
|
100
|
+
}]
|
|
101
|
+
}], ctorParameters: () => [], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }] } });
|
|
102
|
+
//# sourceMappingURL=sidebar-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-provider.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/sidebar/sidebar-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,MAAM,EACN,MAAM,EACN,KAAK,EACL,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B;wBAC9B,SAAS,EAAE,SAAS;wBACpB,yBAAyB,EAAE,SAAS;wBACpC,gCAAgC,EAAE,SAAS;wBAC3C,8BAA8B,EAAE,QAAQ;qBACzC;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC","sourcesContent":["import {\n Component,\n computed,\n effect,\n inject,\n input,\n model,\n OnDestroy,\n OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { filter } from 'rxjs';\nimport { cn } from '../../utils';\nimport { ScSidebarState } from './sidebar-state';\n\nconst SIDEBAR_STORAGE_KEY = 'sc-sidebar-state';\nconst SIDEBAR_KEYBOARD_SHORTCUT = 'b';\nconst MOBILE_BREAKPOINT = 768;\n\n@Component({\n selector: 'div[scSidebarProvider]',\n template: '<ng-content />',\n providers: [ScSidebarState],\n host: {\n 'data-slot': 'sidebar-wrapper',\n '[class]': 'class()',\n '[style.--sidebar-width]': '\"16rem\"',\n '[style.--sidebar-width-mobile]': '\"18rem\"',\n '[style.--sidebar-width-icon]': '\"3rem\"',\n },\n encapsulation: ViewEncapsulation.None,\n})\nexport class ScSidebarProvider implements OnInit, OnDestroy {\n readonly state = inject(ScSidebarState);\n\n readonly classInput = input<string>('', { alias: 'class' });\n\n // Two-way binding support\n readonly open = model<boolean>(true);\n\n protected readonly class = computed(() =>\n cn(\n 'group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar',\n this.classInput(),\n ),\n );\n\n private keydownHandler?: (event: KeyboardEvent) => void;\n private resizeHandler?: () => void;\n\n private readonly router = inject(Router);\n\n constructor() {\n // Sync model with state\n effect(() => this.state.setOpen(this.open()));\n effect(() => this.open.set(this.state.open()));\n\n // Save to localStorage when state changes\n effect(() => {\n this.saveToStorage(this.state.open());\n });\n\n // Close mobile sidebar on navigation\n this.router.events\n .pipe(\n filter((event) => event instanceof NavigationEnd),\n filter(() => this.state.isMobile() && this.state.openMobile()),\n takeUntilDestroyed(),\n )\n .subscribe(() => this.state.setOpenMobile(false));\n }\n\n ngOnInit(): void {\n // Load initial state from localStorage\n const savedState = this.loadFromStorage();\n if (savedState !== null) {\n this.open.set(savedState);\n }\n\n // Setup keyboard shortcut (Cmd/Ctrl + B)\n this.keydownHandler = (event: KeyboardEvent) => {\n if (\n (event.metaKey || event.ctrlKey) &&\n event.key === SIDEBAR_KEYBOARD_SHORTCUT\n ) {\n event.preventDefault();\n this.state.toggle();\n }\n };\n window.addEventListener('keydown', this.keydownHandler);\n\n // Setup mobile detection\n this.resizeHandler = () => {\n const isMobile = window.innerWidth < MOBILE_BREAKPOINT;\n this.state.setIsMobile(isMobile);\n };\n this.resizeHandler(); // Initial check\n window.addEventListener('resize', this.resizeHandler);\n }\n\n ngOnDestroy(): void {\n if (this.keydownHandler) {\n window.removeEventListener('keydown', this.keydownHandler);\n }\n if (this.resizeHandler) {\n window.removeEventListener('resize', this.resizeHandler);\n }\n }\n\n private saveToStorage(open: boolean): void {\n try {\n localStorage.setItem(SIDEBAR_STORAGE_KEY, String(open));\n } catch (error) {\n // localStorage unavailable\n console.warn('Unable to save sidebar state to localStorage:', error);\n }\n }\n\n private loadFromStorage(): boolean | null {\n try {\n const value = localStorage.getItem(SIDEBAR_STORAGE_KEY);\n return value !== null ? value === 'true' : null;\n } catch (error) {\n console.warn('Unable to load sidebar state from localStorage:', error);\n return null;\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Component, computed, inject, input, ViewEncapsulation, } from '@angular/core';
|
|
2
|
+
import { cn } from '../../utils';
|
|
3
|
+
import { ScSidebarState } from './sidebar-state';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export class ScSidebarRail {
|
|
6
|
+
state = inject(ScSidebarState);
|
|
7
|
+
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
8
|
+
class = computed(() => cn('absolute inset-y-0 z-20 hidden w-4 ltr:-translate-x-1/2 rtl:-translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex', 'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize', '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize', 'group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar', '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2', '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
9
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarRail, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: ScSidebarRail, isStandalone: true, selector: "button[scSidebarRail]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-rail", "tabindex": "-1", "title": "Toggle Sidebar" }, listeners: { "click": "state.toggle()" }, properties: { "class": "class()" } }, ngImport: i0, template: '', isInline: true, encapsulation: i0.ViewEncapsulation.None });
|
|
11
|
+
}
|
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarRail, decorators: [{
|
|
13
|
+
type: Component,
|
|
14
|
+
args: [{
|
|
15
|
+
selector: 'button[scSidebarRail]',
|
|
16
|
+
template: '',
|
|
17
|
+
host: {
|
|
18
|
+
'data-slot': 'sidebar-rail',
|
|
19
|
+
'[class]': 'class()',
|
|
20
|
+
'(click)': 'state.toggle()',
|
|
21
|
+
tabindex: '-1',
|
|
22
|
+
title: 'Toggle Sidebar',
|
|
23
|
+
},
|
|
24
|
+
encapsulation: ViewEncapsulation.None,
|
|
25
|
+
}]
|
|
26
|
+
}], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
27
|
+
//# sourceMappingURL=sidebar-rail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-rail.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/sidebar/sidebar-rail.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;;AAcjD,MAAM,OAAO,aAAa;IACf,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;IAE/B,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,2QAA2Q,EAC3Q,0EAA0E,EAC1E,wHAAwH,EACxH,yJAAyJ,EACzJ,2DAA2D,EAC3D,2DAA2D,EAC3D,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;uGAfS,aAAa;2FAAb,aAAa,iZAVd,EAAE;;2FAUD,aAAa;kBAZzB,SAAS;mBAAC;oBACT,QAAQ,EAAE,uBAAuB;oBACjC,QAAQ,EAAE,EAAE;oBACZ,IAAI,EAAE;wBACJ,WAAW,EAAE,cAAc;wBAC3B,SAAS,EAAE,SAAS;wBACpB,SAAS,EAAE,gBAAgB;wBAC3B,QAAQ,EAAE,IAAI;wBACd,KAAK,EAAE,gBAAgB;qBACxB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC","sourcesContent":["import {\n Component,\n computed,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '../../utils';\nimport { ScSidebarState } from './sidebar-state';\n\n@Component({\n selector: 'button[scSidebarRail]',\n template: '',\n host: {\n 'data-slot': 'sidebar-rail',\n '[class]': 'class()',\n '(click)': 'state.toggle()',\n tabindex: '-1',\n title: 'Toggle Sidebar',\n },\n encapsulation: ViewEncapsulation.None,\n})\nexport class ScSidebarRail {\n readonly state = inject(ScSidebarState);\n\n readonly classInput = input<string>('', { alias: 'class' });\n\n protected readonly class = computed(() =>\n cn(\n 'absolute inset-y-0 z-20 hidden w-4 ltr:-translate-x-1/2 rtl:-translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex',\n 'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',\n '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',\n 'group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar',\n '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',\n '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',\n this.classInput(),\n ),\n );\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
|
+
import { cn } from '../../utils';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export class ScSidebarSeparator {
|
|
5
|
+
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
6
|
+
class = computed(() => cn('mx-2 w-auto bg-sidebar-border', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
7
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarSeparator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
8
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ScSidebarSeparator, isStandalone: true, selector: "div[scSidebarSeparator]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-separator" }, properties: { "class": "class()" } }, ngImport: i0 });
|
|
9
|
+
}
|
|
10
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarSeparator, decorators: [{
|
|
11
|
+
type: Directive,
|
|
12
|
+
args: [{
|
|
13
|
+
selector: 'div[scSidebarSeparator]',
|
|
14
|
+
host: {
|
|
15
|
+
'data-slot': 'sidebar-separator',
|
|
16
|
+
'[class]': 'class()',
|
|
17
|
+
},
|
|
18
|
+
}]
|
|
19
|
+
}], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
20
|
+
//# sourceMappingURL=sidebar-separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-separator.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/sidebar/sidebar-separator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;;AASjC,MAAM,OAAO,kBAAkB;IACpB,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CAAC,+BAA+B,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,iDACvD,CAAC;uGALS,kBAAkB;2FAAlB,kBAAkB;;2FAAlB,kBAAkB;kBAP9B,SAAS;mBAAC;oBACT,QAAQ,EAAE,yBAAyB;oBACnC,IAAI,EAAE;wBACJ,WAAW,EAAE,mBAAmB;wBAChC,SAAS,EAAE,SAAS;qBACrB;iBACF","sourcesContent":["import { Directive, computed, input } from '@angular/core';\nimport { cn } from '../../utils';\n\n@Directive({\n selector: 'div[scSidebarSeparator]',\n host: {\n 'data-slot': 'sidebar-separator',\n '[class]': 'class()',\n },\n})\nexport class ScSidebarSeparator {\n readonly classInput = input<string>('', { alias: 'class' });\n\n protected readonly class = computed(() =>\n cn('mx-2 w-auto bg-sidebar-border', this.classInput()),\n );\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Injectable, computed, signal } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export class ScSidebarState {
|
|
4
|
+
// Signals for reactive state
|
|
5
|
+
open = signal(true, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
6
|
+
openMobile = signal(false, ...(ngDevMode ? [{ debugName: "openMobile" }] : []));
|
|
7
|
+
isMobile = signal(false, ...(ngDevMode ? [{ debugName: "isMobile" }] : []));
|
|
8
|
+
// Computed state
|
|
9
|
+
state = computed(() => (this.open() ? 'expanded' : 'collapsed'), ...(ngDevMode ? [{ debugName: "state" }] : []));
|
|
10
|
+
// Methods
|
|
11
|
+
toggle() {
|
|
12
|
+
this.open.update((value) => !value);
|
|
13
|
+
}
|
|
14
|
+
toggleMobile() {
|
|
15
|
+
this.openMobile.update((value) => !value);
|
|
16
|
+
}
|
|
17
|
+
setOpen(value) {
|
|
18
|
+
this.open.set(value);
|
|
19
|
+
}
|
|
20
|
+
setOpenMobile(value) {
|
|
21
|
+
this.openMobile.set(value);
|
|
22
|
+
}
|
|
23
|
+
setIsMobile(value) {
|
|
24
|
+
this.isMobile.set(value);
|
|
25
|
+
}
|
|
26
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
27
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarState });
|
|
28
|
+
}
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarState, decorators: [{
|
|
30
|
+
type: Injectable
|
|
31
|
+
}] });
|
|
32
|
+
//# sourceMappingURL=sidebar-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-state.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/sidebar/sidebar-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;;AAG7D,MAAM,OAAO,cAAc;IACzB,6BAA6B;IACpB,IAAI,GAAG,MAAM,CAAC,IAAI,gDAAC,CAAC;IACpB,UAAU,GAAG,MAAM,CAAC,KAAK,sDAAC,CAAC;IAC3B,QAAQ,GAAG,MAAM,CAAC,KAAK,oDAAC,CAAC;IAElC,iBAAiB;IACR,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,iDAAC,CAAC;IAE1E,UAAU;IACV,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAED,YAAY;QACV,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,CAAC,KAAc;QACpB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,aAAa,CAAC,KAAc;QAC1B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,WAAW,CAAC,KAAc;QACxB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;uGA5BU,cAAc;2GAAd,cAAc;;2FAAd,cAAc;kBAD1B,UAAU","sourcesContent":["import { Injectable, computed, signal } from '@angular/core';\n\n@Injectable()\nexport class ScSidebarState {\n // Signals for reactive state\n readonly open = signal(true);\n readonly openMobile = signal(false);\n readonly isMobile = signal(false);\n\n // Computed state\n readonly state = computed(() => (this.open() ? 'expanded' : 'collapsed'));\n\n // Methods\n toggle(): void {\n this.open.update((value) => !value);\n }\n\n toggleMobile(): void {\n this.openMobile.update((value) => !value);\n }\n\n setOpen(value: boolean): void {\n this.open.set(value);\n }\n\n setOpenMobile(value: boolean): void {\n this.openMobile.set(value);\n }\n\n setIsMobile(value: boolean): void {\n this.isMobile.set(value);\n }\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Directive, computed, inject, input } from '@angular/core';
|
|
2
|
+
import { cn } from '../../utils';
|
|
3
|
+
import { buttonVariants } from '../button';
|
|
4
|
+
import { ScSidebarState } from './sidebar-state';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export class ScSidebarTrigger {
|
|
7
|
+
state = inject(ScSidebarState);
|
|
8
|
+
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
9
|
+
variant = input('ghost', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
10
|
+
size = input('icon-sm', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
11
|
+
class = computed(() => cn(buttonVariants({ variant: this.variant(), size: this.size() }), this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
12
|
+
onClick(event) {
|
|
13
|
+
event.preventDefault();
|
|
14
|
+
if (this.state.isMobile()) {
|
|
15
|
+
this.state.toggleMobile();
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this.state.toggle();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
22
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ScSidebarTrigger, isStandalone: true, selector: "button[scSidebarTrigger]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-trigger", "type": "button" }, listeners: { "click": "onClick($event)" }, properties: { "class": "class()" } }, ngImport: i0 });
|
|
23
|
+
}
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarTrigger, decorators: [{
|
|
25
|
+
type: Directive,
|
|
26
|
+
args: [{
|
|
27
|
+
selector: 'button[scSidebarTrigger]',
|
|
28
|
+
host: {
|
|
29
|
+
'data-slot': 'sidebar-trigger',
|
|
30
|
+
type: 'button',
|
|
31
|
+
'[class]': 'class()',
|
|
32
|
+
'(click)': 'onClick($event)',
|
|
33
|
+
},
|
|
34
|
+
}]
|
|
35
|
+
}], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
36
|
+
//# sourceMappingURL=sidebar-trigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-trigger.js","sourceRoot":"","sources":["../../../../../../../libs/ui/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AAE,iBAAiB;qBAC7B;iBACF","sourcesContent":["import { Directive, computed, inject, input } from '@angular/core';\nimport { cn } from '../../utils';\nimport { buttonVariants, ScButtonVariants } from '../button';\nimport { ScSidebarState } from './sidebar-state';\n\n@Directive({\n selector: 'button[scSidebarTrigger]',\n host: {\n 'data-slot': 'sidebar-trigger',\n type: 'button',\n '[class]': 'class()',\n '(click)': 'onClick($event)',\n },\n})\nexport class ScSidebarTrigger {\n readonly state = inject(ScSidebarState);\n\n readonly classInput = input<string>('', { alias: 'class' });\n\n readonly variant = input<ScButtonVariants['variant']>('ghost');\n readonly size = input<ScButtonVariants['size']>('icon-sm');\n\n protected readonly class = computed(() =>\n cn(\n buttonVariants({ variant: this.variant(), size: this.size() }),\n this.classInput(),\n ),\n );\n\n protected onClick(event: MouseEvent): void {\n event.preventDefault();\n if (this.state.isMobile()) {\n this.state.toggleMobile();\n } else {\n this.state.toggle();\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import { Component, computed, inject, input, ViewEncapsulation, } from '@angular/core';
|
|
3
|
+
import { SiXIcon } from '@semantic-icons/lucide-icons';
|
|
4
|
+
import { ScSheet, ScSheetClose, ScSheetPortal, ScSheetProvider, } from '../sheet';
|
|
5
|
+
import { ScSidebarContainer } from './sidebar-container';
|
|
6
|
+
import { ScSidebarGap } from './sidebar-gap';
|
|
7
|
+
import { ScSidebarInner } from './sidebar-inner';
|
|
8
|
+
import { ScSidebarState } from './sidebar-state';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export class ScSidebar {
|
|
11
|
+
state = inject(ScSidebarState);
|
|
12
|
+
side = input('left', ...(ngDevMode ? [{ debugName: "side" }] : []));
|
|
13
|
+
variant = input('sidebar', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
14
|
+
collapsible = input('offcanvas', ...(ngDevMode ? [{ debugName: "collapsible" }] : []));
|
|
15
|
+
isMobile = computed(() => this.state.isMobile(), ...(ngDevMode ? [{ debugName: "isMobile" }] : []));
|
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
17
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ScSidebar, isStandalone: true, selector: "div[scSidebar]", inputs: { 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 } }, host: { attributes: { "data-slot": "sidebar" }, properties: { "attr.data-state": "state.state()", "attr.data-variant": "variant()", "attr.data-side": "side()", "attr.data-collapsible": "collapsible()" } }, ngImport: i0, template: `
|
|
18
|
+
<ng-template #content>
|
|
19
|
+
<ng-content />
|
|
20
|
+
</ng-template>
|
|
21
|
+
|
|
22
|
+
<!-- Mobile sidebar uses default width from sheet component -->
|
|
23
|
+
@if (isMobile()) {
|
|
24
|
+
<div scSheetProvider [(open)]="state.openMobile" [side]="side()">
|
|
25
|
+
<ng-template scSheetPortal>
|
|
26
|
+
<div
|
|
27
|
+
scSheet
|
|
28
|
+
class="bg-sidebar text-sidebar-foreground flex h-full flex-col p-0"
|
|
29
|
+
>
|
|
30
|
+
<button scSheetClose>
|
|
31
|
+
<svg siXIcon></svg>
|
|
32
|
+
<span class="sr-only">Close</span>
|
|
33
|
+
</button>
|
|
34
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
35
|
+
</div>
|
|
36
|
+
</ng-template>
|
|
37
|
+
</div>
|
|
38
|
+
} @else if (collapsible() === 'none') {
|
|
39
|
+
<div
|
|
40
|
+
scSidebarInner
|
|
41
|
+
class="bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col"
|
|
42
|
+
>
|
|
43
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
44
|
+
</div>
|
|
45
|
+
} @else {
|
|
46
|
+
<div
|
|
47
|
+
class="group peer text-sidebar-foreground hidden md:block"
|
|
48
|
+
[attr.data-state]="state.state()"
|
|
49
|
+
[attr.data-collapsible]="
|
|
50
|
+
state.state() === 'collapsed' ? collapsible() : ''
|
|
51
|
+
"
|
|
52
|
+
[attr.data-variant]="variant()"
|
|
53
|
+
[attr.data-side]="side()"
|
|
54
|
+
>
|
|
55
|
+
<div scSidebarGap [variant]="variant()"></div>
|
|
56
|
+
<div scSidebarContainer [variant]="variant()">
|
|
57
|
+
<div scSidebarInner>
|
|
58
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
}
|
|
63
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ScSheetProvider, selector: "div[scSheetProvider]", inputs: ["class", "side", "open"], outputs: ["openChange"] }, { kind: "directive", type: ScSheetPortal, selector: "ng-template[scSheetPortal]" }, { kind: "component", type: ScSheet, selector: "div[scSheet]", inputs: ["class"] }, { kind: "directive", type: ScSheetClose, selector: "button[scSheetClose]", inputs: ["class", "variant", "size"] }, { kind: "component", type: SiXIcon, selector: "svg[siXIcon]", inputs: ["ariaHidden", "width", "height", "viewBox", "fill", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ScSidebarContainer, selector: "div[scSidebarContainer]", inputs: ["class", "variant"] }, { kind: "directive", type: ScSidebarGap, selector: "div[scSidebarGap]", inputs: ["class", "variant"] }, { kind: "directive", type: ScSidebarInner, selector: "div[scSidebarInner]", inputs: ["class"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
64
|
+
}
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebar, decorators: [{
|
|
66
|
+
type: Component,
|
|
67
|
+
args: [{
|
|
68
|
+
selector: 'div[scSidebar]',
|
|
69
|
+
imports: [
|
|
70
|
+
ScSheetProvider,
|
|
71
|
+
ScSheetPortal,
|
|
72
|
+
ScSheet,
|
|
73
|
+
ScSheetClose,
|
|
74
|
+
SiXIcon,
|
|
75
|
+
NgTemplateOutlet,
|
|
76
|
+
ScSidebarContainer,
|
|
77
|
+
ScSidebarGap,
|
|
78
|
+
ScSidebarInner,
|
|
79
|
+
],
|
|
80
|
+
template: `
|
|
81
|
+
<ng-template #content>
|
|
82
|
+
<ng-content />
|
|
83
|
+
</ng-template>
|
|
84
|
+
|
|
85
|
+
<!-- Mobile sidebar uses default width from sheet component -->
|
|
86
|
+
@if (isMobile()) {
|
|
87
|
+
<div scSheetProvider [(open)]="state.openMobile" [side]="side()">
|
|
88
|
+
<ng-template scSheetPortal>
|
|
89
|
+
<div
|
|
90
|
+
scSheet
|
|
91
|
+
class="bg-sidebar text-sidebar-foreground flex h-full flex-col p-0"
|
|
92
|
+
>
|
|
93
|
+
<button scSheetClose>
|
|
94
|
+
<svg siXIcon></svg>
|
|
95
|
+
<span class="sr-only">Close</span>
|
|
96
|
+
</button>
|
|
97
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
98
|
+
</div>
|
|
99
|
+
</ng-template>
|
|
100
|
+
</div>
|
|
101
|
+
} @else if (collapsible() === 'none') {
|
|
102
|
+
<div
|
|
103
|
+
scSidebarInner
|
|
104
|
+
class="bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col"
|
|
105
|
+
>
|
|
106
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
107
|
+
</div>
|
|
108
|
+
} @else {
|
|
109
|
+
<div
|
|
110
|
+
class="group peer text-sidebar-foreground hidden md:block"
|
|
111
|
+
[attr.data-state]="state.state()"
|
|
112
|
+
[attr.data-collapsible]="
|
|
113
|
+
state.state() === 'collapsed' ? collapsible() : ''
|
|
114
|
+
"
|
|
115
|
+
[attr.data-variant]="variant()"
|
|
116
|
+
[attr.data-side]="side()"
|
|
117
|
+
>
|
|
118
|
+
<div scSidebarGap [variant]="variant()"></div>
|
|
119
|
+
<div scSidebarContainer [variant]="variant()">
|
|
120
|
+
<div scSidebarInner>
|
|
121
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
}
|
|
126
|
+
`,
|
|
127
|
+
host: {
|
|
128
|
+
'data-slot': 'sidebar',
|
|
129
|
+
'[attr.data-state]': 'state.state()',
|
|
130
|
+
'[attr.data-variant]': 'variant()',
|
|
131
|
+
'[attr.data-side]': 'side()',
|
|
132
|
+
'[attr.data-collapsible]': 'collapsible()',
|
|
133
|
+
},
|
|
134
|
+
encapsulation: ViewEncapsulation.None,
|
|
135
|
+
}]
|
|
136
|
+
}], propDecorators: { 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 }] }] } });
|
|
137
|
+
//# sourceMappingURL=sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/sidebar/sidebar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EACL,OAAO,EACP,YAAY,EACZ,aAAa,EACb,eAAe,GAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE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{ NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n computed,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { SiXIcon } from '@semantic-icons/lucide-icons';\nimport {\n ScSheet,\n ScSheetClose,\n ScSheetPortal,\n ScSheetProvider,\n} from '../sheet';\nimport { ScSidebarContainer } from './sidebar-container';\nimport { ScSidebarGap } from './sidebar-gap';\nimport { ScSidebarInner } from './sidebar-inner';\nimport { ScSidebarState } from './sidebar-state';\n\n@Component({\n selector: 'div[scSidebar]',\n imports: [\n ScSheetProvider,\n ScSheetPortal,\n ScSheet,\n ScSheetClose,\n SiXIcon,\n NgTemplateOutlet,\n ScSidebarContainer,\n ScSidebarGap,\n ScSidebarInner,\n ],\n template: `\n <ng-template #content>\n <ng-content />\n </ng-template>\n\n <!-- Mobile sidebar uses default width from sheet component -->\n @if (isMobile()) {\n <div scSheetProvider [(open)]=\"state.openMobile\" [side]=\"side()\">\n <ng-template scSheetPortal>\n <div\n scSheet\n class=\"bg-sidebar text-sidebar-foreground flex h-full flex-col p-0\"\n >\n <button scSheetClose>\n <svg siXIcon></svg>\n <span class=\"sr-only\">Close</span>\n </button>\n <ng-container *ngTemplateOutlet=\"content\" />\n </div>\n </ng-template>\n </div>\n } @else if (collapsible() === 'none') {\n <div\n scSidebarInner\n class=\"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col\"\n >\n <ng-container *ngTemplateOutlet=\"content\" />\n </div>\n } @else {\n <div\n class=\"group peer text-sidebar-foreground hidden md:block\"\n [attr.data-state]=\"state.state()\"\n [attr.data-collapsible]=\"\n state.state() === 'collapsed' ? collapsible() : ''\n \"\n [attr.data-variant]=\"variant()\"\n [attr.data-side]=\"side()\"\n >\n <div scSidebarGap [variant]=\"variant()\"></div>\n <div scSidebarContainer [variant]=\"variant()\">\n <div scSidebarInner>\n <ng-container *ngTemplateOutlet=\"content\" />\n </div>\n </div>\n </div>\n }\n `,\n host: {\n 'data-slot': 'sidebar',\n '[attr.data-state]': 'state.state()',\n '[attr.data-variant]': 'variant()',\n '[attr.data-side]': 'side()',\n '[attr.data-collapsible]': 'collapsible()',\n },\n encapsulation: ViewEncapsulation.None,\n})\nexport class ScSidebar {\n readonly state = inject(ScSidebarState);\n\n readonly side = input<'left' | 'right'>('left');\n readonly variant = input<'sidebar' | 'floating' | 'inset'>('sidebar');\n readonly collapsible = input<'offcanvas' | 'icon' | 'none'>('offcanvas');\n\n protected readonly isMobile = computed(() => this.state.isMobile());\n}\n"]}
|
|
@@ -10,7 +10,7 @@ export class ScSlider {
|
|
|
10
10
|
idInput = input('', { ...(ngDevMode ? { debugName: "idInput" } : {}), alias: 'id' });
|
|
11
11
|
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
12
12
|
id = computed(() => this.idInput() || this.field?.id() || this.fallbackId, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
13
|
-
class = computed(() => cn('w-full cursor-pointer appearance-none bg-transparent disabled:pointer-events-none disabled:opacity-50', '[&::-webkit-slider-runnable-track]:h-1 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-[
|
|
13
|
+
class = computed(() => cn('w-full cursor-pointer appearance-none bg-transparent disabled:pointer-events-none disabled:opacity-50', '[&::-webkit-slider-runnable-track]:h-1 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-[linear-gradient(to_right,var(--primary)_var(--fill-percent,0%),var(--muted)_var(--fill-percent,0%))]', '[&::-moz-range-track]:h-1 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-muted', '[&::-moz-range-progress]:h-1 [&::-moz-range-progress]:rounded-full [&::-moz-range-progress]:bg-primary', '[&::-webkit-slider-thumb]:size-3 [&::-webkit-slider-thumb]:-mt-1 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-0 [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:transition-shadow', '[&::-webkit-slider-thumb:hover]:shadow-[0_0_0_3px_oklch(from_var(--ring)_l_c_h/0.5)]', '[&::-moz-range-thumb]:size-3 [&::-moz-range-thumb]:appearance-none [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:transition-shadow', '[&::-moz-range-thumb:hover]:shadow-[0_0_0_3px_oklch(from_var(--ring)_l_c_h/0.5)]', 'focus-visible:outline-none [&:focus-visible::-webkit-slider-thumb]:shadow-[0_0_0_3px_oklch(from_var(--ring)_l_c_h/0.5)]', '[&:focus-visible::-moz-range-thumb]:shadow-[0_0_0_3px_oklch(from_var(--ring)_l_c_h/0.5)]', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
14
14
|
constructor() {
|
|
15
15
|
afterNextRender(() => {
|
|
16
16
|
this.updateFillPercent();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/slider/slider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,eAAe,EACf,QAAQ,EACR,SAAS,EACT,UAAU,EACV,MAAM,EACN,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;;AAYpC,MAAM,OAAO,QAAQ;IACF,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACtD,EAAE,GAAG,MAAM,CAA+B,UAAU,CAAC,CAAC;IAE9D,OAAO,GAAG,KAAK,CAAC,EAAE,oDAAI,KAAK,EAAE,IAAI,GAA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Render,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n} from '@angular/core';\nimport { cn } from '../../utils';\nimport { SC_FIELD } from '../field';\n\n@Directive({\n selector: 'input[scSlider]',\n host: {\n type: 'range',\n 'data-slot': 'slider',\n '[attr.id]': 'id()',\n '[class]': 'class()',\n '(input)': 'onInput()',\n },\n})\nexport class ScSlider {\n private readonly field = inject(SC_FIELD, { optional: true });\n private readonly fallbackId = inject(_IdGenerator).getId('sc-slider-');\n private readonly el = inject<ElementRef<HTMLInputElement>>(ElementRef);\n\n readonly idInput = input('', { alias: 'id' });\n readonly classInput = input<string>('', { alias: 'class' });\n\n readonly id = computed(\n () => this.idInput() || this.field?.id() || this.fallbackId,\n );\n\n protected readonly class = computed(() =>\n cn(\n 'w-full cursor-pointer appearance-none bg-transparent disabled:pointer-events-none disabled:opacity-50',\n '[&::-webkit-slider-runnable-track]:h-1 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-[linear-gradient(to_right,var(--primary)_var(--fill-percent,0%),var(--muted)_var(--fill-percent,0%))]',\n '[&::-moz-range-track]:h-1 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-muted',\n '[&::-moz-range-progress]:h-1 [&::-moz-range-progress]:rounded-full [&::-moz-range-progress]:bg-primary',\n '[&::-webkit-slider-thumb]:size-3 [&::-webkit-slider-thumb]:-mt-1 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-0 [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:transition-shadow',\n '[&::-webkit-slider-thumb:hover]:shadow-[0_0_0_3px_oklch(from_var(--ring)_l_c_h/0.5)]',\n '[&::-moz-range-thumb]:size-3 [&::-moz-range-thumb]:appearance-none [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:transition-shadow',\n '[&::-moz-range-thumb:hover]:shadow-[0_0_0_3px_oklch(from_var(--ring)_l_c_h/0.5)]',\n 'focus-visible:outline-none [&:focus-visible::-webkit-slider-thumb]:shadow-[0_0_0_3px_oklch(from_var(--ring)_l_c_h/0.5)]',\n '[&:focus-visible::-moz-range-thumb]:shadow-[0_0_0_3px_oklch(from_var(--ring)_l_c_h/0.5)]',\n this.classInput(),\n ),\n );\n\n constructor() {\n afterNextRender(() => {\n this.updateFillPercent();\n });\n }\n\n protected onInput() {\n this.updateFillPercent();\n }\n\n private updateFillPercent() {\n const el = this.el.nativeElement;\n const min = parseFloat(el.min) || 0;\n const max = parseFloat(el.max) || 100;\n const value = parseFloat(el.value) || 0;\n const percent = ((value - min) / (max - min)) * 100;\n\n el.style.setProperty('--fill-percent', `${percent}%`);\n }\n}\n"]}
|
|
@@ -18,7 +18,7 @@ export class ScSwitchField {
|
|
|
18
18
|
checked = computed(() => this.switchInput()?.checked() ?? false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
19
19
|
disabled = computed(() => this.switchInput()?.disabledSignal() ?? false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
20
20
|
dataState = computed(() => this.checked() ? 'checked' : 'unchecked', ...(ngDevMode ? [{ debugName: "dataState" }] : []));
|
|
21
|
-
class = computed(() => cn('inline-flex cursor-pointer items-center gap-2 has-
|
|
21
|
+
class = computed(() => cn('inline-flex cursor-pointer items-center gap-2 has-disabled:cursor-not-allowed', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
22
22
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSwitchField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23
23
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: ScSwitchField, isStandalone: true, selector: "div[scSwitchField], label[scSwitchField]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "switch-field" }, properties: { "attr.role": "role()", "class": "class()", "attr.data-state": "dataState()", "attr.data-disabled": "disabled() ? \"\" : null" } }, providers: [
|
|
24
24
|
{ provide: SC_SWITCH_FIELD, useExisting: ScSwitchField },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch-field.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/switch/switch-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,MAAM,EACN,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAwB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;;AAwBjD,MAAM,OAAO,aAAa;IACP,UAAU,GAAG,MAAM,CAAC,CAAA,UAAuB,CAAA,CAAC,CAAC;IAC7C,WAAW,GAAG,YAAY,CAAC,QAAQ,uDAAC,CAAC;IAEnC,IAAI,GAAG,QAAQ,CAAC,GAAG,EAAE;QACtC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC;QACtD,OAAO,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;IAC9C,CAAC,gDAAC,CAAC;IAEM,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IACnD,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC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O,EAAE,QAAQ,EAAE,WAAW,eAAe,EAAE;qBAClD;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,cAAc;wBAC3B,aAAa,EAAE,QAAQ;wBACvB,SAAS,EAAE,SAAS;wBACpB,mBAAmB,EAAE,aAAa;wBAClC,sBAAsB,EAAE,wBAAwB;qBACjD;oBACD,QAAQ,EAAE;;;;GAIT;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;gGAG6C,QAAQ","sourcesContent":["import { _IdGenerator } from '@angular/cdk/a11y';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n ElementRef,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '../../utils';\nimport { SC_FIELD } from '../field';\nimport { type ScSwitchContext, SC_SWITCH_FIELD } from './switch-types';\nimport { ScSwitch } from './switch';\nimport { ScSwitchVisual } from './switch-visual';\n\n@Component({\n selector: 'div[scSwitchField], label[scSwitchField]',\n imports: [ScSwitchVisual],\n providers: [\n { provide: SC_SWITCH_FIELD, useExisting: ScSwitchField },\n { provide: SC_FIELD, useExisting: ScSwitchField },\n ],\n host: {\n 'data-slot': 'switch-field',\n '[attr.role]': 'role()',\n '[class]': 'class()',\n '[attr.data-state]': 'dataState()',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n },\n template: `\n <ng-content select=\"[scSwitch]\" />\n <span scSwitchVisual></span>\n <ng-content />\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScSwitchField implements ScSwitchContext {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly switchInput = contentChild(ScSwitch);\n\n protected readonly role = computed(() => {\n const tagName = this.elementRef.nativeElement.tagName;\n return tagName === 'LABEL' ? null : 'group';\n });\n\n readonly classInput = input<string>('', { alias: 'class' });\n readonly id = input(inject(_IdGenerator).getId('sc-switch-field-'));\n\n readonly checked = computed(() => this.switchInput()?.checked() ?? false);\n readonly disabled = computed(\n () => this.switchInput()?.disabledSignal() ?? false,\n );\n readonly dataState = computed((): 'checked' | 'unchecked' =>\n this.checked() ? 'checked' : 'unchecked',\n );\n\n protected readonly class = computed(() =>\n cn(\n 'inline-flex cursor-pointer items-center gap-2 has-disabled:cursor-not-allowed',\n this.classInput(),\n ),\n );\n}\n"]}
|
|
@@ -5,7 +5,7 @@ import * as i0 from "@angular/core";
|
|
|
5
5
|
import * as i1 from "@angular/aria/tabs";
|
|
6
6
|
export class ScTabPanel {
|
|
7
7
|
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
8
|
-
class = computed(() => cn('text-sm flex-1 outline-none [
|
|
8
|
+
class = computed(() => cn('text-sm flex-1 outline-none [[inert]]:hidden', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
9
9
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScTabPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10
10
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: ScTabPanel, isStandalone: true, selector: "[scTabPanel]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "tabs-content" }, properties: { "class": "class()" } }, hostDirectives: [{ directive: i1.TabPanel, inputs: ["value", "value", "id", "id"] }], ngImport: i0, template: `
|
|
11
11
|
<ng-content />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-panel.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/tabs/tab-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;;;AAoBjC,MAAM,OAAO,UAAU;IACZ,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IACnD,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CAC7B,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"tab-panel.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/tabs/tab-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;;;AAoBjC,MAAM,OAAO,UAAU;IACZ,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IACnD,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CAC7B,EAAE,CAAC,8CAA8C,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,iDACtE,CAAC;uGAJS,UAAU;2FAAV,UAAU,uYAJX;;GAET;;2FAEU,UAAU;kBAlBtB,SAAS;mBAAC;oBACT,QAAQ,EAAE,cAAc;oBACxB,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,cAAc,EAAE;wBACd;4BACE,SAAS,EAAE,QAAQ;4BACnB,MAAM,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC;yBACxB;qBACF;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,cAAc;wBAC3B,SAAS,EAAE,SAAS;qBACrB;oBACD,QAAQ,EAAE;;GAET;iBACF","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { TabPanel } from '@angular/aria/tabs';\nimport { cn } from '../../utils';\n\n@Component({\n selector: '[scTabPanel]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [\n {\n directive: TabPanel,\n inputs: ['value', 'id'],\n },\n ],\n host: {\n 'data-slot': 'tabs-content',\n '[class]': 'class()',\n },\n template: `\n <ng-content />\n `,\n})\nexport class ScTabPanel {\n readonly classInput = input<string>('', { alias: 'class' });\n readonly class = computed(() =>\n cn('text-sm flex-1 outline-none [[inert]]:hidden', this.classInput()),\n );\n}\n"]}
|
|
@@ -24,11 +24,7 @@ export class ScTooltip {
|
|
|
24
24
|
{{ data.content }}
|
|
25
25
|
<span
|
|
26
26
|
[attr.data-side]="side()"
|
|
27
|
-
class="absolute size-2.5 rotate-45 rounded-[2px]
|
|
28
|
-
data-[side=top]:-bottom-[5px] data-[side=top]:left-1/2 data-[side=top]:-translate-x-1/2
|
|
29
|
-
data-[side=bottom]:-top-[5px] data-[side=bottom]:left-1/2 data-[side=bottom]:-translate-x-1/2
|
|
30
|
-
data-[side=left]:-right-[5px] data-[side=left]:top-1/2 data-[side=left]:-translate-y-1/2
|
|
31
|
-
data-[side=right]:-left-[5px] data-[side=right]:top-1/2 data-[side=right]:-translate-y-1/2"
|
|
27
|
+
class="bg-primary absolute z-50 size-2.5 rotate-45 rounded-[2px] data-[side=bottom]:-top-[5px] data-[side=bottom]:left-1/2 data-[side=bottom]:-translate-x-1/2 data-[side=left]:top-1/2 data-[side=left]:-right-[5px] data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2 data-[side=right]:-left-[5px] data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-[5px] data-[side=top]:left-1/2 data-[side=top]:-translate-x-1/2"
|
|
32
28
|
></span>
|
|
33
29
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
34
30
|
}
|
|
@@ -40,11 +36,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
40
36
|
{{ data.content }}
|
|
41
37
|
<span
|
|
42
38
|
[attr.data-side]="side()"
|
|
43
|
-
class="absolute size-2.5 rotate-45 rounded-[2px]
|
|
44
|
-
data-[side=top]:-bottom-[5px] data-[side=top]:left-1/2 data-[side=top]:-translate-x-1/2
|
|
45
|
-
data-[side=bottom]:-top-[5px] data-[side=bottom]:left-1/2 data-[side=bottom]:-translate-x-1/2
|
|
46
|
-
data-[side=left]:-right-[5px] data-[side=left]:top-1/2 data-[side=left]:-translate-y-1/2
|
|
47
|
-
data-[side=right]:-left-[5px] data-[side=right]:top-1/2 data-[side=right]:-translate-y-1/2"
|
|
39
|
+
class="bg-primary absolute z-50 size-2.5 rotate-45 rounded-[2px] data-[side=bottom]:-top-[5px] data-[side=bottom]:left-1/2 data-[side=bottom]:-translate-x-1/2 data-[side=left]:top-1/2 data-[side=left]:-right-[5px] data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2 data-[side=right]:-left-[5px] data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-[5px] data-[side=top]:left-1/2 data-[side=top]:-translate-x-1/2"
|
|
48
40
|
></span>
|
|
49
41
|
`,
|
|
50
42
|
host: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/tooltip/tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,UAAU,EACV,MAAM,EACN,cAAc,EACd,MAAM,EACN,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;;AAOjC,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,cAAc,CAC/C,iBAAiB,CAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","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wBACtB,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,QAAQ;wBACrB,aAAa,EAAE,MAAM;wBACrB,MAAM,EAAE,gBAAgB;wBACxB,SAAS,EAAE,aAAa;wBACxB,kBAAkB,EAAE,kCAAkC;wBACtD,oBAAoB,EAAE,oCAAoC;wBAC1D,kBAAkB,EAAE,QAAQ;wBAC5B,gBAAgB,EAAE,wBAAwB;qBAC3C;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n InjectionToken,\n output,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '../../utils';\n\nexport interface ScTooltipData {\n content: string;\n tooltipId: string;\n}\n\nexport const SC_TOOLTIP_DATA = new InjectionToken<ScTooltipData>(\n 'SC_TOOLTIP_DATA',\n);\n\ntype ScTooltipState = 'open' | 'closed';\ntype ScTooltipSide = 'top' | 'right' | 'bottom' | 'left';\n\n@Component({\n selector: 'sc-tooltip',\n template: `\n {{ data.content }}\n <span\n [attr.data-side]=\"side()\"\n class=\"bg-primary absolute z-50 size-2.5 rotate-45 rounded-[2px] data-[side=bottom]:-top-[5px] data-[side=bottom]:left-1/2 data-[side=bottom]:-translate-x-1/2 data-[side=left]:top-1/2 data-[side=left]:-right-[5px] data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2 data-[side=right]:-left-[5px] data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-[5px] data-[side=top]:left-1/2 data-[side=top]:-translate-x-1/2\"\n ></span>\n `,\n host: {\n 'data-slot': 'tooltip',\n role: 'tooltip',\n 'aria-live': 'polite',\n 'aria-atomic': 'true',\n '[id]': 'data.tooltipId',\n '[class]': 'hostClass()',\n '[attr.data-open]': 'state() === \"open\" ? true : null',\n '[attr.data-closed]': 'state() === \"closed\" ? true : null',\n '[attr.data-side]': 'side()',\n '(animationend)': 'onAnimationEnd($event)',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScTooltip {\n private readonly elementRef = inject(ElementRef);\n\n readonly data = inject(SC_TOOLTIP_DATA);\n readonly state = signal<ScTooltipState>('open');\n readonly side = signal<ScTooltipSide>('top');\n readonly animationComplete = output<void>();\n\n protected readonly hostClass = computed(() =>\n cn(\n 'bg-primary text-primary-foreground z-50 rounded-md px-3 py-1.5 text-xs w-fit max-w-xs',\n 'data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n ),\n );\n\n protected onAnimationEnd(event: AnimationEvent): void {\n // Only emit when close animation completes\n if (\n this.state() === 'closed' &&\n event.target === this.elementRef.nativeElement\n ) {\n this.animationComplete.emit();\n }\n }\n\n close(): void {\n this.state.set('closed');\n }\n}\n"]}
|
|
@@ -34,10 +34,12 @@ export * from './popover';
|
|
|
34
34
|
export * from './progress';
|
|
35
35
|
export * from './radio-group';
|
|
36
36
|
export * from './range-slider';
|
|
37
|
+
export * from './resizable';
|
|
37
38
|
export * from './scroll-area';
|
|
38
39
|
export * from './select';
|
|
39
40
|
export * from './separator';
|
|
40
41
|
export * from './sheet';
|
|
42
|
+
export * from './sidebar';
|
|
41
43
|
export * from './skeleton';
|
|
42
44
|
export * from './slider';
|
|
43
45
|
export * from './spinner';
|