@tolle_/tolle-ui 18.2.22 → 18.2.24
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/date-picker.component.mjs +37 -22
- package/esm2022/lib/date-range-picker.component.mjs +28 -18
- package/esm2022/lib/resizable-panel-item.component.mjs +79 -0
- package/esm2022/lib/resizable-panel.component.mjs +130 -0
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/tolle-ui.mjs +262 -39
- package/fesm2022/tolle-ui.mjs.map +1 -1
- package/lib/button.component.d.ts +2 -2
- package/lib/date-picker.component.d.ts +1 -1
- package/lib/date-range-picker.component.d.ts +1 -1
- package/lib/resizable-panel-item.component.d.ts +16 -0
- package/lib/resizable-panel.component.d.ts +28 -0
- package/lib/toggle.component.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
- package/theme.css +4 -4
package/fesm2022/tolle-ui.mjs
CHANGED
|
@@ -3555,14 +3555,14 @@ class DatePickerComponent {
|
|
|
3555
3555
|
formatYearFn;
|
|
3556
3556
|
// Format functions for display
|
|
3557
3557
|
displayFormat;
|
|
3558
|
-
|
|
3558
|
+
trigger;
|
|
3559
3559
|
popover;
|
|
3560
3560
|
value = null;
|
|
3561
3561
|
inputValue = '';
|
|
3562
3562
|
isOpen = false;
|
|
3563
3563
|
cleanupAutoUpdate;
|
|
3564
3564
|
_outsideClickHandler = (event) => {
|
|
3565
|
-
if (!this.
|
|
3565
|
+
if (!this.trigger.nativeElement.contains(event.target) && !this.popover?.nativeElement.contains(event.target)) {
|
|
3566
3566
|
this.close();
|
|
3567
3567
|
}
|
|
3568
3568
|
};
|
|
@@ -3645,8 +3645,11 @@ class DatePickerComponent {
|
|
|
3645
3645
|
this.isOpen ? this.close() : this.open();
|
|
3646
3646
|
}
|
|
3647
3647
|
open() {
|
|
3648
|
+
if (this.disabled)
|
|
3649
|
+
return;
|
|
3648
3650
|
this.isOpen = true;
|
|
3649
|
-
|
|
3651
|
+
this.trigger.nativeElement.focus();
|
|
3652
|
+
requestAnimationFrame(() => {
|
|
3650
3653
|
this.updatePosition();
|
|
3651
3654
|
document.addEventListener('mousedown', this._outsideClickHandler);
|
|
3652
3655
|
});
|
|
@@ -3665,12 +3668,12 @@ class DatePickerComponent {
|
|
|
3665
3668
|
this.cdr.markForCheck();
|
|
3666
3669
|
}
|
|
3667
3670
|
updatePosition() {
|
|
3668
|
-
if (!this.
|
|
3671
|
+
if (!this.trigger || !this.popover)
|
|
3669
3672
|
return;
|
|
3670
|
-
this.cleanupAutoUpdate = autoUpdate(this.
|
|
3671
|
-
computePosition(this.
|
|
3672
|
-
strategy: 'fixed',
|
|
3673
|
-
placement: 'bottom-start',
|
|
3673
|
+
this.cleanupAutoUpdate = autoUpdate(this.trigger.nativeElement, this.popover.nativeElement, () => {
|
|
3674
|
+
computePosition(this.trigger.nativeElement, this.popover.nativeElement, {
|
|
3675
|
+
strategy: 'fixed',
|
|
3676
|
+
placement: 'bottom-start',
|
|
3674
3677
|
middleware: [
|
|
3675
3678
|
offset(4),
|
|
3676
3679
|
flip(),
|
|
@@ -3719,7 +3722,7 @@ class DatePickerComponent {
|
|
|
3719
3722
|
useExisting: forwardRef(() => DatePickerComponent),
|
|
3720
3723
|
multi: true
|
|
3721
3724
|
}
|
|
3722
|
-
], viewQueries: [{ propertyName: "
|
|
3725
|
+
], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true }, { propertyName: "popover", first: true, predicate: ["popover"], descendants: true }], ngImport: i0, template: `
|
|
3723
3726
|
<div class="relative w-full" #triggerContainer>
|
|
3724
3727
|
<tolle-masked-input
|
|
3725
3728
|
#maskInput
|
|
@@ -3729,20 +3732,26 @@ class DatePickerComponent {
|
|
|
3729
3732
|
[(ngModel)]="inputValue"
|
|
3730
3733
|
(ngModelChange)="onInputChange($event)"
|
|
3731
3734
|
[class]="cn(class)">
|
|
3732
|
-
<div suffix class="flex items-center gap-1.5
|
|
3733
|
-
<
|
|
3735
|
+
<div suffix class="flex items-center gap-1.5">
|
|
3736
|
+
<button
|
|
3734
3737
|
*ngIf="value && !disabled && showClear"
|
|
3738
|
+
type="button"
|
|
3735
3739
|
(click)="clear($event)"
|
|
3736
3740
|
class="ri-close-line cursor-pointer text-muted-foreground hover:text-foreground transition-colors"
|
|
3737
|
-
|
|
3741
|
+
tabindex="-1"
|
|
3742
|
+
></button>
|
|
3738
3743
|
|
|
3739
|
-
<
|
|
3744
|
+
<button
|
|
3745
|
+
type="button"
|
|
3746
|
+
#trigger
|
|
3740
3747
|
(click)="togglePopover($event)"
|
|
3748
|
+
[disabled]="disabled"
|
|
3741
3749
|
[class]="cn(
|
|
3742
3750
|
'cursor-pointer text-muted-foreground transition-colors',
|
|
3743
3751
|
'ri-calendar-line'
|
|
3744
3752
|
)"
|
|
3745
|
-
|
|
3753
|
+
tabindex="-1"
|
|
3754
|
+
></button>
|
|
3746
3755
|
</div>
|
|
3747
3756
|
</tolle-masked-input>
|
|
3748
3757
|
|
|
@@ -3790,20 +3799,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3790
3799
|
[(ngModel)]="inputValue"
|
|
3791
3800
|
(ngModelChange)="onInputChange($event)"
|
|
3792
3801
|
[class]="cn(class)">
|
|
3793
|
-
<div suffix class="flex items-center gap-1.5
|
|
3794
|
-
<
|
|
3802
|
+
<div suffix class="flex items-center gap-1.5">
|
|
3803
|
+
<button
|
|
3795
3804
|
*ngIf="value && !disabled && showClear"
|
|
3805
|
+
type="button"
|
|
3796
3806
|
(click)="clear($event)"
|
|
3797
3807
|
class="ri-close-line cursor-pointer text-muted-foreground hover:text-foreground transition-colors"
|
|
3798
|
-
|
|
3808
|
+
tabindex="-1"
|
|
3809
|
+
></button>
|
|
3799
3810
|
|
|
3800
|
-
<
|
|
3811
|
+
<button
|
|
3812
|
+
type="button"
|
|
3813
|
+
#trigger
|
|
3801
3814
|
(click)="togglePopover($event)"
|
|
3815
|
+
[disabled]="disabled"
|
|
3802
3816
|
[class]="cn(
|
|
3803
3817
|
'cursor-pointer text-muted-foreground transition-colors',
|
|
3804
3818
|
'ri-calendar-line'
|
|
3805
3819
|
)"
|
|
3806
|
-
|
|
3820
|
+
tabindex="-1"
|
|
3821
|
+
></button>
|
|
3807
3822
|
</div>
|
|
3808
3823
|
</tolle-masked-input>
|
|
3809
3824
|
|
|
@@ -3852,9 +3867,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3852
3867
|
type: Input
|
|
3853
3868
|
}], displayFormat: [{
|
|
3854
3869
|
type: Input
|
|
3855
|
-
}],
|
|
3870
|
+
}], trigger: [{
|
|
3856
3871
|
type: ViewChild,
|
|
3857
|
-
args: ['
|
|
3872
|
+
args: ['trigger']
|
|
3858
3873
|
}], popover: [{
|
|
3859
3874
|
type: ViewChild,
|
|
3860
3875
|
args: ['popover']
|
|
@@ -5500,13 +5515,13 @@ class DateRangePickerComponent {
|
|
|
5500
5515
|
class = '';
|
|
5501
5516
|
disablePastDates = false;
|
|
5502
5517
|
size = 'default';
|
|
5503
|
-
|
|
5518
|
+
trigger;
|
|
5504
5519
|
popover;
|
|
5505
5520
|
value = { start: null, end: null };
|
|
5506
5521
|
isOpen = false;
|
|
5507
5522
|
cleanupAutoUpdate;
|
|
5508
5523
|
_outsideClickHandler = (event) => {
|
|
5509
|
-
if (!this.
|
|
5524
|
+
if (!this.trigger.nativeElement.contains(event.target) && !this.popover?.nativeElement.contains(event.target)) {
|
|
5510
5525
|
this.close();
|
|
5511
5526
|
}
|
|
5512
5527
|
};
|
|
@@ -5538,7 +5553,11 @@ class DateRangePickerComponent {
|
|
|
5538
5553
|
}
|
|
5539
5554
|
open() {
|
|
5540
5555
|
this.isOpen = true;
|
|
5541
|
-
|
|
5556
|
+
if (this.trigger?.nativeElement) {
|
|
5557
|
+
this.trigger.nativeElement.focus();
|
|
5558
|
+
}
|
|
5559
|
+
const schedule = typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame : (fn) => setTimeout(fn, 0);
|
|
5560
|
+
schedule(() => {
|
|
5542
5561
|
this.updatePosition();
|
|
5543
5562
|
document.addEventListener('mousedown', this._outsideClickHandler);
|
|
5544
5563
|
});
|
|
@@ -5559,10 +5578,10 @@ class DateRangePickerComponent {
|
|
|
5559
5578
|
}
|
|
5560
5579
|
// --- Floating UI Positioning with Fixed Strategy ---
|
|
5561
5580
|
updatePosition() {
|
|
5562
|
-
if (!this.
|
|
5581
|
+
if (!this.trigger || !this.popover)
|
|
5563
5582
|
return;
|
|
5564
|
-
this.cleanupAutoUpdate = autoUpdate(this.
|
|
5565
|
-
computePosition(this.
|
|
5583
|
+
this.cleanupAutoUpdate = autoUpdate(this.trigger.nativeElement, this.popover.nativeElement, () => {
|
|
5584
|
+
computePosition(this.trigger.nativeElement, this.popover.nativeElement, {
|
|
5566
5585
|
placement: 'bottom-end',
|
|
5567
5586
|
strategy: 'fixed', // Use fixed to escape column layout
|
|
5568
5587
|
middleware: [
|
|
@@ -5635,22 +5654,25 @@ class DateRangePickerComponent {
|
|
|
5635
5654
|
useExisting: forwardRef(() => DateRangePickerComponent),
|
|
5636
5655
|
multi: true
|
|
5637
5656
|
}
|
|
5638
|
-
], viewQueries: [{ propertyName: "
|
|
5639
|
-
<div class="relative w-full"
|
|
5657
|
+
], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true }, { propertyName: "popover", first: true, predicate: ["popover"], descendants: true }], ngImport: i0, template: `
|
|
5658
|
+
<div class="relative w-full">
|
|
5640
5659
|
<tolle-input
|
|
5641
5660
|
[placeholder]="placeholder"
|
|
5642
5661
|
[disabled]="disabled"
|
|
5643
5662
|
[ngModel]="displayValue"
|
|
5644
5663
|
[class]="class"
|
|
5645
5664
|
>
|
|
5646
|
-
<div suffix class="flex items-center gap-1.5
|
|
5647
|
-
<
|
|
5665
|
+
<div suffix class="flex items-center gap-1.5">
|
|
5666
|
+
<button
|
|
5667
|
+
type="button"
|
|
5668
|
+
tabindex="-1"
|
|
5648
5669
|
*ngIf="(value.start || value.end) && !disabled"
|
|
5649
5670
|
(click)="clear($event)"
|
|
5650
5671
|
class="ri-close-line cursor-pointer text-muted-foreground hover:text-foreground transition-colors"
|
|
5651
|
-
></
|
|
5672
|
+
></button>
|
|
5652
5673
|
|
|
5653
5674
|
<i
|
|
5675
|
+
#trigger
|
|
5654
5676
|
(click)="togglePopover($event)"
|
|
5655
5677
|
class="ri-calendar-line cursor-pointer text-muted-foreground hover:text-primary transition-colors"
|
|
5656
5678
|
></i>
|
|
@@ -5686,21 +5708,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
5686
5708
|
}
|
|
5687
5709
|
],
|
|
5688
5710
|
template: `
|
|
5689
|
-
<div class="relative w-full"
|
|
5711
|
+
<div class="relative w-full">
|
|
5690
5712
|
<tolle-input
|
|
5691
5713
|
[placeholder]="placeholder"
|
|
5692
5714
|
[disabled]="disabled"
|
|
5693
5715
|
[ngModel]="displayValue"
|
|
5694
5716
|
[class]="class"
|
|
5695
5717
|
>
|
|
5696
|
-
<div suffix class="flex items-center gap-1.5
|
|
5697
|
-
<
|
|
5718
|
+
<div suffix class="flex items-center gap-1.5">
|
|
5719
|
+
<button
|
|
5720
|
+
type="button"
|
|
5721
|
+
tabindex="-1"
|
|
5698
5722
|
*ngIf="(value.start || value.end) && !disabled"
|
|
5699
5723
|
(click)="clear($event)"
|
|
5700
5724
|
class="ri-close-line cursor-pointer text-muted-foreground hover:text-foreground transition-colors"
|
|
5701
|
-
></
|
|
5725
|
+
></button>
|
|
5702
5726
|
|
|
5703
5727
|
<i
|
|
5728
|
+
#trigger
|
|
5704
5729
|
(click)="togglePopover($event)"
|
|
5705
5730
|
class="ri-calendar-line cursor-pointer text-muted-foreground hover:text-primary transition-colors"
|
|
5706
5731
|
></i>
|
|
@@ -5732,9 +5757,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
5732
5757
|
type: Input
|
|
5733
5758
|
}], size: [{
|
|
5734
5759
|
type: Input
|
|
5735
|
-
}],
|
|
5760
|
+
}], trigger: [{
|
|
5736
5761
|
type: ViewChild,
|
|
5737
|
-
args: ['
|
|
5762
|
+
args: ['trigger']
|
|
5738
5763
|
}], popover: [{
|
|
5739
5764
|
type: ViewChild,
|
|
5740
5765
|
args: ['popover']
|
|
@@ -13993,6 +14018,204 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
13993
14018
|
}]
|
|
13994
14019
|
}] });
|
|
13995
14020
|
|
|
14021
|
+
class ResizablePanelItemComponent {
|
|
14022
|
+
size = 1;
|
|
14023
|
+
minSize = 10; // percentage or pixels
|
|
14024
|
+
maxSize;
|
|
14025
|
+
resizable = true;
|
|
14026
|
+
class = '';
|
|
14027
|
+
isLast = false;
|
|
14028
|
+
container = inject(ResizablePanelComponent);
|
|
14029
|
+
get computedContainerClass() {
|
|
14030
|
+
return cn('relative h-full w-full overflow-hidden', this.class);
|
|
14031
|
+
}
|
|
14032
|
+
get computedHandleClass() {
|
|
14033
|
+
const isHorizontal = this.container?.direction === 'horizontal';
|
|
14034
|
+
return cn('absolute z-20', isHorizontal
|
|
14035
|
+
? 'top-0 bottom-0 -right-2 w-4 cursor-col-resize'
|
|
14036
|
+
: 'left-0 right-0 -bottom-2 h-4 cursor-row-resize', 'hover:bg-primary/5 active:bg-primary/10');
|
|
14037
|
+
}
|
|
14038
|
+
get computedHandleIndicatorClass() {
|
|
14039
|
+
const isHorizontal = this.container?.direction === 'horizontal';
|
|
14040
|
+
return cn('bg-muted-foreground/40 rounded-full', isHorizontal ? 'w-1 h-6' : 'h-1 w-6');
|
|
14041
|
+
}
|
|
14042
|
+
onHandleMouseDown(event) {
|
|
14043
|
+
this.container.startResize(this, event);
|
|
14044
|
+
}
|
|
14045
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ResizablePanelItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14046
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ResizablePanelItemComponent, isStandalone: true, selector: "tolle-resizable-panel-item", inputs: { size: "size", minSize: "minSize", maxSize: "maxSize", resizable: "resizable", class: "class" }, host: { properties: { "style.flex": "this.size" } }, ngImport: i0, template: `
|
|
14047
|
+
<div [class]="computedContainerClass">
|
|
14048
|
+
<ng-content></ng-content>
|
|
14049
|
+
</div>
|
|
14050
|
+
|
|
14051
|
+
<div
|
|
14052
|
+
*ngIf="resizable && !isLast"
|
|
14053
|
+
[class]="computedHandleClass"
|
|
14054
|
+
(mousedown)="onHandleMouseDown($event)"
|
|
14055
|
+
>
|
|
14056
|
+
<div class="absolute inset-0 flex items-center justify-center pointer-events-none">
|
|
14057
|
+
<div [class]="computedHandleIndicatorClass"></div>
|
|
14058
|
+
</div>
|
|
14059
|
+
</div>
|
|
14060
|
+
`, isInline: true, styles: [":host{display:block;position:relative;overflow:visible}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
14061
|
+
}
|
|
14062
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ResizablePanelItemComponent, decorators: [{
|
|
14063
|
+
type: Component,
|
|
14064
|
+
args: [{ selector: 'tolle-resizable-panel-item', standalone: true, imports: [CommonModule], template: `
|
|
14065
|
+
<div [class]="computedContainerClass">
|
|
14066
|
+
<ng-content></ng-content>
|
|
14067
|
+
</div>
|
|
14068
|
+
|
|
14069
|
+
<div
|
|
14070
|
+
*ngIf="resizable && !isLast"
|
|
14071
|
+
[class]="computedHandleClass"
|
|
14072
|
+
(mousedown)="onHandleMouseDown($event)"
|
|
14073
|
+
>
|
|
14074
|
+
<div class="absolute inset-0 flex items-center justify-center pointer-events-none">
|
|
14075
|
+
<div [class]="computedHandleIndicatorClass"></div>
|
|
14076
|
+
</div>
|
|
14077
|
+
</div>
|
|
14078
|
+
`, styles: [":host{display:block;position:relative;overflow:visible}\n"] }]
|
|
14079
|
+
}], propDecorators: { size: [{
|
|
14080
|
+
type: Input
|
|
14081
|
+
}, {
|
|
14082
|
+
type: HostBinding,
|
|
14083
|
+
args: ['style.flex']
|
|
14084
|
+
}], minSize: [{
|
|
14085
|
+
type: Input
|
|
14086
|
+
}], maxSize: [{
|
|
14087
|
+
type: Input
|
|
14088
|
+
}], resizable: [{
|
|
14089
|
+
type: Input
|
|
14090
|
+
}], class: [{
|
|
14091
|
+
type: Input
|
|
14092
|
+
}] } });
|
|
14093
|
+
|
|
14094
|
+
class ResizablePanelComponent {
|
|
14095
|
+
direction = 'horizontal';
|
|
14096
|
+
class = '';
|
|
14097
|
+
panels;
|
|
14098
|
+
el = inject(ElementRef);
|
|
14099
|
+
cdr = inject(ChangeDetectorRef);
|
|
14100
|
+
isResizing = false;
|
|
14101
|
+
activePanelIndex = -1;
|
|
14102
|
+
startCursorPosition = 0;
|
|
14103
|
+
startPanelSizes = [];
|
|
14104
|
+
mouseMoveListener;
|
|
14105
|
+
mouseUpListener;
|
|
14106
|
+
ngAfterContentInit() {
|
|
14107
|
+
// Initialize panel sizes if needed
|
|
14108
|
+
setTimeout(() => {
|
|
14109
|
+
this.updatePanelSizes();
|
|
14110
|
+
this.updateLastStatus();
|
|
14111
|
+
});
|
|
14112
|
+
this.panels.changes.subscribe(() => {
|
|
14113
|
+
this.updatePanelSizes();
|
|
14114
|
+
this.updateLastStatus();
|
|
14115
|
+
});
|
|
14116
|
+
}
|
|
14117
|
+
ngOnDestroy() {
|
|
14118
|
+
this.cleanupListeners();
|
|
14119
|
+
}
|
|
14120
|
+
updateLastStatus() {
|
|
14121
|
+
const panels = this.panels.toArray();
|
|
14122
|
+
panels.forEach((p, i) => p.isLast = i === panels.length - 1);
|
|
14123
|
+
}
|
|
14124
|
+
startResize(item, event) {
|
|
14125
|
+
const panels = this.panels.toArray();
|
|
14126
|
+
this.activePanelIndex = panels.indexOf(item);
|
|
14127
|
+
if (this.activePanelIndex === -1 || this.activePanelIndex === panels.length - 1)
|
|
14128
|
+
return;
|
|
14129
|
+
this.isResizing = true;
|
|
14130
|
+
this.startCursorPosition = this.direction === 'horizontal' ? event.clientX : event.clientY;
|
|
14131
|
+
this.startPanelSizes = panels.map(p => p.size);
|
|
14132
|
+
this.setupListeners();
|
|
14133
|
+
document.body.style.cursor = this.direction === 'horizontal' ? 'col-resize' : 'row-resize';
|
|
14134
|
+
document.body.style.userSelect = 'none';
|
|
14135
|
+
}
|
|
14136
|
+
setupListeners() {
|
|
14137
|
+
this.mouseMoveListener = (e) => this.onMouseMove(e);
|
|
14138
|
+
this.mouseUpListener = () => this.stopResize();
|
|
14139
|
+
document.addEventListener('mousemove', this.mouseMoveListener);
|
|
14140
|
+
document.addEventListener('mouseup', this.mouseUpListener);
|
|
14141
|
+
}
|
|
14142
|
+
cleanupListeners() {
|
|
14143
|
+
if (this.mouseMoveListener)
|
|
14144
|
+
document.removeEventListener('mousemove', this.mouseMoveListener);
|
|
14145
|
+
if (this.mouseUpListener)
|
|
14146
|
+
document.removeEventListener('mouseup', this.mouseUpListener);
|
|
14147
|
+
}
|
|
14148
|
+
onMouseMove(event) {
|
|
14149
|
+
if (!this.isResizing)
|
|
14150
|
+
return;
|
|
14151
|
+
const currentPos = this.direction === 'horizontal' ? event.clientX : event.clientY;
|
|
14152
|
+
const deltaPx = currentPos - this.startCursorPosition;
|
|
14153
|
+
const containerSize = this.direction === 'horizontal'
|
|
14154
|
+
? this.el.nativeElement.offsetWidth
|
|
14155
|
+
: this.el.nativeElement.offsetHeight;
|
|
14156
|
+
const deltaPercent = (deltaPx / containerSize) * 100;
|
|
14157
|
+
const panels = this.panels.toArray();
|
|
14158
|
+
const panelA = panels[this.activePanelIndex];
|
|
14159
|
+
const panelB = panels[this.activePanelIndex + 1];
|
|
14160
|
+
const newSizeA = Math.max(panelA.minSize, this.startPanelSizes[this.activePanelIndex] + deltaPercent);
|
|
14161
|
+
const actualDelta = newSizeA - this.startPanelSizes[this.activePanelIndex];
|
|
14162
|
+
const newSizeB = Math.max(panelB.minSize, this.startPanelSizes[this.activePanelIndex + 1] - actualDelta);
|
|
14163
|
+
panelA.size = newSizeA;
|
|
14164
|
+
panelB.size = this.startPanelSizes[this.activePanelIndex] + this.startPanelSizes[this.activePanelIndex + 1] - panelA.size;
|
|
14165
|
+
if (panelB.size < panelB.minSize) {
|
|
14166
|
+
panelB.size = panelB.minSize;
|
|
14167
|
+
panelA.size = (this.startPanelSizes[this.activePanelIndex] + this.startPanelSizes[this.activePanelIndex + 1]) - panelB.minSize;
|
|
14168
|
+
}
|
|
14169
|
+
this.cdr.detectChanges();
|
|
14170
|
+
}
|
|
14171
|
+
stopResize() {
|
|
14172
|
+
this.isResizing = false;
|
|
14173
|
+
this.cleanupListeners();
|
|
14174
|
+
document.body.style.cursor = '';
|
|
14175
|
+
document.body.style.userSelect = '';
|
|
14176
|
+
}
|
|
14177
|
+
updatePanelSizes() {
|
|
14178
|
+
const panels = this.panels.toArray();
|
|
14179
|
+
const totalPanels = panels.length;
|
|
14180
|
+
if (totalPanels > 0) {
|
|
14181
|
+
const defaultSize = 100 / totalPanels;
|
|
14182
|
+
panels.forEach(panel => {
|
|
14183
|
+
if (!panel.size) {
|
|
14184
|
+
panel.size = defaultSize;
|
|
14185
|
+
}
|
|
14186
|
+
});
|
|
14187
|
+
}
|
|
14188
|
+
}
|
|
14189
|
+
get computedContainerClass() {
|
|
14190
|
+
return cn('w-full h-full', this.class);
|
|
14191
|
+
}
|
|
14192
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ResizablePanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14193
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ResizablePanelComponent, isStandalone: true, selector: "tolle-resizable-panel", inputs: { direction: "direction", class: "class" }, queries: [{ propertyName: "panels", predicate: ResizablePanelItemComponent }], ngImport: i0, template: `
|
|
14194
|
+
<div [class]="computedContainerClass">
|
|
14195
|
+
<div class="flex" [class.flex-col]="direction === 'vertical'" [class.flex-row]="direction === 'horizontal'">
|
|
14196
|
+
<ng-content></ng-content>
|
|
14197
|
+
</div>
|
|
14198
|
+
</div>
|
|
14199
|
+
`, isInline: true, styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
14200
|
+
}
|
|
14201
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ResizablePanelComponent, decorators: [{
|
|
14202
|
+
type: Component,
|
|
14203
|
+
args: [{ selector: 'tolle-resizable-panel', standalone: true, imports: [CommonModule], template: `
|
|
14204
|
+
<div [class]="computedContainerClass">
|
|
14205
|
+
<div class="flex" [class.flex-col]="direction === 'vertical'" [class.flex-row]="direction === 'horizontal'">
|
|
14206
|
+
<ng-content></ng-content>
|
|
14207
|
+
</div>
|
|
14208
|
+
</div>
|
|
14209
|
+
`, styles: [":host{display:block}\n"] }]
|
|
14210
|
+
}], propDecorators: { direction: [{
|
|
14211
|
+
type: Input
|
|
14212
|
+
}], class: [{
|
|
14213
|
+
type: Input
|
|
14214
|
+
}], panels: [{
|
|
14215
|
+
type: ContentChildren,
|
|
14216
|
+
args: [ResizablePanelItemComponent]
|
|
14217
|
+
}] } });
|
|
14218
|
+
|
|
13996
14219
|
/*
|
|
13997
14220
|
* Public API Surface of tolle
|
|
13998
14221
|
*/
|
|
@@ -14001,5 +14224,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
14001
14224
|
* Generated bundle index. Do not edit.
|
|
14002
14225
|
*/
|
|
14003
14226
|
|
|
14004
|
-
export { AccordionComponent, AccordionItemComponent, AlertComponent, AlertDialogActionComponent, AlertDialogCancelComponent, AlertDialogComponent, AlertDialogContentComponent, AlertDialogDescriptionComponent, AlertDialogDynamicComponent, AlertDialogFooterComponent, AlertDialogHeaderComponent, AlertDialogPortalComponent, AlertDialogRef, AlertDialogService, AlertDialogTitleComponent, AlertDialogTriggerComponent, AvatarComponent, AvatarFallbackComponent, BadgeComponent, BreadcrumbComponent, BreadcrumbItemComponent, BreadcrumbLinkComponent, BreadcrumbSeparatorComponent, ButtonComponent, ButtonGroupComponent, CalendarComponent, CardComponent, CardContentComponent, CardFooterComponent, CardHeaderComponent, CardTitleComponent, CarouselComponent, CarouselContainerDirective, CarouselContentDirective, CarouselContext, CarouselItemDirective, CarouselNextDirective, CarouselPreviousDirective, CheckboxComponent, CollapsibleComponent, CollapsibleContentComponent, CollapsibleTriggerComponent, CountryCodesService, CountrySelectorComponent, DataTableComponent, DatePickerComponent, DateRangePickerComponent, DropdownItemComponent, DropdownLabelComponent, DropdownMenuComponent, DropdownSeparatorComponent, DropdownTriggerDirective, EmptyStateComponent, HoverCardComponent, HoverCardContentComponent, HoverCardTriggerComponent, InputComponent, LabelComponent, MaskedInputComponent, Modal, ModalComponent, ModalRef, ModalService, ModalStackService, MultiSelectComponent, OtpComponent, OtpGroupComponent, OtpSlotComponent, PaginationComponent, PhoneNumberInputComponent, PhoneNumberService, PopoverComponent, PopoverContentComponent, ProgressComponent, RadioGroupComponent, RadioItemComponent, RangeCalendarComponent, ScrollAreaComponent, SegmentedComponent, SelectComponent, SelectGroupComponent, SelectItemComponent, SelectSeparatorComponent, SeparatorComponent, SheetComponent, SheetContentComponent, SheetDescriptionComponent, SheetFooterComponent, SheetHeaderComponent, SheetRef, SheetService, SheetTitleComponent, SheetTriggerComponent, SheetWrapperComponent, SidebarComponent, SkeletonComponent, SliderComponent, SwitchComponent, TOLLE_CONFIG, TabsComponent, TabsContentComponent, TabsListComponent, TabsTriggerComponent, TagInputComponent, TextareaComponent, ThemeService, ToastContainerComponent, ToastService, ToggleComponent, ToggleGroupComponent, ToggleGroupItemComponent, TolleCellDirective, TooltipDirective, cn, provideTolleConfig };
|
|
14227
|
+
export { AccordionComponent, AccordionItemComponent, AlertComponent, AlertDialogActionComponent, AlertDialogCancelComponent, AlertDialogComponent, AlertDialogContentComponent, AlertDialogDescriptionComponent, AlertDialogDynamicComponent, AlertDialogFooterComponent, AlertDialogHeaderComponent, AlertDialogPortalComponent, AlertDialogRef, AlertDialogService, AlertDialogTitleComponent, AlertDialogTriggerComponent, AvatarComponent, AvatarFallbackComponent, BadgeComponent, BreadcrumbComponent, BreadcrumbItemComponent, BreadcrumbLinkComponent, BreadcrumbSeparatorComponent, ButtonComponent, ButtonGroupComponent, CalendarComponent, CardComponent, CardContentComponent, CardFooterComponent, CardHeaderComponent, CardTitleComponent, CarouselComponent, CarouselContainerDirective, CarouselContentDirective, CarouselContext, CarouselItemDirective, CarouselNextDirective, CarouselPreviousDirective, CheckboxComponent, CollapsibleComponent, CollapsibleContentComponent, CollapsibleTriggerComponent, CountryCodesService, CountrySelectorComponent, DataTableComponent, DatePickerComponent, DateRangePickerComponent, DropdownItemComponent, DropdownLabelComponent, DropdownMenuComponent, DropdownSeparatorComponent, DropdownTriggerDirective, EmptyStateComponent, HoverCardComponent, HoverCardContentComponent, HoverCardTriggerComponent, InputComponent, LabelComponent, MaskedInputComponent, Modal, ModalComponent, ModalRef, ModalService, ModalStackService, MultiSelectComponent, OtpComponent, OtpGroupComponent, OtpSlotComponent, PaginationComponent, PhoneNumberInputComponent, PhoneNumberService, PopoverComponent, PopoverContentComponent, ProgressComponent, RadioGroupComponent, RadioItemComponent, RangeCalendarComponent, ResizablePanelComponent, ResizablePanelItemComponent, ScrollAreaComponent, SegmentedComponent, SelectComponent, SelectGroupComponent, SelectItemComponent, SelectSeparatorComponent, SeparatorComponent, SheetComponent, SheetContentComponent, SheetDescriptionComponent, SheetFooterComponent, SheetHeaderComponent, SheetRef, SheetService, SheetTitleComponent, SheetTriggerComponent, SheetWrapperComponent, SidebarComponent, SkeletonComponent, SliderComponent, SwitchComponent, TOLLE_CONFIG, TabsComponent, TabsContentComponent, TabsListComponent, TabsTriggerComponent, TagInputComponent, TextareaComponent, ThemeService, ToastContainerComponent, ToastService, ToggleComponent, ToggleGroupComponent, ToggleGroupItemComponent, TolleCellDirective, TooltipDirective, cn, provideTolleConfig };
|
|
14005
14228
|
//# sourceMappingURL=tolle-ui.mjs.map
|