@m1z23r/ngx-ui 1.1.12 → 1.1.13
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/fesm2022/m1z23r-ngx-ui.mjs +409 -8
- package/fesm2022/m1z23r-ngx-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/m1z23r-ngx-ui.d.ts +121 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, PLATFORM_ID, signal, Injectable, computed, InjectionToken, ApplicationRef, EnvironmentInjector, createComponent, Injector, input, output, ChangeDetectionStrategy, Component, ElementRef, HostListener, effect, Directive, model, Pipe, contentChildren, ViewChild, TemplateRef, contentChild, viewChild } from '@angular/core';
|
|
3
|
-
import { isPlatformBrowser, NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import { inject, PLATFORM_ID, signal, Injectable, computed, InjectionToken, ApplicationRef, EnvironmentInjector, createComponent, Injector, input, output, ChangeDetectionStrategy, Component, ElementRef, HostListener, effect, Directive, model, Pipe, contentChildren, ViewChild, TemplateRef, contentChild, viewChild, DestroyRef } from '@angular/core';
|
|
3
|
+
import { isPlatformBrowser, NgTemplateOutlet, DOCUMENT, DecimalPipe } from '@angular/common';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { FormsModule } from '@angular/forms';
|
|
6
6
|
|
|
@@ -1444,6 +1444,7 @@ class DropdownComponent {
|
|
|
1444
1444
|
menuRef;
|
|
1445
1445
|
elementRef = inject(ElementRef);
|
|
1446
1446
|
positionCleanup = null;
|
|
1447
|
+
contextMenuPosition = null;
|
|
1447
1448
|
trigger = contentChild(DropdownTriggerDirective, ...(ngDevMode ? [{ debugName: "trigger" }] : []));
|
|
1448
1449
|
items = contentChildren(DropdownItemComponent, ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
1449
1450
|
constructor() {
|
|
@@ -1529,6 +1530,17 @@ class DropdownComponent {
|
|
|
1529
1530
|
open() {
|
|
1530
1531
|
if (this.isOpen())
|
|
1531
1532
|
return;
|
|
1533
|
+
this.contextMenuPosition = null;
|
|
1534
|
+
this.isOpen.set(true);
|
|
1535
|
+
this.focusedIndex.set(-1);
|
|
1536
|
+
this.portalMenu();
|
|
1537
|
+
}
|
|
1538
|
+
/** Opens the dropdown at specific coordinates (for context menus) */
|
|
1539
|
+
openAt(x, y) {
|
|
1540
|
+
if (this.isOpen()) {
|
|
1541
|
+
this.close();
|
|
1542
|
+
}
|
|
1543
|
+
this.contextMenuPosition = { x, y };
|
|
1532
1544
|
this.isOpen.set(true);
|
|
1533
1545
|
this.focusedIndex.set(-1);
|
|
1534
1546
|
this.portalMenu();
|
|
@@ -1539,6 +1551,7 @@ class DropdownComponent {
|
|
|
1539
1551
|
this.unportalMenu();
|
|
1540
1552
|
this.isOpen.set(false);
|
|
1541
1553
|
this.focusedIndex.set(-1);
|
|
1554
|
+
this.contextMenuPosition = null;
|
|
1542
1555
|
}
|
|
1543
1556
|
focusNext() {
|
|
1544
1557
|
const menuItems = this.items();
|
|
@@ -1593,9 +1606,29 @@ class DropdownComponent {
|
|
|
1593
1606
|
this.removePositionListeners();
|
|
1594
1607
|
}
|
|
1595
1608
|
updateMenuPosition() {
|
|
1596
|
-
const trigger = this.triggerRef?.nativeElement;
|
|
1597
1609
|
const menu = this.menuRef?.nativeElement;
|
|
1598
|
-
if (!
|
|
1610
|
+
if (!menu)
|
|
1611
|
+
return;
|
|
1612
|
+
menu.style.position = 'fixed';
|
|
1613
|
+
menu.style.zIndex = '99999';
|
|
1614
|
+
menu.style.margin = '0';
|
|
1615
|
+
// Context menu mode: position at cursor
|
|
1616
|
+
if (this.contextMenuPosition) {
|
|
1617
|
+
const { x, y } = this.contextMenuPosition;
|
|
1618
|
+
const menuWidth = menu.scrollWidth;
|
|
1619
|
+
const menuHeight = menu.scrollHeight;
|
|
1620
|
+
// Adjust if menu would go off-screen
|
|
1621
|
+
const adjustedX = x + menuWidth > window.innerWidth ? window.innerWidth - menuWidth - 4 : x;
|
|
1622
|
+
const adjustedY = y + menuHeight > window.innerHeight ? window.innerHeight - menuHeight - 4 : y;
|
|
1623
|
+
menu.style.left = `${Math.max(4, adjustedX)}px`;
|
|
1624
|
+
menu.style.top = `${Math.max(4, adjustedY)}px`;
|
|
1625
|
+
menu.style.right = 'auto';
|
|
1626
|
+
menu.style.bottom = 'auto';
|
|
1627
|
+
return;
|
|
1628
|
+
}
|
|
1629
|
+
// Standard dropdown mode: position relative to trigger
|
|
1630
|
+
const trigger = this.triggerRef?.nativeElement;
|
|
1631
|
+
if (!trigger)
|
|
1599
1632
|
return;
|
|
1600
1633
|
const triggerRect = trigger.getBoundingClientRect();
|
|
1601
1634
|
const menuHeight = menu.scrollHeight;
|
|
@@ -1607,9 +1640,6 @@ class DropdownComponent {
|
|
|
1607
1640
|
? spaceAbove >= menuHeight + gap || spaceAbove > spaceBelow
|
|
1608
1641
|
: spaceBelow < menuHeight + gap && spaceAbove > spaceBelow;
|
|
1609
1642
|
const alignEnd = this.position().endsWith('end');
|
|
1610
|
-
menu.style.position = 'fixed';
|
|
1611
|
-
menu.style.zIndex = '99999';
|
|
1612
|
-
menu.style.margin = '0';
|
|
1613
1643
|
if (openAbove) {
|
|
1614
1644
|
menu.style.top = 'auto';
|
|
1615
1645
|
menu.style.bottom = `${window.innerHeight - triggerRect.top + gap}px`;
|
|
@@ -1676,6 +1706,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
1676
1706
|
args: [{ selector: 'ui-dropdown-divider', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ui-dropdown-divider\" role=\"separator\"></div>\n", styles: [":host{display:block}.ui-dropdown-divider{height:1px;margin:var(--ui-spacing-xs) 0;background-color:var(--ui-border)}\n"] }]
|
|
1677
1707
|
}] });
|
|
1678
1708
|
|
|
1709
|
+
class ContextMenuDirective {
|
|
1710
|
+
uiContextMenu = input.required(...(ngDevMode ? [{ debugName: "uiContextMenu" }] : []));
|
|
1711
|
+
onContextMenu(event) {
|
|
1712
|
+
event.preventDefault();
|
|
1713
|
+
event.stopPropagation();
|
|
1714
|
+
this.uiContextMenu().openAt(event.clientX, event.clientY);
|
|
1715
|
+
}
|
|
1716
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ContextMenuDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1717
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: ContextMenuDirective, isStandalone: true, selector: "[uiContextMenu]", inputs: { uiContextMenu: { classPropertyName: "uiContextMenu", publicName: "uiContextMenu", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "contextmenu": "onContextMenu($event)" } }, ngImport: i0 });
|
|
1718
|
+
}
|
|
1719
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ContextMenuDirective, decorators: [{
|
|
1720
|
+
type: Directive,
|
|
1721
|
+
args: [{
|
|
1722
|
+
selector: '[uiContextMenu]',
|
|
1723
|
+
standalone: true,
|
|
1724
|
+
}]
|
|
1725
|
+
}], propDecorators: { uiContextMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiContextMenu", required: true }] }], onContextMenu: [{
|
|
1726
|
+
type: HostListener,
|
|
1727
|
+
args: ['contextmenu', ['$event']]
|
|
1728
|
+
}] } });
|
|
1729
|
+
|
|
1679
1730
|
class CheckboxComponent {
|
|
1680
1731
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1681
1732
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
@@ -4727,6 +4778,356 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
4727
4778
|
args: [{ selector: 'ui-sidebar-toggle', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<button class=\"ui-sidebar-toggle\"\n type=\"button\"\n [class.ui-sidebar-toggle--mobile-only]=\"mobileOnly()\"\n [attr.aria-expanded]=\"sidebarService.isMobile() ? sidebarService.mobileOpen() : !sidebarService.collapsed()\"\n aria-label=\"Toggle sidebar\"\n (click)=\"sidebarService.toggle()\">\n <svg class=\"ui-sidebar-toggle__icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\">\n <line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\" />\n <line x1=\"3\" y1=\"12\" x2=\"21\" y2=\"12\" />\n <line x1=\"3\" y1=\"18\" x2=\"21\" y2=\"18\" />\n </svg>\n</button>\n", styles: [".ui-sidebar-toggle{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;background:transparent;border:none;border-radius:var(--ui-radius-md);cursor:pointer;color:var(--ui-text);transition:background-color var(--ui-transition-fast)}.ui-sidebar-toggle:hover{background-color:var(--ui-bg-hover)}.ui-sidebar-toggle:focus-visible{outline:2px solid var(--ui-primary);outline-offset:2px}.ui-sidebar-toggle__icon{width:24px;height:24px}.ui-sidebar-toggle--mobile-only{display:none}@media(max-width:767px){.ui-sidebar-toggle--mobile-only{display:inline-flex}}\n"] }]
|
|
4728
4779
|
}], propDecorators: { mobileOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "mobileOnly", required: false }] }] } });
|
|
4729
4780
|
|
|
4781
|
+
class SplitPaneComponent {
|
|
4782
|
+
size = input(undefined, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
4783
|
+
minSize = input(0, ...(ngDevMode ? [{ debugName: "minSize" }] : []));
|
|
4784
|
+
maxSize = input(100, ...(ngDevMode ? [{ debugName: "maxSize" }] : []));
|
|
4785
|
+
/** @internal */
|
|
4786
|
+
_index = signal(0, ...(ngDevMode ? [{ debugName: "_index" }] : []));
|
|
4787
|
+
/** @internal */
|
|
4788
|
+
_computedSize = signal(0, ...(ngDevMode ? [{ debugName: "_computedSize" }] : []));
|
|
4789
|
+
_parent = null;
|
|
4790
|
+
elementRef = inject(ElementRef);
|
|
4791
|
+
flexStyle = computed(() => {
|
|
4792
|
+
const size = this._computedSize();
|
|
4793
|
+
return `0 0 ${size}%`;
|
|
4794
|
+
}, ...(ngDevMode ? [{ debugName: "flexStyle" }] : []));
|
|
4795
|
+
orderStyle = computed(() => {
|
|
4796
|
+
return this._index() * 2;
|
|
4797
|
+
}, ...(ngDevMode ? [{ debugName: "orderStyle" }] : []));
|
|
4798
|
+
/** @internal */
|
|
4799
|
+
_setParent(parent, index) {
|
|
4800
|
+
this._parent = parent;
|
|
4801
|
+
this._index.set(index);
|
|
4802
|
+
}
|
|
4803
|
+
/** @internal */
|
|
4804
|
+
_setComputedSize(size) {
|
|
4805
|
+
this._computedSize.set(size);
|
|
4806
|
+
}
|
|
4807
|
+
/** @internal */
|
|
4808
|
+
_getParent() {
|
|
4809
|
+
return this._parent;
|
|
4810
|
+
}
|
|
4811
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SplitPaneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4812
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.1", type: SplitPaneComponent, isStandalone: true, selector: "ui-split-pane", inputs: { size: { classPropertyName: "size", publicName: "size", 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: { properties: { "style.flex": "flexStyle()", "style.order": "orderStyle()" }, classAttribute: "ui-split-pane" }, ngImport: i0, template: "<ng-content />\n", styles: [":host{display:block;overflow:auto;min-width:0;min-height:0;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4813
|
+
}
|
|
4814
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SplitPaneComponent, decorators: [{
|
|
4815
|
+
type: Component,
|
|
4816
|
+
args: [{ selector: 'ui-split-pane', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
4817
|
+
class: 'ui-split-pane',
|
|
4818
|
+
'[style.flex]': 'flexStyle()',
|
|
4819
|
+
'[style.order]': 'orderStyle()',
|
|
4820
|
+
}, template: "<ng-content />\n", styles: [":host{display:block;overflow:auto;min-width:0;min-height:0;height:100%}\n"] }]
|
|
4821
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], minSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "minSize", required: false }] }], maxSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSize", required: false }] }] } });
|
|
4822
|
+
|
|
4823
|
+
class SplitComponent {
|
|
4824
|
+
orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
4825
|
+
gutterSize = input('md', ...(ngDevMode ? [{ debugName: "gutterSize" }] : []));
|
|
4826
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
4827
|
+
sizeChange = output();
|
|
4828
|
+
dragStart = output();
|
|
4829
|
+
dragEnd = output();
|
|
4830
|
+
panes = contentChildren(SplitPaneComponent, ...(ngDevMode ? [{ debugName: "panes" }] : []));
|
|
4831
|
+
isDragging = signal(false, ...(ngDevMode ? [{ debugName: "isDragging" }] : []));
|
|
4832
|
+
paneSizes = signal([], ...(ngDevMode ? [{ debugName: "paneSizes" }] : []));
|
|
4833
|
+
gutterIndices = computed(() => {
|
|
4834
|
+
const count = this.panes().length;
|
|
4835
|
+
return count > 1 ? Array.from({ length: count - 1 }, (_, i) => i) : [];
|
|
4836
|
+
}, ...(ngDevMode ? [{ debugName: "gutterIndices" }] : []));
|
|
4837
|
+
elementRef = inject(ElementRef);
|
|
4838
|
+
platformId = inject(PLATFORM_ID);
|
|
4839
|
+
document = inject(DOCUMENT);
|
|
4840
|
+
destroyRef = inject(DestroyRef);
|
|
4841
|
+
dragGutterIndex = -1;
|
|
4842
|
+
dragStartPos = 0;
|
|
4843
|
+
dragStartSizes = [];
|
|
4844
|
+
mouseMoveHandler = (e) => this.onMouseMove(e);
|
|
4845
|
+
mouseUpHandler = () => this.onMouseUp();
|
|
4846
|
+
constructor() {
|
|
4847
|
+
// Single effect to handle pane setup and size distribution
|
|
4848
|
+
effect(() => {
|
|
4849
|
+
const paneList = this.panes();
|
|
4850
|
+
if (paneList.length === 0)
|
|
4851
|
+
return;
|
|
4852
|
+
// Set parent reference and index on each pane
|
|
4853
|
+
paneList.forEach((pane, index) => {
|
|
4854
|
+
pane._setParent(this, index);
|
|
4855
|
+
});
|
|
4856
|
+
// Calculate sizes based on inputs
|
|
4857
|
+
const sizes = this.calculateSizes(paneList);
|
|
4858
|
+
// Apply sizes to each pane
|
|
4859
|
+
sizes.forEach((size, index) => {
|
|
4860
|
+
paneList[index]._setComputedSize(size);
|
|
4861
|
+
});
|
|
4862
|
+
// Store sizes for drag operations
|
|
4863
|
+
this.paneSizes.set(sizes);
|
|
4864
|
+
});
|
|
4865
|
+
this.destroyRef.onDestroy(() => {
|
|
4866
|
+
this.cleanupListeners();
|
|
4867
|
+
});
|
|
4868
|
+
}
|
|
4869
|
+
gutterSizeClass = computed(() => {
|
|
4870
|
+
return `ui-split__gutter--${this.gutterSize()}`;
|
|
4871
|
+
}, ...(ngDevMode ? [{ debugName: "gutterSizeClass" }] : []));
|
|
4872
|
+
onGutterMouseDown(event, gutterIndex) {
|
|
4873
|
+
if (this.disabled())
|
|
4874
|
+
return;
|
|
4875
|
+
event.preventDefault();
|
|
4876
|
+
this.dragGutterIndex = gutterIndex;
|
|
4877
|
+
this.dragStartPos = this.orientation() === 'horizontal' ? event.clientX : event.clientY;
|
|
4878
|
+
this.dragStartSizes = [...this.paneSizes()];
|
|
4879
|
+
this.isDragging.set(true);
|
|
4880
|
+
this.dragStart.emit(gutterIndex);
|
|
4881
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
4882
|
+
this.document.addEventListener('mousemove', this.mouseMoveHandler);
|
|
4883
|
+
this.document.addEventListener('mouseup', this.mouseUpHandler);
|
|
4884
|
+
}
|
|
4885
|
+
}
|
|
4886
|
+
onGutterKeyDown(event, gutterIndex) {
|
|
4887
|
+
if (this.disabled())
|
|
4888
|
+
return;
|
|
4889
|
+
const step = 1;
|
|
4890
|
+
const sizes = [...this.paneSizes()];
|
|
4891
|
+
const paneList = this.panes();
|
|
4892
|
+
const leftPane = paneList[gutterIndex];
|
|
4893
|
+
const rightPane = paneList[gutterIndex + 1];
|
|
4894
|
+
let delta = 0;
|
|
4895
|
+
switch (event.key) {
|
|
4896
|
+
case 'ArrowLeft':
|
|
4897
|
+
case 'ArrowUp':
|
|
4898
|
+
event.preventDefault();
|
|
4899
|
+
delta = -step;
|
|
4900
|
+
break;
|
|
4901
|
+
case 'ArrowRight':
|
|
4902
|
+
case 'ArrowDown':
|
|
4903
|
+
event.preventDefault();
|
|
4904
|
+
delta = step;
|
|
4905
|
+
break;
|
|
4906
|
+
case 'Home':
|
|
4907
|
+
event.preventDefault();
|
|
4908
|
+
delta = -(sizes[gutterIndex] - leftPane.minSize());
|
|
4909
|
+
break;
|
|
4910
|
+
case 'End':
|
|
4911
|
+
event.preventDefault();
|
|
4912
|
+
delta = sizes[gutterIndex + 1] - rightPane.minSize();
|
|
4913
|
+
break;
|
|
4914
|
+
default:
|
|
4915
|
+
return;
|
|
4916
|
+
}
|
|
4917
|
+
const newLeftSize = Math.max(leftPane.minSize(), Math.min(leftPane.maxSize(), sizes[gutterIndex] + delta));
|
|
4918
|
+
const actualDelta = newLeftSize - sizes[gutterIndex];
|
|
4919
|
+
const newRightSize = Math.max(rightPane.minSize(), Math.min(rightPane.maxSize(), sizes[gutterIndex + 1] - actualDelta));
|
|
4920
|
+
sizes[gutterIndex] = newLeftSize;
|
|
4921
|
+
sizes[gutterIndex + 1] = newRightSize;
|
|
4922
|
+
this.paneSizes.set(sizes);
|
|
4923
|
+
leftPane._setComputedSize(newLeftSize);
|
|
4924
|
+
rightPane._setComputedSize(newRightSize);
|
|
4925
|
+
this.sizeChange.emit({ gutterIndex, sizes: [...sizes] });
|
|
4926
|
+
}
|
|
4927
|
+
onMouseMove(event) {
|
|
4928
|
+
if (!this.isDragging())
|
|
4929
|
+
return;
|
|
4930
|
+
const container = this.elementRef.nativeElement;
|
|
4931
|
+
const containerRect = container.getBoundingClientRect();
|
|
4932
|
+
const containerSize = this.orientation() === 'horizontal' ? containerRect.width : containerRect.height;
|
|
4933
|
+
const currentPos = this.orientation() === 'horizontal' ? event.clientX : event.clientY;
|
|
4934
|
+
const deltaPixels = currentPos - this.dragStartPos;
|
|
4935
|
+
const deltaPercent = (deltaPixels / containerSize) * 100;
|
|
4936
|
+
const paneList = this.panes();
|
|
4937
|
+
const leftPane = paneList[this.dragGutterIndex];
|
|
4938
|
+
const rightPane = paneList[this.dragGutterIndex + 1];
|
|
4939
|
+
let newLeftSize = this.dragStartSizes[this.dragGutterIndex] + deltaPercent;
|
|
4940
|
+
let newRightSize = this.dragStartSizes[this.dragGutterIndex + 1] - deltaPercent;
|
|
4941
|
+
// Apply min/max constraints
|
|
4942
|
+
if (newLeftSize < leftPane.minSize()) {
|
|
4943
|
+
const diff = leftPane.minSize() - newLeftSize;
|
|
4944
|
+
newLeftSize = leftPane.minSize();
|
|
4945
|
+
newRightSize += diff;
|
|
4946
|
+
}
|
|
4947
|
+
else if (newLeftSize > leftPane.maxSize()) {
|
|
4948
|
+
const diff = newLeftSize - leftPane.maxSize();
|
|
4949
|
+
newLeftSize = leftPane.maxSize();
|
|
4950
|
+
newRightSize += diff;
|
|
4951
|
+
}
|
|
4952
|
+
if (newRightSize < rightPane.minSize()) {
|
|
4953
|
+
const diff = rightPane.minSize() - newRightSize;
|
|
4954
|
+
newRightSize = rightPane.minSize();
|
|
4955
|
+
newLeftSize -= diff;
|
|
4956
|
+
}
|
|
4957
|
+
else if (newRightSize > rightPane.maxSize()) {
|
|
4958
|
+
const diff = newRightSize - rightPane.maxSize();
|
|
4959
|
+
newRightSize = rightPane.maxSize();
|
|
4960
|
+
newLeftSize -= diff;
|
|
4961
|
+
}
|
|
4962
|
+
// Final clamp
|
|
4963
|
+
newLeftSize = Math.max(leftPane.minSize(), Math.min(leftPane.maxSize(), newLeftSize));
|
|
4964
|
+
newRightSize = Math.max(rightPane.minSize(), Math.min(rightPane.maxSize(), newRightSize));
|
|
4965
|
+
const sizes = [...this.paneSizes()];
|
|
4966
|
+
sizes[this.dragGutterIndex] = newLeftSize;
|
|
4967
|
+
sizes[this.dragGutterIndex + 1] = newRightSize;
|
|
4968
|
+
this.paneSizes.set(sizes);
|
|
4969
|
+
leftPane._setComputedSize(newLeftSize);
|
|
4970
|
+
rightPane._setComputedSize(newRightSize);
|
|
4971
|
+
this.sizeChange.emit({ gutterIndex: this.dragGutterIndex, sizes: [...sizes] });
|
|
4972
|
+
}
|
|
4973
|
+
onMouseUp() {
|
|
4974
|
+
if (!this.isDragging())
|
|
4975
|
+
return;
|
|
4976
|
+
this.cleanupListeners();
|
|
4977
|
+
this.isDragging.set(false);
|
|
4978
|
+
this.dragEnd.emit(this.dragGutterIndex);
|
|
4979
|
+
this.dragGutterIndex = -1;
|
|
4980
|
+
}
|
|
4981
|
+
cleanupListeners() {
|
|
4982
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
4983
|
+
this.document.removeEventListener('mousemove', this.mouseMoveHandler);
|
|
4984
|
+
this.document.removeEventListener('mouseup', this.mouseUpHandler);
|
|
4985
|
+
}
|
|
4986
|
+
}
|
|
4987
|
+
calculateSizes(paneList) {
|
|
4988
|
+
if (paneList.length === 0) {
|
|
4989
|
+
return [];
|
|
4990
|
+
}
|
|
4991
|
+
const sizes = [];
|
|
4992
|
+
let totalExplicit = 0;
|
|
4993
|
+
let implicitCount = 0;
|
|
4994
|
+
paneList.forEach((pane) => {
|
|
4995
|
+
const size = pane.size();
|
|
4996
|
+
if (size !== undefined) {
|
|
4997
|
+
totalExplicit += size;
|
|
4998
|
+
sizes.push(size);
|
|
4999
|
+
}
|
|
5000
|
+
else {
|
|
5001
|
+
implicitCount++;
|
|
5002
|
+
sizes.push(-1); // placeholder
|
|
5003
|
+
}
|
|
5004
|
+
});
|
|
5005
|
+
// Calculate remaining space for implicit panes
|
|
5006
|
+
const remaining = Math.max(0, 100 - totalExplicit);
|
|
5007
|
+
const implicitSize = implicitCount > 0 ? remaining / implicitCount : 0;
|
|
5008
|
+
// Replace placeholders
|
|
5009
|
+
for (let i = 0; i < sizes.length; i++) {
|
|
5010
|
+
if (sizes[i] === -1) {
|
|
5011
|
+
sizes[i] = implicitSize;
|
|
5012
|
+
}
|
|
5013
|
+
}
|
|
5014
|
+
// Normalize if total exceeds 100
|
|
5015
|
+
const total = sizes.reduce((a, b) => a + b, 0);
|
|
5016
|
+
if (total > 0 && Math.abs(total - 100) > 0.01) {
|
|
5017
|
+
const scale = 100 / total;
|
|
5018
|
+
for (let i = 0; i < sizes.length; i++) {
|
|
5019
|
+
sizes[i] *= scale;
|
|
5020
|
+
}
|
|
5021
|
+
}
|
|
5022
|
+
return sizes;
|
|
5023
|
+
}
|
|
5024
|
+
/** @internal - Get current sizes for external access */
|
|
5025
|
+
_getSizes() {
|
|
5026
|
+
return [...this.paneSizes()];
|
|
5027
|
+
}
|
|
5028
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SplitComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5029
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SplitComponent, isStandalone: true, selector: "ui-split", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, gutterSize: { classPropertyName: "gutterSize", publicName: "gutterSize", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sizeChange: "sizeChange", dragStart: "dragStart", dragEnd: "dragEnd" }, host: { properties: { "class.ui-split--horizontal": "orientation() === \"horizontal\"", "class.ui-split--vertical": "orientation() === \"vertical\"", "class.ui-split--disabled": "disabled()", "class.ui-split--dragging": "isDragging()" }, classAttribute: "ui-split" }, queries: [{ propertyName: "panes", predicate: SplitPaneComponent, isSignal: true }], ngImport: i0, template: "<ng-content />\n@for (gutterIndex of gutterIndices(); track gutterIndex) {\n <div\n class=\"ui-split__gutter\"\n [class]=\"gutterSizeClass()\"\n [style.order]=\"gutterIndex * 2 + 1\"\n role=\"separator\"\n tabindex=\"0\"\n [attr.aria-orientation]=\"orientation() === 'horizontal' ? 'vertical' : 'horizontal'\"\n [attr.aria-valuenow]=\"paneSizes()[gutterIndex] | number:'1.0-1'\"\n [attr.aria-valuemin]=\"panes()[gutterIndex]?.minSize()\"\n [attr.aria-valuemax]=\"panes()[gutterIndex]?.maxSize()\"\n (mousedown)=\"onGutterMouseDown($event, gutterIndex)\"\n (keydown)=\"onGutterKeyDown($event, gutterIndex)\"\n >\n <div class=\"ui-split__gutter-handle\"></div>\n </div>\n}\n", styles: [":host{display:flex;width:100%;height:100%;overflow:hidden}:host.ui-split--horizontal{flex-direction:row}:host.ui-split--vertical{flex-direction:column}:host.ui-split--disabled .ui-split__gutter{cursor:default;pointer-events:none}:host.ui-split--dragging{-webkit-user-select:none;user-select:none}.ui-split__gutter{flex:0 0 auto;display:flex;align-items:center;justify-content:center;background-color:var(--ui-bg-secondary);transition:background-color var(--ui-transition-fast)}.ui-split__gutter:hover,.ui-split__gutter:focus{background-color:var(--ui-bg-tertiary)}.ui-split__gutter:hover .ui-split__gutter-handle,.ui-split__gutter:focus .ui-split__gutter-handle{background-color:var(--ui-primary)}.ui-split__gutter:focus{outline:none;box-shadow:inset 0 0 0 2px var(--ui-primary)}:host(.ui-split--horizontal) .ui-split__gutter--sm{width:4px}:host(.ui-split--horizontal) .ui-split__gutter--md{width:8px}:host(.ui-split--horizontal) .ui-split__gutter--lg{width:12px}:host(.ui-split--vertical) .ui-split__gutter--sm{height:4px}:host(.ui-split--vertical) .ui-split__gutter--md{height:8px}:host(.ui-split--vertical) .ui-split__gutter--lg{height:12px}:host(.ui-split--horizontal) .ui-split__gutter{cursor:col-resize}:host(.ui-split--vertical) .ui-split__gutter{cursor:row-resize}:host(.ui-split--dragging.ui-split--horizontal){cursor:col-resize}:host(.ui-split--dragging.ui-split--vertical){cursor:row-resize}.ui-split__gutter-handle{background-color:var(--ui-border);border-radius:var(--ui-radius-sm);transition:background-color var(--ui-transition-fast)}:host(.ui-split--horizontal) .ui-split__gutter-handle{width:2px;height:24px}:host(.ui-split--vertical) .ui-split__gutter-handle{width:24px;height:2px}\n"], dependencies: [{ kind: "pipe", type: DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5030
|
+
}
|
|
5031
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SplitComponent, decorators: [{
|
|
5032
|
+
type: Component,
|
|
5033
|
+
args: [{ selector: 'ui-split', standalone: true, imports: [DecimalPipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
5034
|
+
class: 'ui-split',
|
|
5035
|
+
'[class.ui-split--horizontal]': 'orientation() === "horizontal"',
|
|
5036
|
+
'[class.ui-split--vertical]': 'orientation() === "vertical"',
|
|
5037
|
+
'[class.ui-split--disabled]': 'disabled()',
|
|
5038
|
+
'[class.ui-split--dragging]': 'isDragging()',
|
|
5039
|
+
}, template: "<ng-content />\n@for (gutterIndex of gutterIndices(); track gutterIndex) {\n <div\n class=\"ui-split__gutter\"\n [class]=\"gutterSizeClass()\"\n [style.order]=\"gutterIndex * 2 + 1\"\n role=\"separator\"\n tabindex=\"0\"\n [attr.aria-orientation]=\"orientation() === 'horizontal' ? 'vertical' : 'horizontal'\"\n [attr.aria-valuenow]=\"paneSizes()[gutterIndex] | number:'1.0-1'\"\n [attr.aria-valuemin]=\"panes()[gutterIndex]?.minSize()\"\n [attr.aria-valuemax]=\"panes()[gutterIndex]?.maxSize()\"\n (mousedown)=\"onGutterMouseDown($event, gutterIndex)\"\n (keydown)=\"onGutterKeyDown($event, gutterIndex)\"\n >\n <div class=\"ui-split__gutter-handle\"></div>\n </div>\n}\n", styles: [":host{display:flex;width:100%;height:100%;overflow:hidden}:host.ui-split--horizontal{flex-direction:row}:host.ui-split--vertical{flex-direction:column}:host.ui-split--disabled .ui-split__gutter{cursor:default;pointer-events:none}:host.ui-split--dragging{-webkit-user-select:none;user-select:none}.ui-split__gutter{flex:0 0 auto;display:flex;align-items:center;justify-content:center;background-color:var(--ui-bg-secondary);transition:background-color var(--ui-transition-fast)}.ui-split__gutter:hover,.ui-split__gutter:focus{background-color:var(--ui-bg-tertiary)}.ui-split__gutter:hover .ui-split__gutter-handle,.ui-split__gutter:focus .ui-split__gutter-handle{background-color:var(--ui-primary)}.ui-split__gutter:focus{outline:none;box-shadow:inset 0 0 0 2px var(--ui-primary)}:host(.ui-split--horizontal) .ui-split__gutter--sm{width:4px}:host(.ui-split--horizontal) .ui-split__gutter--md{width:8px}:host(.ui-split--horizontal) .ui-split__gutter--lg{width:12px}:host(.ui-split--vertical) .ui-split__gutter--sm{height:4px}:host(.ui-split--vertical) .ui-split__gutter--md{height:8px}:host(.ui-split--vertical) .ui-split__gutter--lg{height:12px}:host(.ui-split--horizontal) .ui-split__gutter{cursor:col-resize}:host(.ui-split--vertical) .ui-split__gutter{cursor:row-resize}:host(.ui-split--dragging.ui-split--horizontal){cursor:col-resize}:host(.ui-split--dragging.ui-split--vertical){cursor:row-resize}.ui-split__gutter-handle{background-color:var(--ui-border);border-radius:var(--ui-radius-sm);transition:background-color var(--ui-transition-fast)}:host(.ui-split--horizontal) .ui-split__gutter-handle{width:2px;height:24px}:host(.ui-split--vertical) .ui-split__gutter-handle{width:24px;height:2px}\n"] }]
|
|
5040
|
+
}], ctorParameters: () => [], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], gutterSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "gutterSize", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], sizeChange: [{ type: i0.Output, args: ["sizeChange"] }], dragStart: [{ type: i0.Output, args: ["dragStart"] }], dragEnd: [{ type: i0.Output, args: ["dragEnd"] }], panes: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SplitPaneComponent), { isSignal: true }] }] } });
|
|
5041
|
+
|
|
5042
|
+
class TreeNodeComponent {
|
|
5043
|
+
node = input.required(...(ngDevMode ? [{ debugName: "node" }] : []));
|
|
5044
|
+
level = input(0, ...(ngDevMode ? [{ debugName: "level" }] : []));
|
|
5045
|
+
indent = input(16, ...(ngDevMode ? [{ debugName: "indent" }] : []));
|
|
5046
|
+
nodeClick = output();
|
|
5047
|
+
nodeExpand = output();
|
|
5048
|
+
nodeCollapse = output();
|
|
5049
|
+
_expanded = signal(null, ...(ngDevMode ? [{ debugName: "_expanded" }] : []));
|
|
5050
|
+
isExpanded = computed(() => {
|
|
5051
|
+
const manualState = this._expanded();
|
|
5052
|
+
if (manualState !== null) {
|
|
5053
|
+
return manualState;
|
|
5054
|
+
}
|
|
5055
|
+
return this.node().expanded ?? false;
|
|
5056
|
+
}, ...(ngDevMode ? [{ debugName: "isExpanded" }] : []));
|
|
5057
|
+
hasChildren = computed(() => {
|
|
5058
|
+
const children = this.node().children;
|
|
5059
|
+
return children && children.length > 0;
|
|
5060
|
+
}, ...(ngDevMode ? [{ debugName: "hasChildren" }] : []));
|
|
5061
|
+
paddingLeft = computed(() => this.level() * this.indent(), ...(ngDevMode ? [{ debugName: "paddingLeft" }] : []));
|
|
5062
|
+
toggle(event) {
|
|
5063
|
+
event.stopPropagation();
|
|
5064
|
+
if (!this.hasChildren())
|
|
5065
|
+
return;
|
|
5066
|
+
const newState = !this.isExpanded();
|
|
5067
|
+
this._expanded.set(newState);
|
|
5068
|
+
if (newState) {
|
|
5069
|
+
this.nodeExpand.emit(this.node());
|
|
5070
|
+
}
|
|
5071
|
+
else {
|
|
5072
|
+
this.nodeCollapse.emit(this.node());
|
|
5073
|
+
}
|
|
5074
|
+
}
|
|
5075
|
+
onClick(event) {
|
|
5076
|
+
event.stopPropagation();
|
|
5077
|
+
this.nodeClick.emit(this.node());
|
|
5078
|
+
}
|
|
5079
|
+
onDoubleClick(event) {
|
|
5080
|
+
event.stopPropagation();
|
|
5081
|
+
if (this.hasChildren()) {
|
|
5082
|
+
this.toggle(event);
|
|
5083
|
+
}
|
|
5084
|
+
}
|
|
5085
|
+
/** @internal - forward events from child nodes */
|
|
5086
|
+
_onChildNodeClick(node) {
|
|
5087
|
+
this.nodeClick.emit(node);
|
|
5088
|
+
}
|
|
5089
|
+
/** @internal */
|
|
5090
|
+
_onChildNodeExpand(node) {
|
|
5091
|
+
this.nodeExpand.emit(node);
|
|
5092
|
+
}
|
|
5093
|
+
/** @internal */
|
|
5094
|
+
_onChildNodeCollapse(node) {
|
|
5095
|
+
this.nodeCollapse.emit(node);
|
|
5096
|
+
}
|
|
5097
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TreeNodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5098
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: TreeNodeComponent, isStandalone: true, selector: "ui-tree-node", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, indent: { classPropertyName: "indent", publicName: "indent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodeClick: "nodeClick", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse" }, ngImport: i0, template: "<div\n class=\"ui-tree-node\"\n [style.padding-left.px]=\"paddingLeft()\"\n>\n <div\n class=\"ui-tree-node__content\"\n [class.ui-tree-node__content--selected]=\"false\"\n (click)=\"onClick($event)\"\n (dblclick)=\"onDoubleClick($event)\"\n >\n <button\n type=\"button\"\n class=\"ui-tree-node__toggle\"\n [class.ui-tree-node__toggle--hidden]=\"!hasChildren()\"\n [class.ui-tree-node__toggle--expanded]=\"isExpanded()\"\n (click)=\"toggle($event)\"\n [attr.aria-expanded]=\"hasChildren() ? isExpanded() : null\"\n [attr.aria-label]=\"isExpanded() ? 'Collapse' : 'Expand'\"\n >\n <svg\n class=\"ui-tree-node__chevron\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6 4L10 8L6 12\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n @if (node().icon) {\n <span class=\"ui-tree-node__icon\">{{ node().icon }}</span>\n }\n <span class=\"ui-tree-node__label\">{{ node().label }}</span>\n </div>\n</div>\n@if (isExpanded() && hasChildren()) {\n @for (child of node().children; track child) {\n <ui-tree-node\n [node]=\"child\"\n [level]=\"level() + 1\"\n [indent]=\"indent()\"\n (nodeClick)=\"_onChildNodeClick($event)\"\n (nodeExpand)=\"_onChildNodeExpand($event)\"\n (nodeCollapse)=\"_onChildNodeCollapse($event)\"\n />\n }\n}\n", styles: [":host{display:block}.ui-tree-node__content{display:flex;align-items:center;gap:var(--ui-spacing-xs);padding:var(--ui-spacing-xs) var(--ui-spacing-sm);border-radius:var(--ui-radius-sm);cursor:pointer;transition:background-color var(--ui-transition-fast)}.ui-tree-node__content:hover{background-color:var(--ui-bg-hover)}.ui-tree-node__content--selected{background-color:var(--ui-option-selected-bg);color:var(--ui-option-selected-text)}.ui-tree-node__toggle{display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:none;border-radius:var(--ui-radius-sm);background:transparent;color:var(--ui-text-muted);cursor:pointer;flex-shrink:0;transition:color var(--ui-transition-fast),background-color var(--ui-transition-fast)}.ui-tree-node__toggle:hover{background-color:var(--ui-bg-hover);color:var(--ui-text)}.ui-tree-node__toggle:focus-visible{outline:2px solid var(--ui-primary);outline-offset:-2px}.ui-tree-node__toggle--hidden{visibility:hidden}.ui-tree-node__chevron{transition:transform var(--ui-transition-fast)}.ui-tree-node__toggle--expanded .ui-tree-node__chevron{transform:rotate(90deg)}.ui-tree-node__icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:18px;height:18px;font-size:var(--ui-font-sm);color:var(--ui-text-muted)}.ui-tree-node__label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.4}\n"], dependencies: [{ kind: "component", type: TreeNodeComponent, selector: "ui-tree-node", inputs: ["node", "level", "indent"], outputs: ["nodeClick", "nodeExpand", "nodeCollapse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5099
|
+
}
|
|
5100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TreeNodeComponent, decorators: [{
|
|
5101
|
+
type: Component,
|
|
5102
|
+
args: [{ selector: 'ui-tree-node', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"ui-tree-node\"\n [style.padding-left.px]=\"paddingLeft()\"\n>\n <div\n class=\"ui-tree-node__content\"\n [class.ui-tree-node__content--selected]=\"false\"\n (click)=\"onClick($event)\"\n (dblclick)=\"onDoubleClick($event)\"\n >\n <button\n type=\"button\"\n class=\"ui-tree-node__toggle\"\n [class.ui-tree-node__toggle--hidden]=\"!hasChildren()\"\n [class.ui-tree-node__toggle--expanded]=\"isExpanded()\"\n (click)=\"toggle($event)\"\n [attr.aria-expanded]=\"hasChildren() ? isExpanded() : null\"\n [attr.aria-label]=\"isExpanded() ? 'Collapse' : 'Expand'\"\n >\n <svg\n class=\"ui-tree-node__chevron\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6 4L10 8L6 12\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n @if (node().icon) {\n <span class=\"ui-tree-node__icon\">{{ node().icon }}</span>\n }\n <span class=\"ui-tree-node__label\">{{ node().label }}</span>\n </div>\n</div>\n@if (isExpanded() && hasChildren()) {\n @for (child of node().children; track child) {\n <ui-tree-node\n [node]=\"child\"\n [level]=\"level() + 1\"\n [indent]=\"indent()\"\n (nodeClick)=\"_onChildNodeClick($event)\"\n (nodeExpand)=\"_onChildNodeExpand($event)\"\n (nodeCollapse)=\"_onChildNodeCollapse($event)\"\n />\n }\n}\n", styles: [":host{display:block}.ui-tree-node__content{display:flex;align-items:center;gap:var(--ui-spacing-xs);padding:var(--ui-spacing-xs) var(--ui-spacing-sm);border-radius:var(--ui-radius-sm);cursor:pointer;transition:background-color var(--ui-transition-fast)}.ui-tree-node__content:hover{background-color:var(--ui-bg-hover)}.ui-tree-node__content--selected{background-color:var(--ui-option-selected-bg);color:var(--ui-option-selected-text)}.ui-tree-node__toggle{display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:none;border-radius:var(--ui-radius-sm);background:transparent;color:var(--ui-text-muted);cursor:pointer;flex-shrink:0;transition:color var(--ui-transition-fast),background-color var(--ui-transition-fast)}.ui-tree-node__toggle:hover{background-color:var(--ui-bg-hover);color:var(--ui-text)}.ui-tree-node__toggle:focus-visible{outline:2px solid var(--ui-primary);outline-offset:-2px}.ui-tree-node__toggle--hidden{visibility:hidden}.ui-tree-node__chevron{transition:transform var(--ui-transition-fast)}.ui-tree-node__toggle--expanded .ui-tree-node__chevron{transform:rotate(90deg)}.ui-tree-node__icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:18px;height:18px;font-size:var(--ui-font-sm);color:var(--ui-text-muted)}.ui-tree-node__label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.4}\n"] }]
|
|
5103
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: true }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], indent: [{ type: i0.Input, args: [{ isSignal: true, alias: "indent", required: false }] }], nodeClick: [{ type: i0.Output, args: ["nodeClick"] }], nodeExpand: [{ type: i0.Output, args: ["nodeExpand"] }], nodeCollapse: [{ type: i0.Output, args: ["nodeCollapse"] }] } });
|
|
5104
|
+
|
|
5105
|
+
class TreeComponent {
|
|
5106
|
+
nodes = input([], ...(ngDevMode ? [{ debugName: "nodes" }] : []));
|
|
5107
|
+
indent = input(16, ...(ngDevMode ? [{ debugName: "indent" }] : []));
|
|
5108
|
+
nodeClick = output();
|
|
5109
|
+
nodeExpand = output();
|
|
5110
|
+
nodeCollapse = output();
|
|
5111
|
+
/** @internal */
|
|
5112
|
+
_onNodeClick(node) {
|
|
5113
|
+
this.nodeClick.emit(node);
|
|
5114
|
+
}
|
|
5115
|
+
/** @internal */
|
|
5116
|
+
_onNodeExpand(node) {
|
|
5117
|
+
this.nodeExpand.emit(node);
|
|
5118
|
+
}
|
|
5119
|
+
/** @internal */
|
|
5120
|
+
_onNodeCollapse(node) {
|
|
5121
|
+
this.nodeCollapse.emit(node);
|
|
5122
|
+
}
|
|
5123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5124
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: TreeComponent, isStandalone: true, selector: "ui-tree", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: false, transformFunction: null }, indent: { classPropertyName: "indent", publicName: "indent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodeClick: "nodeClick", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse" }, ngImport: i0, template: "<div class=\"ui-tree\">\n @for (node of nodes(); track node) {\n <ui-tree-node\n [node]=\"node\"\n [level]=\"0\"\n [indent]=\"indent()\"\n (nodeClick)=\"_onNodeClick($event)\"\n (nodeExpand)=\"_onNodeExpand($event)\"\n (nodeCollapse)=\"_onNodeCollapse($event)\"\n />\n }\n</div>\n", styles: [":host{display:block}.ui-tree{font-size:var(--ui-font-sm);color:var(--ui-text);-webkit-user-select:none;user-select:none}\n"], dependencies: [{ kind: "component", type: TreeNodeComponent, selector: "ui-tree-node", inputs: ["node", "level", "indent"], outputs: ["nodeClick", "nodeExpand", "nodeCollapse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5125
|
+
}
|
|
5126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TreeComponent, decorators: [{
|
|
5127
|
+
type: Component,
|
|
5128
|
+
args: [{ selector: 'ui-tree', standalone: true, imports: [TreeNodeComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ui-tree\">\n @for (node of nodes(); track node) {\n <ui-tree-node\n [node]=\"node\"\n [level]=\"0\"\n [indent]=\"indent()\"\n (nodeClick)=\"_onNodeClick($event)\"\n (nodeExpand)=\"_onNodeExpand($event)\"\n (nodeCollapse)=\"_onNodeCollapse($event)\"\n />\n }\n</div>\n", styles: [":host{display:block}.ui-tree{font-size:var(--ui-font-sm);color:var(--ui-text);-webkit-user-select:none;user-select:none}\n"] }]
|
|
5129
|
+
}], propDecorators: { nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: false }] }], indent: [{ type: i0.Input, args: [{ isSignal: true, alias: "indent", required: false }] }], nodeClick: [{ type: i0.Output, args: ["nodeClick"] }], nodeExpand: [{ type: i0.Output, args: ["nodeExpand"] }], nodeCollapse: [{ type: i0.Output, args: ["nodeCollapse"] }] } });
|
|
5130
|
+
|
|
4730
5131
|
/*
|
|
4731
5132
|
* Public API Surface of @m1z23r/ngx-ui
|
|
4732
5133
|
*/
|
|
@@ -4736,5 +5137,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
4736
5137
|
* Generated bundle index. Do not edit.
|
|
4737
5138
|
*/
|
|
4738
5139
|
|
|
4739
|
-
export { AccordionComponent, AccordionHeaderDirective, AccordionItemComponent, AlertComponent, BadgeComponent, ButtonComponent, CardComponent, CellTemplateDirective, CellValuePipe, CheckboxComponent, ChipInputComponent, ChipTemplateDirective, CircularProgressComponent, ContentComponent, DIALOG_DATA, DIALOG_REF, DatepickerComponent, DatetimepickerComponent, DialogRef, DialogService, DropdownComponent, DropdownDividerComponent, DropdownItemComponent, DropdownTriggerDirective, FileChooserComponent, FilePreviewPipe, FileSizePipe, FooterComponent, InputComponent, LOADABLE, LoadingDirective, LoadingService, ModalComponent, NavbarComponent, OptionComponent, OptionTemplateDirective, PaginationComponent, ProgressComponent, RadioComponent, RadioGroupComponent, SelectComponent, ShellComponent, SidebarComponent, SidebarService, SidebarToggleComponent, SliderComponent, SpinnerComponent, SwitchComponent, TabActivePipe, TabComponent, TabIconDirective, TableComponent, TabsComponent, TextareaComponent, TimepickerComponent, ToastRef, ToastService, TooltipDirective };
|
|
5140
|
+
export { AccordionComponent, AccordionHeaderDirective, AccordionItemComponent, AlertComponent, BadgeComponent, ButtonComponent, CardComponent, CellTemplateDirective, CellValuePipe, CheckboxComponent, ChipInputComponent, ChipTemplateDirective, CircularProgressComponent, ContentComponent, ContextMenuDirective, DIALOG_DATA, DIALOG_REF, DatepickerComponent, DatetimepickerComponent, DialogRef, DialogService, DropdownComponent, DropdownDividerComponent, DropdownItemComponent, DropdownTriggerDirective, FileChooserComponent, FilePreviewPipe, FileSizePipe, FooterComponent, InputComponent, LOADABLE, LoadingDirective, LoadingService, ModalComponent, NavbarComponent, OptionComponent, OptionTemplateDirective, PaginationComponent, ProgressComponent, RadioComponent, RadioGroupComponent, SelectComponent, ShellComponent, SidebarComponent, SidebarService, SidebarToggleComponent, SliderComponent, SpinnerComponent, SplitComponent, SplitPaneComponent, SwitchComponent, TabActivePipe, TabComponent, TabIconDirective, TableComponent, TabsComponent, TextareaComponent, TimepickerComponent, ToastRef, ToastService, TooltipDirective, TreeComponent, TreeNodeComponent };
|
|
4740
5141
|
//# sourceMappingURL=m1z23r-ngx-ui.mjs.map
|