@exhaustive-ui/core 3.0.0-alpha.0 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/exhaustive-ui-core-accordion.mjs +51 -78
- package/fesm2022/exhaustive-ui-core-accordion.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-animateonscroll.mjs +72 -73
- package/fesm2022/exhaustive-ui-core-animateonscroll.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-api.mjs +6 -13
- package/fesm2022/exhaustive-ui-core-api.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-autocomplete.mjs +485 -683
- package/fesm2022/exhaustive-ui-core-autocomplete.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-autofocus.mjs +21 -31
- package/fesm2022/exhaustive-ui-core-autofocus.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-avatar.mjs +47 -63
- package/fesm2022/exhaustive-ui-core-avatar.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-badge.mjs +88 -115
- package/fesm2022/exhaustive-ui-core-badge.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-blockui.mjs +58 -91
- package/fesm2022/exhaustive-ui-core-blockui.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-breadcrumb.mjs +155 -169
- package/fesm2022/exhaustive-ui-core-breadcrumb.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-button.mjs +280 -385
- package/fesm2022/exhaustive-ui-core-button.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-carousel.mjs +379 -451
- package/fesm2022/exhaustive-ui-core-carousel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-cascadeselect.mjs +388 -507
- package/fesm2022/exhaustive-ui-core-cascadeselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-chart.mjs +75 -91
- package/fesm2022/exhaustive-ui-core-chart.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-checkbox.mjs +109 -160
- package/fesm2022/exhaustive-ui-core-checkbox.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-chip.mjs +98 -137
- package/fesm2022/exhaustive-ui-core-chip.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-colorpicker.mjs +123 -190
- package/fesm2022/exhaustive-ui-core-colorpicker.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-confirmdialog.mjs +157 -332
- package/fesm2022/exhaustive-ui-core-confirmdialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-confirmpopup.mjs +187 -210
- package/fesm2022/exhaustive-ui-core-confirmpopup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-contextmenu.mjs +315 -361
- package/fesm2022/exhaustive-ui-core-contextmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dataview.mjs +225 -272
- package/fesm2022/exhaustive-ui-core-dataview.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-datepicker.mjs +1012 -1157
- package/fesm2022/exhaustive-ui-core-datepicker.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dialog.mjs +370 -507
- package/fesm2022/exhaustive-ui-core-dialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dock.mjs +87 -115
- package/fesm2022/exhaustive-ui-core-dock.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dragdrop.mjs +98 -105
- package/fesm2022/exhaustive-ui-core-dragdrop.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-drawer.mjs +174 -235
- package/fesm2022/exhaustive-ui-core-drawer.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dynamicdialog.mjs +42 -280
- package/fesm2022/exhaustive-ui-core-dynamicdialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-editor.mjs +109 -121
- package/fesm2022/exhaustive-ui-core-editor.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-fieldset.mjs +90 -132
- package/fesm2022/exhaustive-ui-core-fieldset.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-fileupload.mjs +486 -541
- package/fesm2022/exhaustive-ui-core-fileupload.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-floatlabel.mjs +13 -16
- package/fesm2022/exhaustive-ui-core-floatlabel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-focustrap.mjs +44 -40
- package/fesm2022/exhaustive-ui-core-focustrap.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-galleria.mjs +642 -853
- package/fesm2022/exhaustive-ui-core-galleria.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-iconfield.mjs +15 -27
- package/fesm2022/exhaustive-ui-core-iconfield.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-icons-baseicon.mjs +8 -13
- package/fesm2022/exhaustive-ui-core-icons-baseicon.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-image.mjs +209 -251
- package/fesm2022/exhaustive-ui-core-image.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-imagecompare.mjs +39 -48
- package/fesm2022/exhaustive-ui-core-imagecompare.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inplace.mjs +64 -98
- package/fesm2022/exhaustive-ui-core-inplace.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputgroup.mjs +10 -20
- package/fesm2022/exhaustive-ui-core-inputgroup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputgroupaddon.mjs +15 -24
- package/fesm2022/exhaustive-ui-core-inputgroupaddon.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputicon.mjs +11 -22
- package/fesm2022/exhaustive-ui-core-inputicon.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputmask.mjs +423 -392
- package/fesm2022/exhaustive-ui-core-inputmask.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputnumber.mjs +397 -469
- package/fesm2022/exhaustive-ui-core-inputnumber.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputotp.mjs +75 -95
- package/fesm2022/exhaustive-ui-core-inputotp.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputtext.mjs +27 -36
- package/fesm2022/exhaustive-ui-core-inputtext.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-keyfilter.mjs +29 -46
- package/fesm2022/exhaustive-ui-core-keyfilter.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-knob.mjs +140 -187
- package/fesm2022/exhaustive-ui-core-knob.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-listbox.mjs +365 -546
- package/fesm2022/exhaustive-ui-core-listbox.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-megamenu.mjs +320 -371
- package/fesm2022/exhaustive-ui-core-megamenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-menu.mjs +298 -348
- package/fesm2022/exhaustive-ui-core-menu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-menubar.mjs +277 -372
- package/fesm2022/exhaustive-ui-core-menubar.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-metergroup.mjs +138 -166
- package/fesm2022/exhaustive-ui-core-metergroup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-multiselect.mjs +647 -835
- package/fesm2022/exhaustive-ui-core-multiselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-orderlist.mjs +337 -409
- package/fesm2022/exhaustive-ui-core-orderlist.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-organizationchart.mjs +114 -175
- package/fesm2022/exhaustive-ui-core-organizationchart.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-overlaybadge.mjs +22 -47
- package/fesm2022/exhaustive-ui-core-overlaybadge.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-paginator.mjs +232 -320
- package/fesm2022/exhaustive-ui-core-paginator.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-panel.mjs +114 -174
- package/fesm2022/exhaustive-ui-core-panel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-panelmenu.mjs +171 -282
- package/fesm2022/exhaustive-ui-core-panelmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-password.mjs +317 -377
- package/fesm2022/exhaustive-ui-core-password.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-picklist.mjs +557 -655
- package/fesm2022/exhaustive-ui-core-picklist.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-popover.mjs +154 -181
- package/fesm2022/exhaustive-ui-core-popover.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-rating.mjs +87 -119
- package/fesm2022/exhaustive-ui-core-rating.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-scroller.mjs +465 -596
- package/fesm2022/exhaustive-ui-core-scroller.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-scrollpanel.mjs +147 -155
- package/fesm2022/exhaustive-ui-core-scrollpanel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-scrolltop.mjs +81 -115
- package/fesm2022/exhaustive-ui-core-scrolltop.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-select.mjs +581 -784
- package/fesm2022/exhaustive-ui-core-select.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-selectbutton.mjs +84 -120
- package/fesm2022/exhaustive-ui-core-selectbutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-slider.mjs +322 -352
- package/fesm2022/exhaustive-ui-core-slider.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-speeddial.mjs +209 -268
- package/fesm2022/exhaustive-ui-core-speeddial.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-splitbutton.mjs +153 -249
- package/fesm2022/exhaustive-ui-core-splitbutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-splitter.mjs +221 -237
- package/fesm2022/exhaustive-ui-core-splitter.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-steps.mjs +56 -72
- package/fesm2022/exhaustive-ui-core-steps.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-styleclass.mjs +145 -146
- package/fesm2022/exhaustive-ui-core-styleclass.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-table.mjs +2213 -2543
- package/fesm2022/exhaustive-ui-core-table.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-terminal.mjs +50 -67
- package/fesm2022/exhaustive-ui-core-terminal.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-textarea.mjs +23 -36
- package/fesm2022/exhaustive-ui-core-textarea.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tieredmenu.mjs +318 -394
- package/fesm2022/exhaustive-ui-core-tieredmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-timeline.mjs +56 -74
- package/fesm2022/exhaustive-ui-core-timeline.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-togglebutton.mjs +86 -129
- package/fesm2022/exhaustive-ui-core-togglebutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-toggleswitch.mjs +57 -94
- package/fesm2022/exhaustive-ui-core-toggleswitch.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-toolbar.mjs +36 -55
- package/fesm2022/exhaustive-ui-core-toolbar.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tooltip.mjs +264 -343
- package/fesm2022/exhaustive-ui-core-tooltip.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tree.mjs +508 -639
- package/fesm2022/exhaustive-ui-core-tree.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-treeselect.mjs +327 -421
- package/fesm2022/exhaustive-ui-core-treeselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-treetable.mjs +1267 -1473
- package/fesm2022/exhaustive-ui-core-treetable.mjs.map +1 -1
- package/package.json +5 -5
- package/schematics/migrations/remove-dead-inputs/migration.js +213 -7
- package/schematics/migrations/renamed-inputs/migration.js +97 -0
- package/schematics/migrations/styleclass-to-class/migration.js +92 -1
- package/schematics/migrations.json +7 -2
- package/schematics/utils/removed-inputs.js +0 -0
- package/schematics/utils/renamed-inputs.js +175 -0
- package/schematics/utils/styleclass.js +24 -8
- package/schematics/utils/versions.json +8 -8
- package/types/exhaustive-ui-core-accordion.d.ts +8 -24
- package/types/exhaustive-ui-core-animateonscroll.d.ts +19 -21
- package/types/exhaustive-ui-core-api.d.ts +2 -3
- package/types/exhaustive-ui-core-autocomplete.d.ts +103 -176
- package/types/exhaustive-ui-core-autofocus.d.ts +4 -7
- package/types/exhaustive-ui-core-avatar.d.ts +18 -25
- package/types/exhaustive-ui-core-badge.d.ts +13 -27
- package/types/exhaustive-ui-core-blockui.d.ts +18 -30
- package/types/exhaustive-ui-core-breadcrumb.d.ts +21 -22
- package/types/exhaustive-ui-core-button.d.ts +57 -89
- package/types/exhaustive-ui-core-carousel.d.ts +56 -82
- package/types/exhaustive-ui-core-cascadeselect.d.ts +77 -111
- package/types/exhaustive-ui-core-chart.d.ts +21 -29
- package/types/exhaustive-ui-core-checkbox.d.ts +25 -39
- package/types/exhaustive-ui-core-chip.d.ts +31 -38
- package/types/exhaustive-ui-core-colorpicker.d.ts +23 -57
- package/types/exhaustive-ui-core-confirmdialog.d.ts +39 -109
- package/types/exhaustive-ui-core-confirmpopup.d.ts +24 -43
- package/types/exhaustive-ui-core-contextmenu.d.ts +54 -71
- package/types/exhaustive-ui-core-dataview.d.ts +42 -65
- package/types/exhaustive-ui-core-datepicker.d.ts +109 -191
- package/types/exhaustive-ui-core-dialog.d.ts +73 -123
- package/types/exhaustive-ui-core-dock.d.ts +16 -25
- package/types/exhaustive-ui-core-dragdrop.d.ts +32 -36
- package/types/exhaustive-ui-core-drawer.d.ts +32 -64
- package/types/exhaustive-ui-core-dynamicdialog.d.ts +9 -54
- package/types/exhaustive-ui-core-editor.d.ts +15 -25
- package/types/exhaustive-ui-core-fieldset.d.ts +15 -35
- package/types/exhaustive-ui-core-fileupload.d.ts +69 -95
- package/types/exhaustive-ui-core-floatlabel.d.ts +4 -6
- package/types/exhaustive-ui-core-focustrap.d.ts +5 -10
- package/types/exhaustive-ui-core-galleria.d.ts +124 -194
- package/types/exhaustive-ui-core-iconfield.d.ts +5 -13
- package/types/exhaustive-ui-core-icons-baseicon.d.ts +4 -5
- package/types/exhaustive-ui-core-image.d.ts +35 -68
- package/types/exhaustive-ui-core-imagecompare.d.ts +19 -20
- package/types/exhaustive-ui-core-inplace.d.ts +30 -42
- package/types/exhaustive-ui-core-inputgroup.d.ts +2 -9
- package/types/exhaustive-ui-core-inputgroupaddon.d.ts +6 -10
- package/types/exhaustive-ui-core-inputicon.d.ts +4 -11
- package/types/exhaustive-ui-core-inputmask.d.ts +53 -66
- package/types/exhaustive-ui-core-inputnumber.d.ts +62 -84
- package/types/exhaustive-ui-core-inputotp.d.ts +16 -20
- package/types/exhaustive-ui-core-inputtext.d.ts +5 -8
- package/types/exhaustive-ui-core-keyfilter.d.ts +11 -15
- package/types/exhaustive-ui-core-knob.d.ts +45 -60
- package/types/exhaustive-ui-core-listbox.d.ts +90 -126
- package/types/exhaustive-ui-core-megamenu.d.ts +45 -66
- package/types/exhaustive-ui-core-menu.d.ts +33 -53
- package/types/exhaustive-ui-core-menubar.d.ts +38 -85
- package/types/exhaustive-ui-core-metergroup.d.ts +39 -48
- package/types/exhaustive-ui-core-multiselect.d.ts +166 -219
- package/types/exhaustive-ui-core-orderlist.d.ts +58 -81
- package/types/exhaustive-ui-core-organizationchart.d.ts +32 -67
- package/types/exhaustive-ui-core-overlaybadge.d.ts +10 -20
- package/types/exhaustive-ui-core-paginator.d.ts +41 -69
- package/types/exhaustive-ui-core-panel.d.ts +18 -45
- package/types/exhaustive-ui-core-panelmenu.d.ts +31 -76
- package/types/exhaustive-ui-core-password.d.ts +56 -93
- package/types/exhaustive-ui-core-picklist.d.ts +107 -121
- package/types/exhaustive-ui-core-popover.d.ts +23 -47
- package/types/exhaustive-ui-core-rating.d.ts +18 -26
- package/types/exhaustive-ui-core-scroller.d.ts +90 -120
- package/types/exhaustive-ui-core-scrollpanel.d.ts +35 -46
- package/types/exhaustive-ui-core-scrolltop.d.ts +28 -45
- package/types/exhaustive-ui-core-select.d.ts +137 -188
- package/types/exhaustive-ui-core-selectbutton.d.ts +35 -44
- package/types/exhaustive-ui-core-slider.d.ts +52 -67
- package/types/exhaustive-ui-core-speeddial.d.ts +40 -56
- package/types/exhaustive-ui-core-splitbutton.d.ts +31 -71
- package/types/exhaustive-ui-core-splitter.d.ts +47 -59
- package/types/exhaustive-ui-core-steps.d.ts +24 -31
- package/types/exhaustive-ui-core-styleclass.d.ts +27 -33
- package/types/exhaustive-ui-core-table.d.ts +349 -453
- package/types/exhaustive-ui-core-terminal.d.ts +10 -22
- package/types/exhaustive-ui-core-textarea.d.ts +7 -10
- package/types/exhaustive-ui-core-tieredmenu.d.ts +49 -84
- package/types/exhaustive-ui-core-timeline.d.ts +20 -28
- package/types/exhaustive-ui-core-togglebutton.d.ts +32 -48
- package/types/exhaustive-ui-core-toggleswitch.d.ts +26 -37
- package/types/exhaustive-ui-core-toolbar.d.ts +17 -25
- package/types/exhaustive-ui-core-tooltip.d.ts +53 -88
- package/types/exhaustive-ui-core-tree.d.ts +82 -119
- package/types/exhaustive-ui-core-treeselect.d.ts +63 -92
- package/types/exhaustive-ui-core-treetable.d.ts +203 -280
- package/types/exhaustive-ui-core-types-chip.d.ts +1 -1
|
@@ -2,7 +2,7 @@ export * from '@exhaustive-ui/core/types/splitter';
|
|
|
2
2
|
import * as i2 from '@angular/common';
|
|
3
3
|
import { isPlatformBrowser, CommonModule } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { Injectable,
|
|
5
|
+
import { Injectable, inject, afterEveryRender, effect, untracked, afterNextRender, input, numberAttribute, output, contentChildren, contentChild, forwardRef, computed, signal, linkedSignal, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
|
|
6
6
|
import { getWidth, getHeight, getOuterWidth, getOuterHeight, addClass, isRTL, removeClass } from '@exhaustive-ui/utils';
|
|
7
7
|
import { PrimeTemplate, SharedModule } from '@exhaustive-ui/core/api';
|
|
8
8
|
import { BaseComponent, PARENT_INSTANCE } from '@exhaustive-ui/core/basecomponent';
|
|
@@ -12,13 +12,13 @@ import { style } from '@exhaustive-ui/styles/splitter';
|
|
|
12
12
|
import { BaseStyle } from '@exhaustive-ui/core/base';
|
|
13
13
|
|
|
14
14
|
const classes = {
|
|
15
|
-
root: ({ instance }) => ['p-splitter p-component', 'p-splitter-' + instance.layout],
|
|
15
|
+
root: ({ instance }) => ['p-splitter p-component', 'p-splitter-' + instance.layout()],
|
|
16
16
|
panel: ({ instance }) => ['p-splitterpanel', { 'p-splitterpanel-nested': instance.nestedState() }],
|
|
17
17
|
gutter: 'p-splitter-gutter',
|
|
18
18
|
gutterHandle: 'p-splitter-gutter-handle'
|
|
19
19
|
};
|
|
20
20
|
const inlineStyles = {
|
|
21
|
-
root: ({ instance }) => [{ display: 'flex', 'flex-wrap': 'nowrap' }, instance.layout === 'vertical' ? { 'flex-direction': 'column' } : '']
|
|
21
|
+
root: ({ instance }) => [{ display: 'flex', 'flex-wrap': 'nowrap' }, instance.layout() === 'vertical' ? { 'flex-direction': 'column' } : '']
|
|
22
22
|
};
|
|
23
23
|
class SplitterStyle extends BaseStyle {
|
|
24
24
|
name = 'splitter';
|
|
@@ -56,84 +56,105 @@ var SplitterClasses;
|
|
|
56
56
|
SplitterClasses["gutterHandle"] = "p-splitter-gutter-handle";
|
|
57
57
|
})(SplitterClasses || (SplitterClasses = {}));
|
|
58
58
|
|
|
59
|
-
const SPLITTER_INSTANCE = new InjectionToken('SPLITTER_INSTANCE');
|
|
60
59
|
/**
|
|
61
60
|
* Splitter is utilized to separate and resize panels.
|
|
62
61
|
* @group Components
|
|
63
62
|
*/
|
|
64
63
|
class Splitter extends BaseComponent {
|
|
65
64
|
componentName = 'Splitter';
|
|
66
|
-
$pcSplitter = inject(SPLITTER_INSTANCE, { optional: true, skipSelf: true }) ?? undefined;
|
|
67
65
|
bindDirectiveInstance = inject(Bind, { self: true });
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
constructor() {
|
|
67
|
+
super();
|
|
68
|
+
afterEveryRender(() => this.bindDirectiveInstance.setAttrs(this.ptms(['host', 'root'])));
|
|
69
|
+
effect(() => {
|
|
70
|
+
const panelSizes = this.panelSizes();
|
|
71
|
+
untracked(() => {
|
|
72
|
+
const panels = this.panels();
|
|
73
|
+
if (this.el && this.el.nativeElement && panels.length > 0) {
|
|
74
|
+
let children = [...this.el.nativeElement.children].filter((child) => child.getAttribute('data-pc-section') === 'panel');
|
|
75
|
+
children.forEach((child, i) => {
|
|
76
|
+
let panelInitialSize = panelSizes.length - 1 >= i ? panelSizes[i] : null;
|
|
77
|
+
let panelSize = panelInitialSize || 100 / panels.length;
|
|
78
|
+
child.style.flexBasis = 'calc(' + panelSize + '% - ' + (panels.length - 1) * this.gutterSize() + 'px)';
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
afterNextRender(() => {
|
|
84
|
+
const panels = this.panels();
|
|
85
|
+
if (panels && panels.length) {
|
|
86
|
+
let initialized = false;
|
|
87
|
+
if (this.isStateful()) {
|
|
88
|
+
initialized = this.restoreState();
|
|
89
|
+
}
|
|
90
|
+
if (!initialized) {
|
|
91
|
+
let children = [...this.el.nativeElement.children].filter((child) => child.getAttribute('data-pc-section') === 'panel');
|
|
92
|
+
let _panelSizes = [];
|
|
93
|
+
const panelSizes = this.panelSizes();
|
|
94
|
+
panels.map((panel, i) => {
|
|
95
|
+
let panelInitialSize = panelSizes.length - 1 >= i ? panelSizes[i] : null;
|
|
96
|
+
let panelSize = panelInitialSize || 100 / panels.length;
|
|
97
|
+
_panelSizes[i] = panelSize;
|
|
98
|
+
children[i].style.flexBasis = 'calc(' + panelSize + '% - ' + (panels.length - 1) * this.gutterSize() + 'px)';
|
|
99
|
+
});
|
|
100
|
+
this._panelSizes.set(_panelSizes);
|
|
101
|
+
this.prevSize.set(parseFloat(_panelSizes[0]).toFixed(4));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
70
105
|
}
|
|
71
|
-
/**
|
|
72
|
-
* Style class of the component.
|
|
73
|
-
* @deprecated since v20. Use `class` instead.
|
|
74
|
-
* @group Props
|
|
75
|
-
*/
|
|
76
|
-
styleClass;
|
|
77
106
|
/**
|
|
78
107
|
* Style class of the panel.
|
|
79
108
|
* @group Props
|
|
80
109
|
*/
|
|
81
|
-
panelStyleClass
|
|
110
|
+
panelStyleClass = input(/* @ts-ignore */
|
|
111
|
+
...(ngDevMode ? [undefined, { debugName: "panelStyleClass" }] : /* istanbul ignore next */ []));
|
|
82
112
|
/**
|
|
83
113
|
* Inline style of the panel.
|
|
84
114
|
* @group Props
|
|
85
115
|
*/
|
|
86
|
-
panelStyle
|
|
116
|
+
panelStyle = input(/* @ts-ignore */
|
|
117
|
+
...(ngDevMode ? [undefined, { debugName: "panelStyle" }] : /* istanbul ignore next */ []));
|
|
87
118
|
/**
|
|
88
119
|
* Defines where a stateful splitter keeps its state, valid values are 'session' for sessionStorage and 'local' for localStorage.
|
|
89
120
|
* @group Props
|
|
90
121
|
*/
|
|
91
|
-
stateStorage = 'session'
|
|
122
|
+
stateStorage = input('session', /* @ts-ignore */
|
|
123
|
+
...(ngDevMode ? [{ debugName: "stateStorage" }] : /* istanbul ignore next */ []));
|
|
92
124
|
/**
|
|
93
125
|
* Storage identifier of a stateful Splitter.
|
|
94
126
|
* @group Props
|
|
95
127
|
*/
|
|
96
|
-
stateKey = null
|
|
128
|
+
stateKey = input(null, /* @ts-ignore */
|
|
129
|
+
...(ngDevMode ? [{ debugName: "stateKey" }] : /* istanbul ignore next */ []));
|
|
97
130
|
/**
|
|
98
131
|
* Orientation of the panels. Valid values are 'horizontal' and 'vertical'.
|
|
99
132
|
* @group Props
|
|
100
133
|
*/
|
|
101
|
-
layout = 'horizontal'
|
|
134
|
+
layout = input('horizontal', /* @ts-ignore */
|
|
135
|
+
...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
|
|
102
136
|
/**
|
|
103
137
|
* Size of the divider in pixels.
|
|
104
138
|
* @group Props
|
|
105
139
|
*/
|
|
106
|
-
gutterSize = 4;
|
|
140
|
+
gutterSize = input(4, { ...(ngDevMode ? { debugName: "gutterSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
107
141
|
/**
|
|
108
142
|
* Step factor to increment/decrement the size of the panels while pressing the arrow keys.
|
|
109
143
|
* @group Props
|
|
110
144
|
*/
|
|
111
|
-
step = 5;
|
|
145
|
+
step = input(5, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
112
146
|
/**
|
|
113
147
|
* Minimum size of the elements relative to 100%.
|
|
114
148
|
* @group Props
|
|
115
149
|
*/
|
|
116
|
-
minSizes = []
|
|
150
|
+
minSizes = input([], /* @ts-ignore */
|
|
151
|
+
...(ngDevMode ? [{ debugName: "minSizes" }] : /* istanbul ignore next */ []));
|
|
117
152
|
/**
|
|
118
153
|
* Size of the elements relative to 100%.
|
|
119
154
|
* @group Props
|
|
120
155
|
*/
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
set panelSizes(val) {
|
|
125
|
-
this._panelSizes = val;
|
|
126
|
-
if (this.el && this.el.nativeElement && this.panels.length > 0) {
|
|
127
|
-
let children = [...this.el.nativeElement.children].filter((child) => child.getAttribute('data-pc-section') === 'panel');
|
|
128
|
-
let _panelSizes = [];
|
|
129
|
-
this.panels.map((panel, i) => {
|
|
130
|
-
let panelInitialSize = this.panelSizes.length - 1 >= i ? this.panelSizes[i] : null;
|
|
131
|
-
let panelSize = panelInitialSize || 100 / this.panels.length;
|
|
132
|
-
_panelSizes[i] = panelSize;
|
|
133
|
-
children[i].style.flexBasis = 'calc(' + panelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
}
|
|
156
|
+
panelSizes = input([], /* @ts-ignore */
|
|
157
|
+
...(ngDevMode ? [{ debugName: "panelSizes" }] : /* istanbul ignore next */ []));
|
|
137
158
|
/**
|
|
138
159
|
* Callback to invoke when resize ends.
|
|
139
160
|
* @param {SplitterResizeEndEvent} event - Custom panel resize end event
|
|
@@ -154,132 +175,114 @@ class Splitter extends BaseComponent {
|
|
|
154
175
|
...(ngDevMode ? [{ debugName: "splitter" }] : /* istanbul ignore next */ []));
|
|
155
176
|
nestedState = computed(() => this.splitter(), /* @ts-ignore */
|
|
156
177
|
...(ngDevMode ? [{ debugName: "nestedState" }] : /* istanbul ignore next */ []));
|
|
157
|
-
panels = []
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
178
|
+
panels = computed(() => [...this.templates().map((item) => item.template), ...this.panelChildren()], /* @ts-ignore */
|
|
179
|
+
...(ngDevMode ? [{ debugName: "panels" }] : /* istanbul ignore next */ []));
|
|
180
|
+
dragging = signal(false, /* @ts-ignore */
|
|
181
|
+
...(ngDevMode ? [{ debugName: "dragging" }] : /* istanbul ignore next */ []));
|
|
182
|
+
mouseMoveListener = signal(undefined, /* @ts-ignore */
|
|
183
|
+
...(ngDevMode ? [{ debugName: "mouseMoveListener" }] : /* istanbul ignore next */ []));
|
|
184
|
+
mouseUpListener = signal(undefined, /* @ts-ignore */
|
|
185
|
+
...(ngDevMode ? [{ debugName: "mouseUpListener" }] : /* istanbul ignore next */ []));
|
|
186
|
+
touchMoveListener = signal(undefined, /* @ts-ignore */
|
|
187
|
+
...(ngDevMode ? [{ debugName: "touchMoveListener" }] : /* istanbul ignore next */ []));
|
|
188
|
+
touchEndListener = signal(undefined, /* @ts-ignore */
|
|
189
|
+
...(ngDevMode ? [{ debugName: "touchEndListener" }] : /* istanbul ignore next */ []));
|
|
190
|
+
size = signal(undefined, /* @ts-ignore */
|
|
191
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
192
|
+
gutterElement = signal(undefined, /* @ts-ignore */
|
|
193
|
+
...(ngDevMode ? [{ debugName: "gutterElement" }] : /* istanbul ignore next */ []));
|
|
194
|
+
startPos = signal(undefined, /* @ts-ignore */
|
|
195
|
+
...(ngDevMode ? [{ debugName: "startPos" }] : /* istanbul ignore next */ []));
|
|
196
|
+
prevPanelElement = signal(undefined, /* @ts-ignore */
|
|
197
|
+
...(ngDevMode ? [{ debugName: "prevPanelElement" }] : /* istanbul ignore next */ []));
|
|
198
|
+
nextPanelElement = signal(undefined, /* @ts-ignore */
|
|
199
|
+
...(ngDevMode ? [{ debugName: "nextPanelElement" }] : /* istanbul ignore next */ []));
|
|
200
|
+
nextPanelSize = signal(undefined, /* @ts-ignore */
|
|
201
|
+
...(ngDevMode ? [{ debugName: "nextPanelSize" }] : /* istanbul ignore next */ []));
|
|
202
|
+
prevPanelSize = signal(undefined, /* @ts-ignore */
|
|
203
|
+
...(ngDevMode ? [{ debugName: "prevPanelSize" }] : /* istanbul ignore next */ []));
|
|
204
|
+
_panelSizes = linkedSignal(() => this.panelSizes(), /* @ts-ignore */
|
|
205
|
+
...(ngDevMode ? [{ debugName: "_panelSizes" }] : /* istanbul ignore next */ []));
|
|
206
|
+
prevPanelIndex = signal(undefined, /* @ts-ignore */
|
|
207
|
+
...(ngDevMode ? [{ debugName: "prevPanelIndex" }] : /* istanbul ignore next */ []));
|
|
208
|
+
timer = signal(undefined, /* @ts-ignore */
|
|
209
|
+
...(ngDevMode ? [{ debugName: "timer" }] : /* istanbul ignore next */ []));
|
|
210
|
+
prevSize = signal(undefined, /* @ts-ignore */
|
|
211
|
+
...(ngDevMode ? [{ debugName: "prevSize" }] : /* istanbul ignore next */ []));
|
|
174
212
|
_componentStyle = inject(SplitterStyle);
|
|
175
|
-
onAfterContentInit() {
|
|
176
|
-
const templates = this.templates();
|
|
177
|
-
if (templates && templates.length > 0) {
|
|
178
|
-
templates.forEach((item) => {
|
|
179
|
-
switch (item.getType()) {
|
|
180
|
-
case 'panel':
|
|
181
|
-
this.panels.push(item.template);
|
|
182
|
-
break;
|
|
183
|
-
default:
|
|
184
|
-
this.panels.push(item.template);
|
|
185
|
-
break;
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
const panelChildren = this.panelChildren();
|
|
190
|
-
if (panelChildren && panelChildren.length > 0) {
|
|
191
|
-
panelChildren.forEach((item) => {
|
|
192
|
-
this.panels.push(item);
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
onAfterViewInit() {
|
|
197
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
198
|
-
if (this.panels && this.panels.length) {
|
|
199
|
-
let initialized = false;
|
|
200
|
-
if (this.isStateful()) {
|
|
201
|
-
initialized = this.restoreState();
|
|
202
|
-
}
|
|
203
|
-
if (!initialized) {
|
|
204
|
-
let children = [...this.el.nativeElement.children].filter((child) => child.getAttribute('data-pc-section') === 'panel');
|
|
205
|
-
let _panelSizes = [];
|
|
206
|
-
this.panels.map((panel, i) => {
|
|
207
|
-
let panelInitialSize = this.panelSizes.length - 1 >= i ? this.panelSizes[i] : null;
|
|
208
|
-
let panelSize = panelInitialSize || 100 / this.panels.length;
|
|
209
|
-
_panelSizes[i] = panelSize;
|
|
210
|
-
children[i].style.flexBasis = 'calc(' + panelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
|
|
211
|
-
});
|
|
212
|
-
this._panelSizes = _panelSizes;
|
|
213
|
-
this.prevSize = parseFloat(_panelSizes[0]).toFixed(4);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
213
|
resizeStart(event, index, isKeyDown) {
|
|
219
|
-
|
|
220
|
-
this.
|
|
214
|
+
const gutterElement = event.currentTarget || event.target.parentElement;
|
|
215
|
+
this.gutterElement.set(gutterElement);
|
|
216
|
+
const size = this.horizontal() ? getWidth(this.el.nativeElement) : getHeight(this.el.nativeElement);
|
|
217
|
+
this.size.set(size);
|
|
221
218
|
if (!isKeyDown) {
|
|
222
|
-
this.dragging
|
|
223
|
-
this.startPos
|
|
219
|
+
this.dragging.set(true);
|
|
220
|
+
this.startPos.set(this.horizontal() ? (event instanceof MouseEvent ? event.pageX : event.changedTouches[0].pageX) : event instanceof MouseEvent ? event.pageY : event.changedTouches[0].pageY);
|
|
224
221
|
}
|
|
225
|
-
|
|
226
|
-
|
|
222
|
+
const prevPanelElement = gutterElement.previousElementSibling;
|
|
223
|
+
const nextPanelElement = gutterElement.nextElementSibling;
|
|
224
|
+
this.prevPanelElement.set(prevPanelElement);
|
|
225
|
+
this.nextPanelElement.set(nextPanelElement);
|
|
227
226
|
if (isKeyDown) {
|
|
228
|
-
this.prevPanelSize
|
|
229
|
-
this.nextPanelSize
|
|
227
|
+
this.prevPanelSize.set(this.horizontal() ? getOuterWidth(prevPanelElement, true) : getOuterHeight(prevPanelElement, true));
|
|
228
|
+
this.nextPanelSize.set(this.horizontal() ? getOuterWidth(nextPanelElement, true) : getOuterHeight(nextPanelElement, true));
|
|
230
229
|
}
|
|
231
230
|
else {
|
|
232
|
-
this.prevPanelSize
|
|
233
|
-
this.nextPanelSize
|
|
231
|
+
this.prevPanelSize.set((100 * (this.horizontal() ? getOuterWidth(prevPanelElement, true) : getOuterHeight(prevPanelElement, true))) / size);
|
|
232
|
+
this.nextPanelSize.set((100 * (this.horizontal() ? getOuterWidth(nextPanelElement, true) : getOuterHeight(nextPanelElement, true))) / size);
|
|
234
233
|
}
|
|
235
|
-
this.prevPanelIndex
|
|
236
|
-
addClass(
|
|
237
|
-
|
|
234
|
+
this.prevPanelIndex.set(index);
|
|
235
|
+
addClass(gutterElement, 'p-splitter-gutter-resizing');
|
|
236
|
+
gutterElement.setAttribute('data-p-gutter-resizing', 'true');
|
|
238
237
|
addClass(this.el.nativeElement, 'p-splitter-resizing');
|
|
239
238
|
this.el.nativeElement.setAttribute('data-p-resizing', 'true');
|
|
240
|
-
this.onResizeStart.emit({ originalEvent: event, sizes: this._panelSizes });
|
|
239
|
+
this.onResizeStart.emit({ originalEvent: event, sizes: this._panelSizes() });
|
|
241
240
|
}
|
|
242
241
|
onResize(event, step, isKeyDown) {
|
|
243
242
|
let newPos, newPrevPanelSize, newNextPanelSize;
|
|
244
243
|
if (isKeyDown) {
|
|
245
244
|
if (this.horizontal()) {
|
|
246
|
-
newPrevPanelSize = (100 * ((this.prevPanelSize ?? 0) + (step ?? 0))) / (this.size ?? 1);
|
|
247
|
-
newNextPanelSize = (100 * ((this.nextPanelSize ?? 0) - (step ?? 0))) / (this.size ?? 1);
|
|
245
|
+
newPrevPanelSize = (100 * ((this.prevPanelSize() ?? 0) + (step ?? 0))) / (this.size() ?? 1);
|
|
246
|
+
newNextPanelSize = (100 * ((this.nextPanelSize() ?? 0) - (step ?? 0))) / (this.size() ?? 1);
|
|
248
247
|
}
|
|
249
248
|
else {
|
|
250
|
-
newPrevPanelSize = (100 * ((this.prevPanelSize ?? 0) - (step ?? 0))) / (this.size ?? 1);
|
|
251
|
-
newNextPanelSize = (100 * ((this.nextPanelSize ?? 0) + (step ?? 0))) / (this.size ?? 1);
|
|
249
|
+
newPrevPanelSize = (100 * ((this.prevPanelSize() ?? 0) - (step ?? 0))) / (this.size() ?? 1);
|
|
250
|
+
newNextPanelSize = (100 * ((this.nextPanelSize() ?? 0) + (step ?? 0))) / (this.size() ?? 1);
|
|
252
251
|
}
|
|
253
252
|
}
|
|
254
253
|
else {
|
|
255
254
|
if (this.horizontal()) {
|
|
256
255
|
if (isRTL(this.el.nativeElement)) {
|
|
257
|
-
newPos = (((this.startPos ?? 0) - event.pageX) * 100) / (this.size ?? 1);
|
|
256
|
+
newPos = (((this.startPos() ?? 0) - event.pageX) * 100) / (this.size() ?? 1);
|
|
258
257
|
}
|
|
259
258
|
else {
|
|
260
|
-
newPos = ((event.pageX - (this.startPos ?? 0)) * 100) / (this.size ?? 1);
|
|
259
|
+
newPos = ((event.pageX - (this.startPos() ?? 0)) * 100) / (this.size() ?? 1);
|
|
261
260
|
}
|
|
262
261
|
}
|
|
263
262
|
else {
|
|
264
|
-
newPos = ((event.pageY - (this.startPos ?? 0)) * 100) / (this.size ?? 1);
|
|
263
|
+
newPos = ((event.pageY - (this.startPos() ?? 0)) * 100) / (this.size() ?? 1);
|
|
265
264
|
}
|
|
266
|
-
newPrevPanelSize = this.prevPanelSize + newPos;
|
|
267
|
-
newNextPanelSize = this.nextPanelSize - newPos;
|
|
265
|
+
newPrevPanelSize = this.prevPanelSize() + newPos;
|
|
266
|
+
newNextPanelSize = this.nextPanelSize() - newPos;
|
|
268
267
|
}
|
|
269
|
-
this.prevSize
|
|
268
|
+
this.prevSize.set(parseFloat(newPrevPanelSize).toFixed(4));
|
|
270
269
|
if (this.validateResize(newPrevPanelSize, newNextPanelSize)) {
|
|
271
|
-
this.prevPanelElement.style.flexBasis = 'calc(' + newPrevPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
|
|
272
|
-
this.nextPanelElement.style.flexBasis = 'calc(' + newNextPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
|
|
273
|
-
this._panelSizes
|
|
274
|
-
|
|
270
|
+
this.prevPanelElement().style.flexBasis = 'calc(' + newPrevPanelSize + '% - ' + (this.panels().length - 1) * this.gutterSize() + 'px)';
|
|
271
|
+
this.nextPanelElement().style.flexBasis = 'calc(' + newNextPanelSize + '% - ' + (this.panels().length - 1) * this.gutterSize() + 'px)';
|
|
272
|
+
this._panelSizes.update((sizes) => {
|
|
273
|
+
const _panelSizes = [...sizes];
|
|
274
|
+
_panelSizes[this.prevPanelIndex()] = newPrevPanelSize;
|
|
275
|
+
_panelSizes[this.prevPanelIndex() + 1] = newNextPanelSize;
|
|
276
|
+
return _panelSizes;
|
|
277
|
+
});
|
|
275
278
|
}
|
|
276
279
|
}
|
|
277
280
|
resizeEnd(event) {
|
|
278
281
|
if (this.isStateful()) {
|
|
279
282
|
this.saveState();
|
|
280
283
|
}
|
|
281
|
-
this.onResizeEnd.emit({ originalEvent: event, sizes: this._panelSizes });
|
|
282
|
-
removeClass(this.gutterElement, 'p-splitter-gutter-resizing');
|
|
284
|
+
this.onResizeEnd.emit({ originalEvent: event, sizes: this._panelSizes() });
|
|
285
|
+
removeClass(this.gutterElement(), 'p-splitter-gutter-resizing');
|
|
283
286
|
removeClass(this.el.nativeElement, 'p-splitter-resizing');
|
|
284
287
|
this.clear();
|
|
285
288
|
}
|
|
@@ -310,13 +313,13 @@ class Splitter extends BaseComponent {
|
|
|
310
313
|
}
|
|
311
314
|
setTimer(event, index, step) {
|
|
312
315
|
this.clearTimer();
|
|
313
|
-
this.timer
|
|
316
|
+
this.timer.set(setTimeout(() => {
|
|
314
317
|
this.repeat(event, index, step);
|
|
315
|
-
}, 40);
|
|
318
|
+
}, 40));
|
|
316
319
|
}
|
|
317
320
|
clearTimer() {
|
|
318
|
-
if (this.timer) {
|
|
319
|
-
clearTimeout(this.timer);
|
|
321
|
+
if (this.timer()) {
|
|
322
|
+
clearTimeout(this.timer());
|
|
320
323
|
}
|
|
321
324
|
}
|
|
322
325
|
onGutterKeyUp(event) {
|
|
@@ -326,29 +329,29 @@ class Splitter extends BaseComponent {
|
|
|
326
329
|
onGutterKeyDown(event, index) {
|
|
327
330
|
switch (event.code) {
|
|
328
331
|
case 'ArrowLeft': {
|
|
329
|
-
if (this.layout === 'horizontal') {
|
|
330
|
-
this.setTimer(event, index, this.step * -1);
|
|
332
|
+
if (this.layout() === 'horizontal') {
|
|
333
|
+
this.setTimer(event, index, this.step() * -1);
|
|
331
334
|
}
|
|
332
335
|
event.preventDefault();
|
|
333
336
|
break;
|
|
334
337
|
}
|
|
335
338
|
case 'ArrowRight': {
|
|
336
|
-
if (this.layout === 'horizontal') {
|
|
337
|
-
this.setTimer(event, index, this.step);
|
|
339
|
+
if (this.layout() === 'horizontal') {
|
|
340
|
+
this.setTimer(event, index, this.step());
|
|
338
341
|
}
|
|
339
342
|
event.preventDefault();
|
|
340
343
|
break;
|
|
341
344
|
}
|
|
342
345
|
case 'ArrowDown': {
|
|
343
|
-
if (this.layout === 'vertical') {
|
|
344
|
-
this.setTimer(event, index, this.step * -1);
|
|
346
|
+
if (this.layout() === 'vertical') {
|
|
347
|
+
this.setTimer(event, index, this.step() * -1);
|
|
345
348
|
}
|
|
346
349
|
event.preventDefault();
|
|
347
350
|
break;
|
|
348
351
|
}
|
|
349
352
|
case 'ArrowUp': {
|
|
350
|
-
if (this.layout === 'vertical') {
|
|
351
|
-
this.setTimer(event, index, this.step);
|
|
353
|
+
if (this.layout() === 'vertical') {
|
|
354
|
+
this.setTimer(event, index, this.step());
|
|
352
355
|
}
|
|
353
356
|
event.preventDefault();
|
|
354
357
|
break;
|
|
@@ -359,83 +362,87 @@ class Splitter extends BaseComponent {
|
|
|
359
362
|
}
|
|
360
363
|
}
|
|
361
364
|
validateResize(newPrevPanelSize, newNextPanelSize) {
|
|
362
|
-
|
|
365
|
+
const minSizes = this.minSizes();
|
|
366
|
+
if (minSizes.length >= 1 && minSizes[0] && minSizes[0] > newPrevPanelSize) {
|
|
363
367
|
return false;
|
|
364
368
|
}
|
|
365
|
-
if (
|
|
369
|
+
if (minSizes.length > 1 && minSizes[1] && minSizes[1] > newNextPanelSize) {
|
|
366
370
|
return false;
|
|
367
371
|
}
|
|
368
372
|
return true;
|
|
369
373
|
}
|
|
370
374
|
bindMouseListeners() {
|
|
371
|
-
if (!this.mouseMoveListener) {
|
|
372
|
-
this.mouseMoveListener
|
|
375
|
+
if (!this.mouseMoveListener()) {
|
|
376
|
+
this.mouseMoveListener.set(this.renderer.listen(this.document, 'mousemove', (event) => {
|
|
373
377
|
this.onResize(event);
|
|
374
|
-
});
|
|
378
|
+
}));
|
|
375
379
|
}
|
|
376
|
-
if (!this.mouseUpListener) {
|
|
377
|
-
this.mouseUpListener
|
|
380
|
+
if (!this.mouseUpListener()) {
|
|
381
|
+
this.mouseUpListener.set(this.renderer.listen(this.document, 'mouseup', (event) => {
|
|
378
382
|
this.resizeEnd(event);
|
|
379
383
|
this.unbindMouseListeners();
|
|
380
|
-
});
|
|
384
|
+
}));
|
|
381
385
|
}
|
|
382
386
|
}
|
|
383
387
|
bindTouchListeners() {
|
|
384
|
-
if (!this.touchMoveListener) {
|
|
385
|
-
this.touchMoveListener
|
|
388
|
+
if (!this.touchMoveListener()) {
|
|
389
|
+
this.touchMoveListener.set(this.renderer.listen(this.document, 'touchmove', (event) => {
|
|
386
390
|
this.onResize(event.changedTouches[0]);
|
|
387
|
-
});
|
|
391
|
+
}));
|
|
388
392
|
}
|
|
389
|
-
if (!this.touchEndListener) {
|
|
390
|
-
this.touchEndListener
|
|
393
|
+
if (!this.touchEndListener()) {
|
|
394
|
+
this.touchEndListener.set(this.renderer.listen(this.document, 'touchend', (event) => {
|
|
391
395
|
this.resizeEnd(event);
|
|
392
396
|
this.unbindTouchListeners();
|
|
393
|
-
});
|
|
397
|
+
}));
|
|
394
398
|
}
|
|
395
399
|
}
|
|
396
400
|
unbindMouseListeners() {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
401
|
+
const mouseMoveListener = this.mouseMoveListener();
|
|
402
|
+
if (mouseMoveListener) {
|
|
403
|
+
mouseMoveListener();
|
|
404
|
+
this.mouseMoveListener.set(null);
|
|
400
405
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
406
|
+
const mouseUpListener = this.mouseUpListener();
|
|
407
|
+
if (mouseUpListener) {
|
|
408
|
+
mouseUpListener();
|
|
409
|
+
this.mouseUpListener.set(null);
|
|
404
410
|
}
|
|
405
411
|
}
|
|
406
412
|
unbindTouchListeners() {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
413
|
+
const touchMoveListener = this.touchMoveListener();
|
|
414
|
+
if (touchMoveListener) {
|
|
415
|
+
touchMoveListener();
|
|
416
|
+
this.touchMoveListener.set(null);
|
|
410
417
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
418
|
+
const touchEndListener = this.touchEndListener();
|
|
419
|
+
if (touchEndListener) {
|
|
420
|
+
touchEndListener();
|
|
421
|
+
this.touchEndListener.set(null);
|
|
414
422
|
}
|
|
415
423
|
}
|
|
416
424
|
clear() {
|
|
417
|
-
this.dragging
|
|
418
|
-
this.size
|
|
419
|
-
this.startPos
|
|
420
|
-
this.prevPanelElement
|
|
421
|
-
this.nextPanelElement
|
|
422
|
-
this.prevPanelSize
|
|
423
|
-
this.nextPanelSize
|
|
424
|
-
this.gutterElement
|
|
425
|
-
this.prevPanelIndex
|
|
426
|
-
}
|
|
427
|
-
isStateful() {
|
|
428
|
-
return this.stateKey != null;
|
|
425
|
+
this.dragging.set(false);
|
|
426
|
+
this.size.set(null);
|
|
427
|
+
this.startPos.set(null);
|
|
428
|
+
this.prevPanelElement.set(null);
|
|
429
|
+
this.nextPanelElement.set(null);
|
|
430
|
+
this.prevPanelSize.set(null);
|
|
431
|
+
this.nextPanelSize.set(null);
|
|
432
|
+
this.gutterElement.set(null);
|
|
433
|
+
this.prevPanelIndex.set(null);
|
|
429
434
|
}
|
|
435
|
+
isStateful = computed(() => this.stateKey() != null, /* @ts-ignore */
|
|
436
|
+
...(ngDevMode ? [{ debugName: "isStateful" }] : /* istanbul ignore next */ []));
|
|
430
437
|
getStorage() {
|
|
431
438
|
if (isPlatformBrowser(this.platformId)) {
|
|
432
|
-
switch (this.stateStorage) {
|
|
439
|
+
switch (this.stateStorage()) {
|
|
433
440
|
case 'local':
|
|
434
441
|
return this.document.defaultView?.localStorage;
|
|
435
442
|
case 'session':
|
|
436
443
|
return this.document.defaultView?.sessionStorage;
|
|
437
444
|
default:
|
|
438
|
-
throw new Error(this.stateStorage + ' is not a valid value for the state storage, supported values are "local" and "session".');
|
|
445
|
+
throw new Error(this.stateStorage() + ' is not a valid value for the state storage, supported values are "local" and "session".');
|
|
439
446
|
}
|
|
440
447
|
}
|
|
441
448
|
else {
|
|
@@ -443,43 +450,43 @@ class Splitter extends BaseComponent {
|
|
|
443
450
|
}
|
|
444
451
|
}
|
|
445
452
|
saveState() {
|
|
446
|
-
this.getStorage()?.setItem(this.stateKey, JSON.stringify(this._panelSizes));
|
|
453
|
+
this.getStorage()?.setItem(this.stateKey(), JSON.stringify(this._panelSizes()));
|
|
447
454
|
}
|
|
448
455
|
restoreState() {
|
|
449
456
|
const storage = this.getStorage();
|
|
450
|
-
const stateString = storage?.getItem(this.stateKey);
|
|
457
|
+
const stateString = storage?.getItem(this.stateKey());
|
|
451
458
|
if (stateString) {
|
|
452
|
-
|
|
459
|
+
const _panelSizes = JSON.parse(stateString);
|
|
460
|
+
this._panelSizes.set(_panelSizes);
|
|
453
461
|
let children = [...this.el.nativeElement.children].filter((child) => child.getAttribute('data-pc-section') === 'panel');
|
|
454
462
|
children.forEach((child, i) => {
|
|
455
|
-
child.style.flexBasis = 'calc(' +
|
|
463
|
+
child.style.flexBasis = 'calc(' + _panelSizes[i] + '% - ' + (this.panels().length - 1) * this.gutterSize() + 'px)';
|
|
456
464
|
});
|
|
457
465
|
return true;
|
|
458
466
|
}
|
|
459
467
|
return false;
|
|
460
468
|
}
|
|
461
|
-
gutterStyle() {
|
|
469
|
+
gutterStyle = computed(() => {
|
|
462
470
|
if (this.horizontal())
|
|
463
|
-
return { width: this.gutterSize + 'px' };
|
|
471
|
+
return { width: this.gutterSize() + 'px' };
|
|
464
472
|
else
|
|
465
|
-
return { height: this.gutterSize + 'px' };
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
}
|
|
476
|
-
static
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
<div [pBind]="ptm('panel')" [class]="cn(cx('panel'), panelStyleClass)" [ngStyle]="panelStyle" tabindex="-1">
|
|
473
|
+
return { height: this.gutterSize() + 'px' };
|
|
474
|
+
}, /* @ts-ignore */
|
|
475
|
+
...(ngDevMode ? [{ debugName: "gutterStyle" }] : /* istanbul ignore next */ []));
|
|
476
|
+
horizontal = computed(() => this.layout() === 'horizontal', /* @ts-ignore */
|
|
477
|
+
...(ngDevMode ? [{ debugName: "horizontal" }] : /* istanbul ignore next */ []));
|
|
478
|
+
dataP = computed(() => this.cn({
|
|
479
|
+
[this.layout()]: this.layout(),
|
|
480
|
+
nested: this.nestedState() != null
|
|
481
|
+
}), /* @ts-ignore */
|
|
482
|
+
...(ngDevMode ? [{ debugName: "dataP" }] : /* istanbul ignore next */ []));
|
|
483
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: Splitter, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
484
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: Splitter, isStandalone: true, selector: "p-splitter", inputs: { panelStyleClass: { classPropertyName: "panelStyleClass", publicName: "panelStyleClass", isSignal: true, isRequired: false, transformFunction: null }, panelStyle: { classPropertyName: "panelStyle", publicName: "panelStyle", isSignal: true, isRequired: false, transformFunction: null }, stateStorage: { classPropertyName: "stateStorage", publicName: "stateStorage", isSignal: true, isRequired: false, transformFunction: null }, stateKey: { classPropertyName: "stateKey", publicName: "stateKey", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, gutterSize: { classPropertyName: "gutterSize", publicName: "gutterSize", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, minSizes: { classPropertyName: "minSizes", publicName: "minSizes", isSignal: true, isRequired: false, transformFunction: null }, panelSizes: { classPropertyName: "panelSizes", publicName: "panelSizes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onResizeEnd: "onResizeEnd", onResizeStart: "onResizeStart" }, host: { properties: { "class": "cx('root')", "attr.data-p-gutter-resizing": "false", "attr.data-p": "dataP()" } }, providers: [SplitterStyle, { provide: PARENT_INSTANCE, useExisting: Splitter }], queries: [{ propertyName: "templates", predicate: PrimeTemplate, isSignal: true }, { propertyName: "panelChildren", predicate: ["panel"], isSignal: true }, { propertyName: "splitter", first: true, predicate: i0.forwardRef(() => Splitter), descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0, template: `
|
|
485
|
+
@for (panel of panels(); track panel; let i = $index) {
|
|
486
|
+
<div [pBind]="ptm('panel')" [class]="cn(cx('panel'), panelStyleClass())" [ngStyle]="panelStyle()" tabindex="-1">
|
|
480
487
|
<ng-container *ngTemplateOutlet="panel"></ng-container>
|
|
481
488
|
</div>
|
|
482
|
-
@if (i !== panels.length - 1) {
|
|
489
|
+
@if (i !== panels().length - 1) {
|
|
483
490
|
<div
|
|
484
491
|
[pBind]="ptm('gutter')"
|
|
485
492
|
[class]="cx('gutter')"
|
|
@@ -490,15 +497,15 @@ class Splitter extends BaseComponent {
|
|
|
490
497
|
(touchmove)="onGutterTouchMove($event)"
|
|
491
498
|
(touchend)="onGutterTouchEnd($event)"
|
|
492
499
|
[attr.data-p-gutter-resizing]="false"
|
|
493
|
-
[attr.data-p]="dataP"
|
|
500
|
+
[attr.data-p]="dataP()"
|
|
494
501
|
>
|
|
495
502
|
<div
|
|
496
503
|
[pBind]="ptm('gutterHandle')"
|
|
497
504
|
[class]="cx('gutterHandle')"
|
|
498
505
|
tabindex="0"
|
|
499
506
|
[ngStyle]="gutterStyle()"
|
|
500
|
-
[attr.aria-orientation]="layout"
|
|
501
|
-
[attr.aria-valuenow]="prevSize"
|
|
507
|
+
[attr.aria-orientation]="layout()"
|
|
508
|
+
[attr.aria-valuenow]="prevSize()"
|
|
502
509
|
(keyup)="onGutterKeyUp($event)"
|
|
503
510
|
(keydown)="onGutterKeyDown($event, i)"
|
|
504
511
|
></div>
|
|
@@ -511,14 +518,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
511
518
|
type: Component,
|
|
512
519
|
args: [{
|
|
513
520
|
selector: 'p-splitter',
|
|
514
|
-
standalone: true,
|
|
515
521
|
imports: [CommonModule, SharedModule, BindModule],
|
|
516
522
|
template: `
|
|
517
|
-
@for (panel of panels; track panel; let i = $index) {
|
|
518
|
-
<div [pBind]="ptm('panel')" [class]="cn(cx('panel'), panelStyleClass)" [ngStyle]="panelStyle" tabindex="-1">
|
|
523
|
+
@for (panel of panels(); track panel; let i = $index) {
|
|
524
|
+
<div [pBind]="ptm('panel')" [class]="cn(cx('panel'), panelStyleClass())" [ngStyle]="panelStyle()" tabindex="-1">
|
|
519
525
|
<ng-container *ngTemplateOutlet="panel"></ng-container>
|
|
520
526
|
</div>
|
|
521
|
-
@if (i !== panels.length - 1) {
|
|
527
|
+
@if (i !== panels().length - 1) {
|
|
522
528
|
<div
|
|
523
529
|
[pBind]="ptm('gutter')"
|
|
524
530
|
[class]="cx('gutter')"
|
|
@@ -529,15 +535,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
529
535
|
(touchmove)="onGutterTouchMove($event)"
|
|
530
536
|
(touchend)="onGutterTouchEnd($event)"
|
|
531
537
|
[attr.data-p-gutter-resizing]="false"
|
|
532
|
-
[attr.data-p]="dataP"
|
|
538
|
+
[attr.data-p]="dataP()"
|
|
533
539
|
>
|
|
534
540
|
<div
|
|
535
541
|
[pBind]="ptm('gutterHandle')"
|
|
536
542
|
[class]="cx('gutterHandle')"
|
|
537
543
|
tabindex="0"
|
|
538
544
|
[ngStyle]="gutterStyle()"
|
|
539
|
-
[attr.aria-orientation]="layout"
|
|
540
|
-
[attr.aria-valuenow]="prevSize"
|
|
545
|
+
[attr.aria-orientation]="layout()"
|
|
546
|
+
[attr.aria-valuenow]="prevSize()"
|
|
541
547
|
(keyup)="onGutterKeyUp($event)"
|
|
542
548
|
(keydown)="onGutterKeyDown($event, i)"
|
|
543
549
|
></div>
|
|
@@ -548,36 +554,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
548
554
|
encapsulation: ViewEncapsulation.None,
|
|
549
555
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
550
556
|
host: {
|
|
551
|
-
'[class]': "
|
|
557
|
+
'[class]': "cx('root')",
|
|
552
558
|
'[attr.data-p-gutter-resizing]': 'false',
|
|
553
|
-
'[attr.data-p]': 'dataP'
|
|
559
|
+
'[attr.data-p]': 'dataP()'
|
|
554
560
|
},
|
|
555
|
-
providers: [SplitterStyle, { provide:
|
|
561
|
+
providers: [SplitterStyle, { provide: PARENT_INSTANCE, useExisting: Splitter }],
|
|
556
562
|
hostDirectives: [Bind]
|
|
557
563
|
}]
|
|
558
|
-
}], propDecorators: {
|
|
559
|
-
type: Input
|
|
560
|
-
}], panelStyleClass: [{
|
|
561
|
-
type: Input
|
|
562
|
-
}], panelStyle: [{
|
|
563
|
-
type: Input
|
|
564
|
-
}], stateStorage: [{
|
|
565
|
-
type: Input
|
|
566
|
-
}], stateKey: [{
|
|
567
|
-
type: Input
|
|
568
|
-
}], layout: [{
|
|
569
|
-
type: Input
|
|
570
|
-
}], gutterSize: [{
|
|
571
|
-
type: Input,
|
|
572
|
-
args: [{ transform: numberAttribute }]
|
|
573
|
-
}], step: [{
|
|
574
|
-
type: Input,
|
|
575
|
-
args: [{ transform: numberAttribute }]
|
|
576
|
-
}], minSizes: [{
|
|
577
|
-
type: Input
|
|
578
|
-
}], panelSizes: [{
|
|
579
|
-
type: Input
|
|
580
|
-
}], onResizeEnd: [{ type: i0.Output, args: ["onResizeEnd"] }], onResizeStart: [{ type: i0.Output, args: ["onResizeStart"] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PrimeTemplate), { isSignal: true }] }], panelChildren: [{ type: i0.ContentChildren, args: ['panel', { isSignal: true }] }], splitter: [{ type: i0.ContentChild, args: [forwardRef(() => Splitter), { isSignal: true }] }] } });
|
|
564
|
+
}], ctorParameters: () => [], propDecorators: { panelStyleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelStyleClass", required: false }] }], panelStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelStyle", required: false }] }], stateStorage: [{ type: i0.Input, args: [{ isSignal: true, alias: "stateStorage", required: false }] }], stateKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "stateKey", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], gutterSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "gutterSize", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], minSizes: [{ type: i0.Input, args: [{ isSignal: true, alias: "minSizes", required: false }] }], panelSizes: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelSizes", required: false }] }], onResizeEnd: [{ type: i0.Output, args: ["onResizeEnd"] }], onResizeStart: [{ type: i0.Output, args: ["onResizeStart"] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PrimeTemplate), { isSignal: true }] }], panelChildren: [{ type: i0.ContentChildren, args: ['panel', { isSignal: true }] }], splitter: [{ type: i0.ContentChild, args: [forwardRef(() => Splitter), { isSignal: true }] }] } });
|
|
581
565
|
class SplitterModule {
|
|
582
566
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: SplitterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
583
567
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: SplitterModule, imports: [Splitter, SharedModule, BindModule], exports: [Splitter, SharedModule, BindModule] });
|