@semantic-components/ui 0.69.0 → 0.71.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,20 @@
|
|
|
1
|
+
import { computed, Directive, input } from '@angular/core';
|
|
2
|
+
import { cn } from '../../utils';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export class ScResizableHandleIndicator {
|
|
5
|
+
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
6
|
+
class = computed(() => cn('bg-border z-10 flex h-6 w-1 shrink-0 rounded-lg', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
7
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScResizableHandleIndicator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
8
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ScResizableHandleIndicator, isStandalone: true, selector: "[scResizableHandleIndicator]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "resizable-handle-indicator" }, properties: { "class": "class()" } }, ngImport: i0 });
|
|
9
|
+
}
|
|
10
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScResizableHandleIndicator, decorators: [{
|
|
11
|
+
type: Directive,
|
|
12
|
+
args: [{
|
|
13
|
+
selector: '[scResizableHandleIndicator]',
|
|
14
|
+
host: {
|
|
15
|
+
'data-slot': 'resizable-handle-indicator',
|
|
16
|
+
'[class]': 'class()',
|
|
17
|
+
},
|
|
18
|
+
}]
|
|
19
|
+
}], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
20
|
+
//# sourceMappingURL=resizable-handle-indicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable-handle-indicator.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/resizable/resizable-handle-indicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;;AASjC,MAAM,OAAO,0BAA0B;IAC5B,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CAAC,iDAAiD,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,iDACzE,CAAC;uGALS,0BAA0B;2FAA1B,0BAA0B;;2FAA1B,0BAA0B;kBAPtC,SAAS;mBAAC;oBACT,QAAQ,EAAE,8BAA8B;oBACxC,IAAI,EAAE;wBACJ,WAAW,EAAE,4BAA4B;wBACzC,SAAS,EAAE,SAAS;qBACrB;iBACF","sourcesContent":["import { computed, Directive, input } from '@angular/core';\nimport { cn } from '../../utils';\n\n@Directive({\n selector: '[scResizableHandleIndicator]',\n host: {\n 'data-slot': 'resizable-handle-indicator',\n '[class]': 'class()',\n },\n})\nexport class ScResizableHandleIndicator {\n readonly classInput = input<string>('', { alias: 'class' });\n\n protected readonly class = computed(() =>\n cn('bg-border z-10 flex h-6 w-1 shrink-0 rounded-lg', this.classInput()),\n );\n}\n"]}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, ElementRef, inject, input, ViewEncapsulation, } from '@angular/core';
|
|
2
|
+
import { cn } from '../../utils';
|
|
3
|
+
import { ScResizableHandleIndicator } from './resizable-handle-indicator';
|
|
4
|
+
import { ScResizablePanelGroup } from './resizable-panel-group';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export class ScResizableHandle {
|
|
7
|
+
group = inject(ScResizablePanelGroup);
|
|
8
|
+
elementRef = inject(ElementRef);
|
|
9
|
+
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
10
|
+
withHandle = input(false, ...(ngDevMode ? [{ debugName: "withHandle" }] : []));
|
|
11
|
+
dragging = false;
|
|
12
|
+
startPos = 0;
|
|
13
|
+
startSizes = [];
|
|
14
|
+
class = computed(() => cn('bg-border focus-visible:ring-ring ring-offset-background relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:outline-hidden aria-[orientation=vertical]:cursor-ew-resize aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:cursor-ns-resize aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
15
|
+
onMouseDown(event) {
|
|
16
|
+
event.preventDefault();
|
|
17
|
+
this.startDrag(event.clientX, event.clientY);
|
|
18
|
+
const onMouseMove = (e) => this.onDrag(e.clientX, e.clientY);
|
|
19
|
+
const onMouseUp = () => {
|
|
20
|
+
this.dragging = false;
|
|
21
|
+
document.removeEventListener('mousemove', onMouseMove);
|
|
22
|
+
document.removeEventListener('mouseup', onMouseUp);
|
|
23
|
+
};
|
|
24
|
+
document.addEventListener('mousemove', onMouseMove);
|
|
25
|
+
document.addEventListener('mouseup', onMouseUp);
|
|
26
|
+
}
|
|
27
|
+
onTouchStart(event) {
|
|
28
|
+
if (event.touches.length !== 1)
|
|
29
|
+
return;
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
const touch = event.touches[0];
|
|
32
|
+
this.startDrag(touch.clientX, touch.clientY);
|
|
33
|
+
const onTouchMove = (e) => {
|
|
34
|
+
if (e.touches.length !== 1)
|
|
35
|
+
return;
|
|
36
|
+
const t = e.touches[0];
|
|
37
|
+
this.onDrag(t.clientX, t.clientY);
|
|
38
|
+
};
|
|
39
|
+
const onTouchEnd = () => {
|
|
40
|
+
this.dragging = false;
|
|
41
|
+
document.removeEventListener('touchmove', onTouchMove);
|
|
42
|
+
document.removeEventListener('touchend', onTouchEnd);
|
|
43
|
+
};
|
|
44
|
+
document.addEventListener('touchmove', onTouchMove, { passive: false });
|
|
45
|
+
document.addEventListener('touchend', onTouchEnd);
|
|
46
|
+
}
|
|
47
|
+
startDrag(clientX, clientY) {
|
|
48
|
+
this.dragging = true;
|
|
49
|
+
const isHorizontal = this.group.direction() === 'horizontal';
|
|
50
|
+
this.startPos = isHorizontal ? clientX : clientY;
|
|
51
|
+
const panels = this.group.getPanels();
|
|
52
|
+
this.startSizes = panels.map((p) => p.size());
|
|
53
|
+
}
|
|
54
|
+
onDrag(clientX, clientY) {
|
|
55
|
+
if (!this.dragging)
|
|
56
|
+
return;
|
|
57
|
+
const isHorizontal = this.group.direction() === 'horizontal';
|
|
58
|
+
const currentPos = isHorizontal ? clientX : clientY;
|
|
59
|
+
const delta = currentPos - this.startPos;
|
|
60
|
+
const panels = this.group.getPanels();
|
|
61
|
+
const handles = this.group.getHandles();
|
|
62
|
+
const handleIndex = handles.indexOf(this);
|
|
63
|
+
if (handleIndex === -1 || panels.length < 2)
|
|
64
|
+
return;
|
|
65
|
+
const container = this.elementRef.nativeElement.parentElement;
|
|
66
|
+
if (!container)
|
|
67
|
+
return;
|
|
68
|
+
const containerSize = isHorizontal
|
|
69
|
+
? container.offsetWidth
|
|
70
|
+
: container.offsetHeight;
|
|
71
|
+
const deltaPercent = (delta / containerSize) * 100;
|
|
72
|
+
const leftPanelIndex = handleIndex;
|
|
73
|
+
const rightPanelIndex = handleIndex + 1;
|
|
74
|
+
if (leftPanelIndex >= 0 && rightPanelIndex < panels.length) {
|
|
75
|
+
const leftPanel = panels[leftPanelIndex];
|
|
76
|
+
const rightPanel = panels[rightPanelIndex];
|
|
77
|
+
const newLeftSize = this.startSizes[leftPanelIndex] + deltaPercent;
|
|
78
|
+
const newRightSize = this.startSizes[rightPanelIndex] - deltaPercent;
|
|
79
|
+
if (newLeftSize >= leftPanel.minSize() &&
|
|
80
|
+
newLeftSize <= leftPanel.maxSize() &&
|
|
81
|
+
newRightSize >= rightPanel.minSize() &&
|
|
82
|
+
newRightSize <= rightPanel.maxSize()) {
|
|
83
|
+
leftPanel.setSize(newLeftSize);
|
|
84
|
+
rightPanel.setSize(newRightSize);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScResizableHandle, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
89
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ScResizableHandle, isStandalone: true, selector: "[scResizableHandle]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, withHandle: { classPropertyName: "withHandle", publicName: "withHandle", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "resizable-handle" }, listeners: { "mousedown": "onMouseDown($event)", "touchstart": "onTouchStart($event)" }, properties: { "class": "class()", "attr.aria-orientation": "group.direction() === \"horizontal\" ? \"vertical\" : \"horizontal\"" } }, ngImport: i0, template: `
|
|
90
|
+
@if (withHandle()) {
|
|
91
|
+
<div scResizableHandleIndicator></div>
|
|
92
|
+
}
|
|
93
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: ScResizableHandleIndicator, selector: "[scResizableHandleIndicator]", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
94
|
+
}
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScResizableHandle, decorators: [{
|
|
96
|
+
type: Component,
|
|
97
|
+
args: [{
|
|
98
|
+
selector: '[scResizableHandle]',
|
|
99
|
+
imports: [ScResizableHandleIndicator],
|
|
100
|
+
host: {
|
|
101
|
+
'data-slot': 'resizable-handle',
|
|
102
|
+
'[class]': 'class()',
|
|
103
|
+
'[attr.aria-orientation]': 'group.direction() === "horizontal" ? "vertical" : "horizontal"',
|
|
104
|
+
'(mousedown)': 'onMouseDown($event)',
|
|
105
|
+
'(touchstart)': 'onTouchStart($event)',
|
|
106
|
+
},
|
|
107
|
+
template: `
|
|
108
|
+
@if (withHandle()) {
|
|
109
|
+
<div scResizableHandleIndicator></div>
|
|
110
|
+
}
|
|
111
|
+
`,
|
|
112
|
+
encapsulation: ViewEncapsulation.None,
|
|
113
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
114
|
+
}]
|
|
115
|
+
}], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], withHandle: [{ type: i0.Input, args: [{ isSignal: true, alias: "withHandle", required: false }] }] } });
|
|
116
|
+
//# sourceMappingURL=resizable-handle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable-handle.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/resizable/resizable-handle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,UAAU,EACV,MAAM,EACN,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;;AAqBhE,MAAM,OAAO,iBAAiB;IACnB,KAAK,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAC9B,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAExC,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IACnD,UAAU,GAAG,KAAK,CAAU,KAAK,sDAAC,CAAC;IAEpC,QAAQ,GAAG,KAAK,CAAC;IACjB,QAAQ,GAAG,CAAC,CAAC;IACb,UAAU,GAAa,EAAE,CAAC;IAEf,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,kqBAAkqB,EAClqB,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;IAEQ,WAAW,CAAC,KAAiB;QACrC,KAAK,CAAC,cAAc,EAAE,CAAC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S,0BAA0B;;2FAiBzB,iBAAiB;kBAnB7B,SAAS;mBAAC;oBACT,QAAQ,EAAE,qBAAqB;oBAC/B,OAAO,EAAE,CAAC,0BAA0B,CAAC;oBACrC,IAAI,EAAE;wBACJ,WAAW,EAAE,kBAAkB;wBAC/B,SAAS,EAAE,SAAS;wBACpB,yBAAyB,EACvB,gEAAgE;wBAClE,aAAa,EAAE,qBAAqB;wBACpC,cAAc,EAAE,sBAAsB;qBACvC;oBACD,QAAQ,EAAE;;;;GAIT;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 input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '../../utils';\nimport { ScResizableHandleIndicator } from './resizable-handle-indicator';\nimport { ScResizablePanelGroup } from './resizable-panel-group';\n\n@Component({\n selector: '[scResizableHandle]',\n imports: [ScResizableHandleIndicator],\n host: {\n 'data-slot': 'resizable-handle',\n '[class]': 'class()',\n '[attr.aria-orientation]':\n 'group.direction() === \"horizontal\" ? \"vertical\" : \"horizontal\"',\n '(mousedown)': 'onMouseDown($event)',\n '(touchstart)': 'onTouchStart($event)',\n },\n template: `\n @if (withHandle()) {\n <div scResizableHandleIndicator></div>\n }\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScResizableHandle {\n readonly group = inject(ScResizablePanelGroup);\n private readonly elementRef = inject(ElementRef);\n\n readonly classInput = input<string>('', { alias: 'class' });\n readonly withHandle = input<boolean>(false);\n\n private dragging = false;\n private startPos = 0;\n private startSizes: number[] = [];\n\n protected readonly class = computed(() =>\n cn(\n 'bg-border focus-visible:ring-ring ring-offset-background relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:outline-hidden aria-[orientation=vertical]:cursor-ew-resize aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:cursor-ns-resize aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90',\n this.classInput(),\n ),\n );\n\n protected onMouseDown(event: MouseEvent): void {\n event.preventDefault();\n this.startDrag(event.clientX, event.clientY);\n\n const onMouseMove = (e: MouseEvent) => this.onDrag(e.clientX, e.clientY);\n const onMouseUp = () => {\n this.dragging = false;\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp);\n };\n\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('mouseup', onMouseUp);\n }\n\n protected onTouchStart(event: TouchEvent): void {\n if (event.touches.length !== 1) return;\n event.preventDefault();\n const touch = event.touches[0];\n this.startDrag(touch.clientX, touch.clientY);\n\n const onTouchMove = (e: TouchEvent) => {\n if (e.touches.length !== 1) return;\n const t = e.touches[0];\n this.onDrag(t.clientX, t.clientY);\n };\n const onTouchEnd = () => {\n this.dragging = false;\n document.removeEventListener('touchmove', onTouchMove);\n document.removeEventListener('touchend', onTouchEnd);\n };\n\n document.addEventListener('touchmove', onTouchMove, { passive: false });\n document.addEventListener('touchend', onTouchEnd);\n }\n\n private startDrag(clientX: number, clientY: number): void {\n this.dragging = true;\n const isHorizontal = this.group.direction() === 'horizontal';\n this.startPos = isHorizontal ? clientX : clientY;\n\n const panels = this.group.getPanels();\n this.startSizes = panels.map((p) => p.size());\n }\n\n private onDrag(clientX: number, clientY: number): void {\n if (!this.dragging) return;\n\n const isHorizontal = this.group.direction() === 'horizontal';\n const currentPos = isHorizontal ? clientX : clientY;\n const delta = currentPos - this.startPos;\n\n const panels = this.group.getPanels();\n const handles = this.group.getHandles();\n const handleIndex = handles.indexOf(this);\n\n if (handleIndex === -1 || panels.length < 2) return;\n\n const container = this.elementRef.nativeElement.parentElement;\n if (!container) return;\n\n const containerSize = isHorizontal\n ? container.offsetWidth\n : container.offsetHeight;\n const deltaPercent = (delta / containerSize) * 100;\n\n const leftPanelIndex = handleIndex;\n const rightPanelIndex = handleIndex + 1;\n\n if (leftPanelIndex >= 0 && rightPanelIndex < panels.length) {\n const leftPanel = panels[leftPanelIndex];\n const rightPanel = panels[rightPanelIndex];\n\n const newLeftSize = this.startSizes[leftPanelIndex] + deltaPercent;\n const newRightSize = this.startSizes[rightPanelIndex] - deltaPercent;\n\n if (\n newLeftSize >= leftPanel.minSize() &&\n newLeftSize <= leftPanel.maxSize() &&\n newRightSize >= rightPanel.minSize() &&\n newRightSize <= rightPanel.maxSize()\n ) {\n leftPanel.setSize(newLeftSize);\n rightPanel.setSize(newRightSize);\n }\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { computed, Directive, input, contentChildren } from '@angular/core';
|
|
2
|
+
import { cn } from '../../utils';
|
|
3
|
+
import { ScResizablePanel } from './resizable-panel';
|
|
4
|
+
import { ScResizableHandle } from './resizable-handle';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export class ScResizablePanelGroup {
|
|
7
|
+
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
8
|
+
direction = input('horizontal', ...(ngDevMode ? [{ debugName: "direction" }] : []));
|
|
9
|
+
allPanels = contentChildren(ScResizablePanel, { ...(ngDevMode ? { debugName: "allPanels" } : {}), descendants: true });
|
|
10
|
+
allHandles = contentChildren(ScResizableHandle, { ...(ngDevMode ? { debugName: "allHandles" } : {}), descendants: true });
|
|
11
|
+
ownPanels = computed(() => this.allPanels().filter((p) => p.group === this), ...(ngDevMode ? [{ debugName: "ownPanels" }] : []));
|
|
12
|
+
ownHandles = computed(() => this.allHandles().filter((h) => h.group === this), ...(ngDevMode ? [{ debugName: "ownHandles" }] : []));
|
|
13
|
+
class = computed(() => cn('flex h-full w-full overflow-hidden aria-[orientation=vertical]:flex-col', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
14
|
+
getPanels() {
|
|
15
|
+
return this.ownPanels();
|
|
16
|
+
}
|
|
17
|
+
getHandles() {
|
|
18
|
+
return this.ownHandles();
|
|
19
|
+
}
|
|
20
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScResizablePanelGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
21
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.0", type: ScResizablePanelGroup, isStandalone: true, selector: "[scResizablePanelGroup]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "resizable-panel-group" }, properties: { "class": "class()", "attr.aria-orientation": "direction()" } }, queries: [{ propertyName: "allPanels", predicate: ScResizablePanel, descendants: true, isSignal: true }, { propertyName: "allHandles", predicate: ScResizableHandle, descendants: true, isSignal: true }], ngImport: i0 });
|
|
22
|
+
}
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScResizablePanelGroup, decorators: [{
|
|
24
|
+
type: Directive,
|
|
25
|
+
args: [{
|
|
26
|
+
selector: '[scResizablePanelGroup]',
|
|
27
|
+
host: {
|
|
28
|
+
'data-slot': 'resizable-panel-group',
|
|
29
|
+
'[class]': 'class()',
|
|
30
|
+
'[attr.aria-orientation]': 'direction()',
|
|
31
|
+
},
|
|
32
|
+
}]
|
|
33
|
+
}], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], allPanels: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => ScResizablePanel), { ...{
|
|
34
|
+
descendants: true,
|
|
35
|
+
}, isSignal: true }] }], allHandles: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => ScResizableHandle), { ...{
|
|
36
|
+
descendants: true,
|
|
37
|
+
}, isSignal: true }] }] } });
|
|
38
|
+
//# sourceMappingURL=resizable-panel-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable-panel-group.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/resizable/resizable-panel-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;;AAUvD,MAAM,OAAO,qBAAqB;IACvB,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IACnD,SAAS,GAAG,KAAK,CAAuB,YAAY,qDAAC,CAAC;IAE9C,SAAS,GAAG,eAAe,CAAC,gBAAgB,sDAC3D,WAAW,EAAE,IAAI,GACjB,CAAC;IACc,UAAU,GAAG,eAAe,CAAC,iBAAiB,uDAC7D,WAAW,EAAE,IAAI,GACjB,CAAC;IAEc,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,CACzC,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,qDACjD,CAAC;IACe,UAAU,GAAG,QAAQ,CAAC,GAAG,EAAE,CAC1C,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,sDAClD,CAAC;IAEiB,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,yEAAyE,EACzE,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;IAEF,SAAS;QACP,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;uGA/BU,qBAAqB;2FAArB,qBAAqB,2gBAIa,gBAAgB,gFAGf,iBAAiB;;2FAPpD,qBAAqB;kBARjC,SAAS;mBAAC;oBACT,QAAQ,EAAE,yBAAyB;oBACnC,IAAI,EAAE;wBACJ,WAAW,EAAE,uBAAuB;wBACpC,SAAS,EAAE,SAAS;wBACpB,yBAAyB,EAAE,aAAa;qBACzC;iBACF;kSAK8C,gBAAgB,QAAE;4BAC7D,WAAW,EAAE,IAAI;yBAClB,4FAC6C,iBAAiB,QAAE;4BAC/D,WAAW,EAAE,IAAI;yBAClB","sourcesContent":["import { computed, Directive, input, contentChildren } from '@angular/core';\nimport { cn } from '../../utils';\nimport { ScResizableDirection } from './resizable.types';\nimport { ScResizablePanel } from './resizable-panel';\nimport { ScResizableHandle } from './resizable-handle';\n\n@Directive({\n selector: '[scResizablePanelGroup]',\n host: {\n 'data-slot': 'resizable-panel-group',\n '[class]': 'class()',\n '[attr.aria-orientation]': 'direction()',\n },\n})\nexport class ScResizablePanelGroup {\n readonly classInput = input<string>('', { alias: 'class' });\n readonly direction = input<ScResizableDirection>('horizontal');\n\n private readonly allPanels = contentChildren(ScResizablePanel, {\n descendants: true,\n });\n private readonly allHandles = contentChildren(ScResizableHandle, {\n descendants: true,\n });\n\n private readonly ownPanels = computed(() =>\n this.allPanels().filter((p) => p.group === this),\n );\n private readonly ownHandles = computed(() =>\n this.allHandles().filter((h) => h.group === this),\n );\n\n protected readonly class = computed(() =>\n cn(\n 'flex h-full w-full overflow-hidden aria-[orientation=vertical]:flex-col',\n this.classInput(),\n ),\n );\n\n getPanels() {\n return this.ownPanels();\n }\n\n getHandles() {\n return this.ownHandles();\n }\n}\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { computed, Directive, inject, input, linkedSignal, } from '@angular/core';
|
|
2
|
+
import { cn } from '../../utils';
|
|
3
|
+
import { ScResizablePanelGroup } from './resizable-panel-group';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export class ScResizablePanel {
|
|
6
|
+
group = inject(ScResizablePanelGroup);
|
|
7
|
+
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
8
|
+
defaultSize = input(50, ...(ngDevMode ? [{ debugName: "defaultSize" }] : []));
|
|
9
|
+
minSize = input(0, ...(ngDevMode ? [{ debugName: "minSize" }] : []));
|
|
10
|
+
maxSize = input(100, ...(ngDevMode ? [{ debugName: "maxSize" }] : []));
|
|
11
|
+
size = linkedSignal(() => this.defaultSize(), ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
12
|
+
class = computed(() => cn('overflow-hidden', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
13
|
+
minSizePx = computed(() => `${this.minSize()}%`, ...(ngDevMode ? [{ debugName: "minSizePx" }] : []));
|
|
14
|
+
maxSizePx = computed(() => `${this.maxSize()}%`, ...(ngDevMode ? [{ debugName: "maxSizePx" }] : []));
|
|
15
|
+
setSize(newSize) {
|
|
16
|
+
const clamped = Math.max(this.minSize(), Math.min(this.maxSize(), newSize));
|
|
17
|
+
this.size.set(clamped);
|
|
18
|
+
}
|
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScResizablePanel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
20
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ScResizablePanel, isStandalone: true, selector: "[scResizablePanel]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, defaultSize: { classPropertyName: "defaultSize", publicName: "defaultSize", isSignal: true, isRequired: false, transformFunction: null }, minSize: { classPropertyName: "minSize", publicName: "minSize", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "resizable-panel" }, properties: { "class": "class()", "style.flex-grow": "size()", "style.flex-shrink": "1", "style.flex-basis": "\"0%\"", "style.min-width": "group.direction() === \"horizontal\" ? minSizePx() : undefined", "style.min-height": "group.direction() === \"vertical\" ? minSizePx() : undefined", "style.max-width": "group.direction() === \"horizontal\" ? maxSizePx() : undefined", "style.max-height": "group.direction() === \"vertical\" ? maxSizePx() : undefined" } }, ngImport: i0 });
|
|
21
|
+
}
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScResizablePanel, decorators: [{
|
|
23
|
+
type: Directive,
|
|
24
|
+
args: [{
|
|
25
|
+
selector: '[scResizablePanel]',
|
|
26
|
+
host: {
|
|
27
|
+
'data-slot': 'resizable-panel',
|
|
28
|
+
'[class]': 'class()',
|
|
29
|
+
'[style.flex-grow]': 'size()',
|
|
30
|
+
'[style.flex-shrink]': '1',
|
|
31
|
+
'[style.flex-basis]': '"0%"',
|
|
32
|
+
'[style.min-width]': 'group.direction() === "horizontal" ? minSizePx() : undefined',
|
|
33
|
+
'[style.min-height]': 'group.direction() === "vertical" ? minSizePx() : undefined',
|
|
34
|
+
'[style.max-width]': 'group.direction() === "horizontal" ? maxSizePx() : undefined',
|
|
35
|
+
'[style.max-height]': 'group.direction() === "vertical" ? maxSizePx() : undefined',
|
|
36
|
+
},
|
|
37
|
+
}]
|
|
38
|
+
}], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], defaultSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultSize", required: false }] }], minSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "minSize", required: false }] }], maxSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSize", required: false }] }] } });
|
|
39
|
+
//# sourceMappingURL=resizable-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable-panel.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/resizable/resizable-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,SAAS,EACT,MAAM,EACN,KAAK,EACL,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;;AAoBhE,MAAM,OAAO,gBAAgB;IAClB,KAAK,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAEtC,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IACnD,WAAW,GAAG,KAAK,CAAS,EAAE,uDAAC,CAAC;IAChC,OAAO,GAAG,KAAK,CAAS,CAAC,mDAAC,CAAC;IAC3B,OAAO,GAAG,KAAK,CAAS,GAAG,mDAAC,CAAC;IAE7B,IAAI,GAAG,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,gDAAC,CAAC;IAEpC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CAAC,iBAAiB,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,iDACzC,CAAC;IAEiB,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,qDAAC,CAAC;IACjD,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,qDAAC,CAAC;IAEpE,OAAO,CAAC,OAAe;QACrB,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;QAC5E,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;uGApBU,gBAAgB;2FAAhB,gBAAgB;;2FAAhB,gBAAgB;kBAlB5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;oBAC9B,IAAI,EAAE;wBACJ,WAAW,EAAE,iBAAiB;wBAC9B,SAAS,EAAE,SAAS;wBACpB,mBAAmB,EAAE,QAAQ;wBAC7B,qBAAqB,EAAE,GAAG;wBAC1B,oBAAoB,EAAE,MAAM;wBAC5B,mBAAmB,EACjB,8DAA8D;wBAChE,oBAAoB,EAClB,4DAA4D;wBAC9D,mBAAmB,EACjB,8DAA8D;wBAChE,oBAAoB,EAClB,4DAA4D;qBAC/D;iBACF","sourcesContent":["import {\n computed,\n Directive,\n inject,\n input,\n linkedSignal,\n} from '@angular/core';\nimport { cn } from '../../utils';\nimport { ScResizablePanelGroup } from './resizable-panel-group';\n\n@Directive({\n selector: '[scResizablePanel]',\n host: {\n 'data-slot': 'resizable-panel',\n '[class]': 'class()',\n '[style.flex-grow]': 'size()',\n '[style.flex-shrink]': '1',\n '[style.flex-basis]': '\"0%\"',\n '[style.min-width]':\n 'group.direction() === \"horizontal\" ? minSizePx() : undefined',\n '[style.min-height]':\n 'group.direction() === \"vertical\" ? minSizePx() : undefined',\n '[style.max-width]':\n 'group.direction() === \"horizontal\" ? maxSizePx() : undefined',\n '[style.max-height]':\n 'group.direction() === \"vertical\" ? maxSizePx() : undefined',\n },\n})\nexport class ScResizablePanel {\n readonly group = inject(ScResizablePanelGroup);\n\n readonly classInput = input<string>('', { alias: 'class' });\n readonly defaultSize = input<number>(50);\n readonly minSize = input<number>(0);\n readonly maxSize = input<number>(100);\n\n readonly size = linkedSignal(() => this.defaultSize());\n\n protected readonly class = computed(() =>\n cn('overflow-hidden', this.classInput()),\n );\n\n protected readonly minSizePx = computed(() => `${this.minSize()}%`);\n protected readonly maxSizePx = computed(() => `${this.maxSize()}%`);\n\n setSize(newSize: number): void {\n const clamped = Math.max(this.minSize(), Math.min(this.maxSize(), newSize));\n this.size.set(clamped);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=resizable.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable.types.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/resizable/resizable.types.ts"],"names":[],"mappings":"","sourcesContent":["export type ScResizableDirection = 'horizontal' | 'vertical';\n"]}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, computed, input, ViewEncapsulation, } from '@angular/core';
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, inject, input, ViewEncapsulation, } from '@angular/core';
|
|
2
2
|
import { cn } from '../../utils';
|
|
3
|
+
import { ScSelect } from './select';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export class ScSelectLabel {
|
|
6
|
+
select = inject(ScSelect);
|
|
5
7
|
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
6
|
-
class = computed(() => cn('pointer-events-none', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
8
|
+
class = computed(() => cn('truncate pointer-events-none', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
7
9
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSelectLabel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8
10
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: ScSelectLabel, isStandalone: true, selector: "span[scSelectLabel], div[scSelectLabel]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "select-label" }, properties: { "class": "class()" } }, ngImport: i0, template: `
|
|
9
|
-
|
|
11
|
+
{{ select.label() }}
|
|
10
12
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
11
13
|
}
|
|
12
14
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSelectLabel, decorators: [{
|
|
13
15
|
type: Component,
|
|
14
16
|
args: [{
|
|
15
17
|
selector: 'span[scSelectLabel], div[scSelectLabel]',
|
|
16
|
-
imports: [],
|
|
17
18
|
template: `
|
|
18
|
-
|
|
19
|
+
{{ select.label() }}
|
|
19
20
|
`,
|
|
20
21
|
host: {
|
|
21
22
|
'data-slot': 'select-label',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-label.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/select/select-label.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;;
|
|
1
|
+
{"version":3,"file":"select-label.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/select/select-label.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,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,MAAM,OAAO,aAAa;IACL,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAEpC,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CAAC,8BAA8B,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,iDACtD,CAAC;uGAPS,aAAa;2FAAb,aAAa,4UAVd;;GAET;;2FAQU,aAAa;kBAZzB,SAAS;mBAAC;oBACT,QAAQ,EAAE,yCAAyC;oBACnD,QAAQ,EAAE;;GAET;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,cAAc;wBAC3B,SAAS,EAAE,SAAS;qBACrB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '../../utils';\nimport { ScSelect } from './select';\n\n@Component({\n selector: 'span[scSelectLabel], div[scSelectLabel]',\n template: `\n {{ select.label() }}\n `,\n host: {\n 'data-slot': 'select-label',\n '[class]': 'class()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScSelectLabel {\n protected readonly select = inject(ScSelect);\n\n readonly classInput = input<string>('', { alias: 'class' });\n\n protected readonly class = computed(() =>\n cn('truncate pointer-events-none', this.classInput()),\n );\n}\n"]}
|
|
@@ -12,7 +12,7 @@ export class ScSelectTrigger {
|
|
|
12
12
|
select = inject(forwardRef(() => ScSelect));
|
|
13
13
|
ariaLabel = computed(() => this.select.ariaLabel(), ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
14
14
|
placeholder = computed(() => this.select.placeholder(), ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
15
|
-
class = computed(() => cn('border-input dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 flex h-8 w-full items-center justify-between gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors select-none outline-none focus-visible:ring-3 has-
|
|
15
|
+
class = computed(() => cn('border-input dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 flex h-8 w-full items-center justify-between gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors select-none outline-none focus-visible:ring-3 has-aria-disabled:cursor-not-allowed has-aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 *:data-[slot=select-label]:line-clamp-1 *:data-[slot=select-label]:flex *:data-[slot=select-label]:items-center *:data-[slot=select-label]:gap-1.5', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
16
16
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSelectTrigger, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
17
17
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: ScSelectTrigger, isStandalone: true, selector: "div[scSelectTrigger]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "select-trigger" }, properties: { "class": "class()" } }, ngImport: i0, template: `
|
|
18
18
|
<ng-content />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-trigger.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/select/select-trigger.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,MAAM,EACN,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAqC5D,2CAA2C;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;;AAjBpC,MAAM,OAAO,eAAe;IACjB,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC;IACzD,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAE3C,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,qDAAC,CAAC;IACpD,WAAW,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,uDAAC,CAAC;IAE9C,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,
|
|
1
|
+
{"version":3,"file":"select-trigger.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/select/select-trigger.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,MAAM,EACN,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAqC5D,2CAA2C;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;;AAjBpC,MAAM,OAAO,eAAe;IACjB,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC;IACzD,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAE3C,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,qDAAC,CAAC;IACpD,WAAW,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,uDAAC,CAAC;IAE9C,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,8iBAA8iB,EAC9iB,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;uGAbS,eAAe;2FAAf,eAAe,2TAhBhB;;;;;;;;GAQT,4DATS,aAAa,oFAAE,mBAAmB,wFAAE,iBAAiB;;2FAiBpD,eAAe;kBAnB3B,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,OAAO,EAAE,CAAC,aAAa,EAAE,mBAAmB,EAAE,iBAAiB,CAAC;oBAChE,QAAQ,EAAE;;;;;;;;GAQT;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,gBAAgB;wBAC7B,SAAS,EAAE,SAAS;qBACrB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n forwardRef,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { SiChevronDownIcon } from '@semantic-icons/lucide-icons';\nimport { cn } from '../../utils';\n\nimport { ScSelectInput } from './select-input';\nimport { ScSelectTriggerIcon } from './select-trigger-icon';\n\n@Component({\n selector: 'div[scSelectTrigger]',\n imports: [ScSelectInput, ScSelectTriggerIcon, SiChevronDownIcon],\n template: `\n <ng-content />\n <input\n scSelectInput\n [attr.aria-label]=\"ariaLabel()\"\n [placeholder]=\"placeholder()\"\n />\n <svg scSelectTriggerIcon siChevronDownIcon aria-hidden=\"true\"></svg>\n `,\n host: {\n 'data-slot': 'select-trigger',\n '[class]': 'class()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScSelectTrigger {\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly classInput = input<string>('', { alias: 'class' });\n\n private readonly select = inject(forwardRef(() => ScSelect));\n readonly ariaLabel = computed(() => this.select.ariaLabel());\n readonly placeholder = computed(() => this.select.placeholder());\n\n protected readonly class = computed(() =>\n cn(\n 'border-input dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 flex h-8 w-full items-center justify-between gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors select-none outline-none focus-visible:ring-3 has-aria-disabled:cursor-not-allowed has-aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 *:data-[slot=select-label]:line-clamp-1 *:data-[slot=select-label]:flex *:data-[slot=select-label]:items-center *:data-[slot=select-label]:gap-1.5',\n this.classInput(),\n ),\n );\n}\n\n// Lazy import to avoid circular dependency\nimport { ScSelect } from './select';\n"]}
|
|
@@ -47,7 +47,6 @@ export class ScSelect {
|
|
|
47
47
|
<ng-template ngComboboxPopupContainer>
|
|
48
48
|
@if (origin(); as origin) {
|
|
49
49
|
<ng-template
|
|
50
|
-
cdkConnectedOverlay
|
|
51
50
|
[cdkConnectedOverlay]="{
|
|
52
51
|
origin,
|
|
53
52
|
usePopover: 'inline',
|
|
@@ -78,7 +77,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
78
77
|
<ng-template ngComboboxPopupContainer>
|
|
79
78
|
@if (origin(); as origin) {
|
|
80
79
|
<ng-template
|
|
81
|
-
cdkConnectedOverlay
|
|
82
80
|
[cdkConnectedOverlay]="{
|
|
83
81
|
origin,
|
|
84
82
|
usePopover: 'inline',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/select/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,MAAM,EACN,KAAK,EACL,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/select/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,MAAM,EACN,KAAK,EACL,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OA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,MAAM;iBAChD;kiBAOyC,eAAe,yFACf,YAAY,QAAE;4BACpD,WAAW,EAAE,IAAI;yBAClB,2FACuD,cAAc","sourcesContent":["import { Combobox, ComboboxPopupContainer } from '@angular/aria/combobox';\nimport { OverlayModule } from '@angular/cdk/overlay';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n effect,\n inject,\n input,\n model,\n ViewEncapsulation,\n} from '@angular/core';\nimport { SIGNAL, signalSetFn } from '@angular/core/primitives/signals';\nimport type { FormValueControl } from '@angular/forms/signals';\nimport { cn } from '../../utils';\nimport { ScSelectList } from './select-list';\nimport { ScSelectPortal } from './select-portal';\nimport { ScSelectTrigger } from './select-trigger';\n\n@Component({\n selector: 'div[scSelect]',\n exportAs: 'scSelect',\n imports: [Combobox, ComboboxPopupContainer, OverlayModule, NgTemplateOutlet],\n hostDirectives: [\n {\n directive: Combobox,\n inputs: ['disabled'],\n },\n ],\n template: `\n <ng-content />\n <ng-template ngComboboxPopupContainer>\n @if (origin(); as origin) {\n <ng-template\n [cdkConnectedOverlay]=\"{\n origin,\n usePopover: 'inline',\n matchWidth: true,\n }\"\n [cdkConnectedOverlayOpen]=\"true\"\n >\n <ng-container [ngTemplateOutlet]=\"selectPortal().templateRef\" />\n </ng-template>\n }\n </ng-template>\n `,\n host: {\n 'data-slot': 'select',\n '[class]': 'class()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScSelect implements FormValueControl<unknown> {\n readonly classInput = input<string>('', { alias: 'class' });\n readonly placeholder = input.required<string>();\n readonly ariaLabel = input.required<string>({ alias: 'aria-label' });\n readonly value = model<unknown>(undefined);\n\n private readonly trigger = contentChild(ScSelectTrigger);\n private readonly content = contentChild(ScSelectList, {\n descendants: true,\n });\n protected readonly selectPortal = contentChild.required(ScSelectPortal);\n\n readonly origin = computed(() => this.trigger()?.elementRef);\n readonly values = computed(() => this.content()?.values() ?? []);\n readonly label = computed(() => {\n const value = this.value();\n if (value == null) return this.placeholder();\n const list = this.content();\n if (list) {\n return list.labelForValue(value);\n }\n return String(value);\n });\n protected readonly class = computed(() =>\n cn('relative min-w-36 w-fit', this.classInput()),\n );\n\n protected readonly combobox = inject(Combobox);\n\n constructor() {\n effect(() => signalSetFn(this.combobox.readonly[SIGNAL], true));\n\n // Sync listbox selection → model\n effect(() => {\n const vals = this.values();\n const selected = vals.length > 0 ? vals[0] : undefined;\n this.value.set(selected);\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export { ScSidebarProvider } from './sidebar-provider';
|
|
2
|
+
export { ScSidebar } from './sidebar';
|
|
3
|
+
export { ScSidebarContainer } from './sidebar-container';
|
|
4
|
+
export { ScSidebarGap } from './sidebar-gap';
|
|
5
|
+
export { ScSidebarInner } from './sidebar-inner';
|
|
6
|
+
export { ScSidebarTrigger } from './sidebar-trigger';
|
|
7
|
+
export { ScSidebarRail } from './sidebar-rail';
|
|
8
|
+
export { ScSidebarInset } from './sidebar-inset';
|
|
9
|
+
export { ScSidebarHeader } from './sidebar-header';
|
|
10
|
+
export { ScSidebarFooter } from './sidebar-footer';
|
|
11
|
+
export { ScSidebarBody } from './sidebar-body';
|
|
12
|
+
export { ScSidebarSeparator } from './sidebar-separator';
|
|
13
|
+
export { ScSidebarInput } from './sidebar-input';
|
|
14
|
+
export { ScSidebarGroup } from './sidebar-group';
|
|
15
|
+
export { ScSidebarGroupLabel } from './sidebar-group-label';
|
|
16
|
+
export { ScSidebarGroupAction } from './sidebar-group-action';
|
|
17
|
+
export { ScSidebarGroupContent } from './sidebar-group-content';
|
|
18
|
+
export { ScSidebarMenu } from './sidebar-menu';
|
|
19
|
+
export { ScSidebarMenuItem } from './sidebar-menu-item';
|
|
20
|
+
export { ScSidebarMenuButton } from './sidebar-menu-button';
|
|
21
|
+
export { ScSidebarMenuAction } from './sidebar-menu-action';
|
|
22
|
+
export { ScSidebarMenuBadge } from './sidebar-menu-badge';
|
|
23
|
+
export { ScSidebarMenuSkeleton } from './sidebar-menu-skeleton';
|
|
24
|
+
export { ScSidebarMenuSub } from './sidebar-menu-sub';
|
|
25
|
+
export { ScSidebarMenuSubItem } from './sidebar-menu-sub-item';
|
|
26
|
+
export { ScSidebarMenuSubButton } from './sidebar-menu-sub-button';
|
|
27
|
+
export { ScSidebarState } from './sidebar-state';
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/sidebar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { ScSidebarProvider } from './sidebar-provider';\nexport { ScSidebar } from './sidebar';\nexport { ScSidebarContainer } from './sidebar-container';\nexport { ScSidebarGap } from './sidebar-gap';\nexport { ScSidebarInner } from './sidebar-inner';\nexport { ScSidebarTrigger } from './sidebar-trigger';\nexport { ScSidebarRail } from './sidebar-rail';\nexport { ScSidebarInset } from './sidebar-inset';\nexport { ScSidebarHeader } from './sidebar-header';\nexport { ScSidebarFooter } from './sidebar-footer';\nexport { ScSidebarBody } from './sidebar-body';\nexport { ScSidebarSeparator } from './sidebar-separator';\nexport { ScSidebarInput } from './sidebar-input';\nexport { ScSidebarGroup } from './sidebar-group';\nexport { ScSidebarGroupLabel } from './sidebar-group-label';\nexport { ScSidebarGroupAction } from './sidebar-group-action';\nexport { ScSidebarGroupContent } from './sidebar-group-content';\nexport { ScSidebarMenu } from './sidebar-menu';\nexport { ScSidebarMenuItem } from './sidebar-menu-item';\nexport { ScSidebarMenuButton } from './sidebar-menu-button';\nexport { ScSidebarMenuAction } from './sidebar-menu-action';\nexport { ScSidebarMenuBadge } from './sidebar-menu-badge';\nexport { ScSidebarMenuSkeleton } from './sidebar-menu-skeleton';\nexport { ScSidebarMenuSub } from './sidebar-menu-sub';\nexport { ScSidebarMenuSubItem } from './sidebar-menu-sub-item';\nexport { ScSidebarMenuSubButton } from './sidebar-menu-sub-button';\nexport { ScSidebarState } from './sidebar-state';\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 ScSidebarBody {
|
|
5
|
+
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
6
|
+
class = computed(() => cn('no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
7
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarBody, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
8
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ScSidebarBody, isStandalone: true, selector: "div[scSidebarBody]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-body" }, properties: { "class": "class()" } }, ngImport: i0 });
|
|
9
|
+
}
|
|
10
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarBody, decorators: [{
|
|
11
|
+
type: Directive,
|
|
12
|
+
args: [{
|
|
13
|
+
selector: 'div[scSidebarBody]',
|
|
14
|
+
host: {
|
|
15
|
+
'data-slot': 'sidebar-body',
|
|
16
|
+
'[class]': 'class()',
|
|
17
|
+
},
|
|
18
|
+
}]
|
|
19
|
+
}], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
20
|
+
//# sourceMappingURL=sidebar-body.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-body.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/sidebar/sidebar-body.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,aAAa;IACf,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,6GAA6G,EAC7G,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;uGARS,aAAa;2FAAb,aAAa;;2FAAb,aAAa;kBAPzB,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;oBAC9B,IAAI,EAAE;wBACJ,WAAW,EAAE,cAAc;wBAC3B,SAAS,EAAE,SAAS;qBACrB;iBACF","sourcesContent":["import { Directive, computed, input } from '@angular/core';\nimport { cn } from '../../utils';\n\n@Directive({\n selector: 'div[scSidebarBody]',\n host: {\n 'data-slot': 'sidebar-body',\n '[class]': 'class()',\n },\n})\nexport class ScSidebarBody {\n readonly classInput = input<string>('', { alias: 'class' });\n\n protected readonly class = computed(() =>\n cn(\n 'no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden',\n this.classInput(),\n ),\n );\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
|
+
import { cn } from '../../utils';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export class ScSidebarContainer {
|
|
5
|
+
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
6
|
+
variant = input('sidebar', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
7
|
+
class = computed(() => {
|
|
8
|
+
const variant = this.variant();
|
|
9
|
+
return cn('fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex', '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)]', variant === 'floating' || variant === 'inset'
|
|
10
|
+
? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]'
|
|
11
|
+
: 'group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l', this.classInput());
|
|
12
|
+
}, ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
13
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarContainer, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
14
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ScSidebarContainer, isStandalone: true, selector: "div[scSidebarContainer]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-container" }, properties: { "class": "class()" } }, ngImport: i0 });
|
|
15
|
+
}
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarContainer, decorators: [{
|
|
17
|
+
type: Directive,
|
|
18
|
+
args: [{
|
|
19
|
+
selector: 'div[scSidebarContainer]',
|
|
20
|
+
host: {
|
|
21
|
+
'data-slot': 'sidebar-container',
|
|
22
|
+
'[class]': 'class()',
|
|
23
|
+
},
|
|
24
|
+
}]
|
|
25
|
+
}], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
|
|
26
|
+
//# sourceMappingURL=sidebar-container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-container.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/sidebar/sidebar-container.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;IAEnD,OAAO,GAAG,KAAK,CAAmC,SAAS,mDAAC,CAAC;IAEnD,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAE/B,OAAO,EAAE,CACP,sHAAsH,EACtH,kHAAkH,EAClH,sHAAsH,EACtH,OAAO,KAAK,UAAU,IAAI,OAAO,KAAK,OAAO;YAC3C,CAAC,CAAC,0FAA0F;YAC5F,CAAC,CAAC,yHAAyH,EAC7H,IAAI,CAAC,UAAU,EAAE,CAClB,CAAC;IACJ,CAAC,iDAAC,CAAC;uGAjBQ,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[scSidebarContainer]',\n host: {\n 'data-slot': 'sidebar-container',\n '[class]': 'class()',\n },\n})\nexport class ScSidebarContainer {\n readonly classInput = input<string>('', { alias: 'class' });\n\n readonly variant = input<'sidebar' | 'floating' | 'inset'>('sidebar');\n\n protected readonly class = computed(() => {\n const variant = this.variant();\n\n return cn(\n 'fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex',\n 'data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]',\n 'data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',\n variant === 'floating' || variant === 'inset'\n ? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]'\n : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l',\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 ScSidebarFooter {
|
|
5
|
+
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
6
|
+
class = computed(() => cn('flex flex-col gap-2 p-2', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
7
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarFooter, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
8
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ScSidebarFooter, isStandalone: true, selector: "div[scSidebarFooter]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-footer" }, properties: { "class": "class()" } }, ngImport: i0 });
|
|
9
|
+
}
|
|
10
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarFooter, decorators: [{
|
|
11
|
+
type: Directive,
|
|
12
|
+
args: [{
|
|
13
|
+
selector: 'div[scSidebarFooter]',
|
|
14
|
+
host: {
|
|
15
|
+
'data-slot': 'sidebar-footer',
|
|
16
|
+
'[class]': 'class()',
|
|
17
|
+
},
|
|
18
|
+
}]
|
|
19
|
+
}], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
20
|
+
//# sourceMappingURL=sidebar-footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-footer.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/sidebar/sidebar-footer.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,eAAe;IACjB,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CAAC,yBAAyB,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,iDACjD,CAAC;uGALS,eAAe;2FAAf,eAAe;;2FAAf,eAAe;kBAP3B,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,IAAI,EAAE;wBACJ,WAAW,EAAE,gBAAgB;wBAC7B,SAAS,EAAE,SAAS;qBACrB;iBACF","sourcesContent":["import { Directive, computed, input } from '@angular/core';\nimport { cn } from '../../utils';\n\n@Directive({\n selector: 'div[scSidebarFooter]',\n host: {\n 'data-slot': 'sidebar-footer',\n '[class]': 'class()',\n },\n})\nexport class ScSidebarFooter {\n readonly classInput = input<string>('', { alias: 'class' });\n\n protected readonly class = computed(() =>\n cn('flex flex-col gap-2 p-2', this.classInput()),\n );\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
|
+
import { cn } from '../../utils';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export class ScSidebarGap {
|
|
5
|
+
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
6
|
+
variant = input('sidebar', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
7
|
+
class = computed(() => cn('relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear', 'group-data-[collapsible=offcanvas]:w-0', 'group-data-[side=right]:rotate-180', this.variant() === 'floating' || this.variant() === 'inset'
|
|
8
|
+
? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]'
|
|
9
|
+
: 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
10
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarGap, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
11
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ScSidebarGap, isStandalone: true, selector: "div[scSidebarGap]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-gap" }, properties: { "class": "class()" } }, ngImport: i0 });
|
|
12
|
+
}
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarGap, decorators: [{
|
|
14
|
+
type: Directive,
|
|
15
|
+
args: [{
|
|
16
|
+
selector: 'div[scSidebarGap]',
|
|
17
|
+
host: {
|
|
18
|
+
'data-slot': 'sidebar-gap',
|
|
19
|
+
'[class]': 'class()',
|
|
20
|
+
},
|
|
21
|
+
}]
|
|
22
|
+
}], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
|
|
23
|
+
//# sourceMappingURL=sidebar-gap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-gap.js","sourceRoot":"","sources":["../../../../../../../libs/ui/src/lib/components/sidebar/sidebar-gap.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,YAAY;IACd,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEnD,OAAO,GAAG,KAAK,CAAmC,SAAS,mDAAC,CAAC;IAEnD,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,yFAAyF,EACzF,wCAAwC,EACxC,oCAAoC,EACpC,IAAI,CAAC,OAAO,EAAE,KAAK,UAAU,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,OAAO;QACzD,CAAC,CAAC,kFAAkF;QACpF,CAAC,CAAC,wDAAwD,EAC5D,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;uGAfS,YAAY;2FAAZ,YAAY;;2FAAZ,YAAY;kBAPxB,SAAS;mBAAC;oBACT,QAAQ,EAAE,mBAAmB;oBAC7B,IAAI,EAAE;wBACJ,WAAW,EAAE,aAAa;wBAC1B,SAAS,EAAE,SAAS;qBACrB;iBACF","sourcesContent":["import { Directive, computed, input } from '@angular/core';\nimport { cn } from '../../utils';\n\n@Directive({\n selector: 'div[scSidebarGap]',\n host: {\n 'data-slot': 'sidebar-gap',\n '[class]': 'class()',\n },\n})\nexport class ScSidebarGap {\n readonly classInput = input<string>('', { alias: 'class' });\n\n readonly variant = input<'sidebar' | 'floating' | 'inset'>('sidebar');\n\n protected readonly class = computed(() =>\n cn(\n 'relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear',\n 'group-data-[collapsible=offcanvas]:w-0',\n 'group-data-[side=right]:rotate-180',\n this.variant() === 'floating' || this.variant() === 'inset'\n ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]'\n : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)',\n this.classInput(),\n ),\n );\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
|
+
import { cn } from '../../utils';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export class ScSidebarGroupAction {
|
|
5
|
+
classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
|
|
6
|
+
asChild = input(false, ...(ngDevMode ? [{ debugName: "asChild" }] : []));
|
|
7
|
+
class = computed(() => cn('absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0', 'after:absolute after:-inset-2 md:after:hidden', 'group-data-[collapsible=icon]:hidden', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
8
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarGroupAction, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
9
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ScSidebarGroupAction, isStandalone: true, selector: "button[scSidebarGroupAction]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, asChild: { classPropertyName: "asChild", publicName: "asChild", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-group-action" }, properties: { "class": "class()" } }, ngImport: i0 });
|
|
10
|
+
}
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ScSidebarGroupAction, decorators: [{
|
|
12
|
+
type: Directive,
|
|
13
|
+
args: [{
|
|
14
|
+
selector: 'button[scSidebarGroupAction]',
|
|
15
|
+
host: {
|
|
16
|
+
'data-slot': 'sidebar-group-action',
|
|
17
|
+
'[class]': 'class()',
|
|
18
|
+
},
|
|
19
|
+
}]
|
|
20
|
+
}], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], asChild: [{ type: i0.Input, args: [{ isSignal: true, alias: "asChild", required: false }] }] } });
|
|
21
|
+
//# sourceMappingURL=sidebar-group-action.js.map
|