@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,23 +2,22 @@ export * from '@exhaustive-ui/core/types/organizationchart';
|
|
|
2
2
|
import * as i1 from '@angular/common';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { Injectable,
|
|
5
|
+
import { Injectable, input, booleanAttribute, inject, computed, ChangeDetectionStrategy, ViewEncapsulation, Component, model, output, contentChildren, contentChild, afterEveryRender, NgModule } from '@angular/core';
|
|
6
6
|
import { isAttributeEquals } from '@exhaustive-ui/utils';
|
|
7
7
|
import { SharedModule, PrimeTemplate } from '@exhaustive-ui/core/api';
|
|
8
8
|
import { BaseComponent, PARENT_INSTANCE } from '@exhaustive-ui/core/basecomponent';
|
|
9
9
|
import * as i2 from '@exhaustive-ui/core/bind';
|
|
10
10
|
import { BindModule, Bind } from '@exhaustive-ui/core/bind';
|
|
11
11
|
import { ChevronDownIcon, ChevronUpIcon } from '@exhaustive-ui/core/icons';
|
|
12
|
-
import { Subject } from 'rxjs';
|
|
13
12
|
import { style } from '@exhaustive-ui/styles/organizationchart';
|
|
14
13
|
import { BaseStyle } from '@exhaustive-ui/core/base';
|
|
15
14
|
|
|
16
15
|
const classes = {
|
|
17
|
-
root: ({ instance }) => ['p-organizationchart p-component', { 'p-organizationchart-preservespace': instance.preserveSpace }],
|
|
16
|
+
root: ({ instance }) => ['p-organizationchart p-component', { 'p-organizationchart-preservespace': instance.preserveSpace() }],
|
|
18
17
|
table: 'p-organizationchart-table',
|
|
19
18
|
node: ({ instance }) => [
|
|
20
19
|
'p-organizationchart-node',
|
|
21
|
-
{ 'p-organizationchart-node': true, 'p-organizationchart-node-selectable': instance.chart.selectionMode && instance.node.selectable !== false, 'p-organizationchart-node-selected': instance.isSelected() }
|
|
20
|
+
{ 'p-organizationchart-node': true, 'p-organizationchart-node-selectable': instance.chart.selectionMode() && instance.node().selectable !== false, 'p-organizationchart-node-selected': instance.isSelected() }
|
|
22
21
|
],
|
|
23
22
|
nodeToggleButton: 'p-organizationchart-node-toggle-button',
|
|
24
23
|
nodeToggleButtonIcon: 'p-organizationchart-node-toggle-button-icon',
|
|
@@ -91,47 +90,38 @@ var OrganizationChartClasses;
|
|
|
91
90
|
OrganizationChartClasses["nodeChildren"] = "p-organizationchart-node-children";
|
|
92
91
|
})(OrganizationChartClasses || (OrganizationChartClasses = {}));
|
|
93
92
|
|
|
94
|
-
const ORGANIZATIONCHART_INSTANCE = new InjectionToken('ORGANIZATIONCHART_INSTANCE');
|
|
95
93
|
class OrganizationChartNode extends BaseComponent {
|
|
96
|
-
|
|
97
|
-
node;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
last;
|
|
101
|
-
collapsible;
|
|
102
|
-
chart;
|
|
103
|
-
subscription;
|
|
94
|
+
node = input(/* @ts-ignore */
|
|
95
|
+
...(ngDevMode ? [undefined, { debugName: "node" }] : /* istanbul ignore next */ []));
|
|
96
|
+
collapsible = input(undefined, { ...(ngDevMode ? { debugName: "collapsible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
97
|
+
chart = inject(OrganizationChart);
|
|
104
98
|
_componentStyle = inject(OrganizationChartStyle);
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
this.subscription = this.chart.selectionSource$.subscribe(() => {
|
|
110
|
-
this.cd.markForCheck();
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
get leaf() {
|
|
114
|
-
if (this.node) {
|
|
115
|
-
return this.node.leaf == false ? false : !(this.node.children && this.node.children.length);
|
|
99
|
+
leaf = computed(() => {
|
|
100
|
+
const node = this.node();
|
|
101
|
+
if (node) {
|
|
102
|
+
return node.leaf == false ? false : !(node.children && node.children.length);
|
|
116
103
|
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
104
|
+
}, /* @ts-ignore */
|
|
105
|
+
...(ngDevMode ? [{ debugName: "leaf" }] : /* istanbul ignore next */ []));
|
|
106
|
+
colspan = computed(() => {
|
|
107
|
+
const node = this.node();
|
|
108
|
+
if (node) {
|
|
109
|
+
return node.children && node.children.length ? node.children.length * 2 : null;
|
|
121
110
|
}
|
|
122
|
-
}
|
|
111
|
+
}, /* @ts-ignore */
|
|
112
|
+
...(ngDevMode ? [{ debugName: "colspan" }] : /* istanbul ignore next */ []));
|
|
123
113
|
getChildStyle(node) {
|
|
124
114
|
return {
|
|
125
|
-
visibility: !this.leaf && node.expanded ? 'inherit' : 'hidden'
|
|
115
|
+
visibility: !this.leaf() && node.expanded ? 'inherit' : 'hidden'
|
|
126
116
|
};
|
|
127
117
|
}
|
|
128
118
|
getPTOptions(key) {
|
|
129
119
|
return this.ptm(key, {
|
|
130
120
|
context: {
|
|
131
|
-
expanded: this.node?.expanded,
|
|
132
|
-
selectable: this.node?.selectable !== false && this.chart.selectionMode,
|
|
121
|
+
expanded: this.node()?.expanded,
|
|
122
|
+
selectable: this.node()?.selectable !== false && this.chart.selectionMode(),
|
|
133
123
|
selected: this.isSelected(),
|
|
134
|
-
toggleable: this.collapsible && !this.leaf,
|
|
124
|
+
toggleable: this.collapsible() && !this.leaf(),
|
|
135
125
|
active: this.isSelected()
|
|
136
126
|
}
|
|
137
127
|
});
|
|
@@ -149,23 +139,20 @@ class OrganizationChartNode extends BaseComponent {
|
|
|
149
139
|
toggleNode(event, node) {
|
|
150
140
|
node.expanded = !node.expanded;
|
|
151
141
|
if (node.expanded)
|
|
152
|
-
this.chart.onNodeExpand.emit({ originalEvent: event, node: this.node });
|
|
142
|
+
this.chart.onNodeExpand.emit({ originalEvent: event, node: this.node() });
|
|
153
143
|
else
|
|
154
|
-
this.chart.onNodeCollapse.emit({ originalEvent: event, node: this.node });
|
|
144
|
+
this.chart.onNodeCollapse.emit({ originalEvent: event, node: this.node() });
|
|
155
145
|
event.preventDefault();
|
|
156
146
|
}
|
|
157
147
|
isSelected() {
|
|
158
|
-
return this.chart.isSelected(this.node);
|
|
159
|
-
}
|
|
160
|
-
onDestroy() {
|
|
161
|
-
this.subscription.unsubscribe();
|
|
148
|
+
return this.chart.isSelected(this.node());
|
|
162
149
|
}
|
|
163
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChartNode, deps:
|
|
164
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: OrganizationChartNode, isStandalone: true, selector: "[pOrganizationChartNode]", inputs: { node: "node",
|
|
165
|
-
@if (node) {
|
|
150
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChartNode, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
151
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: OrganizationChartNode, isStandalone: true, selector: "[pOrganizationChartNode]", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null } }, providers: [OrganizationChartStyle, { provide: PARENT_INSTANCE, useExisting: OrganizationChartNode }], usesInheritance: true, ngImport: i0, template: `
|
|
152
|
+
@if (node(); as node) {
|
|
166
153
|
<tbody [pBind]="ptm('body')">
|
|
167
154
|
<tr [pBind]="ptm('row')">
|
|
168
|
-
<td [attr.colspan]="colspan" [pBind]="ptm('cell')">
|
|
155
|
+
<td [attr.colspan]="colspan()" [pBind]="ptm('cell')">
|
|
169
156
|
<div [class]="cn(cx('node'), node.styleClass)" (click)="onNodeClick($event, node)" [pBind]="getPTOptions('node')">
|
|
170
157
|
@if (!chart.getTemplateForNode(node)) {
|
|
171
158
|
<div>{{ node.label }}</div>
|
|
@@ -175,10 +162,10 @@ class OrganizationChartNode extends BaseComponent {
|
|
|
175
162
|
<ng-container *ngTemplateOutlet="chart.getTemplateForNode(node); context: { $implicit: node }"></ng-container>
|
|
176
163
|
</div>
|
|
177
164
|
}
|
|
178
|
-
@if (collapsible) {
|
|
179
|
-
@if (!leaf) {
|
|
165
|
+
@if (collapsible()) {
|
|
166
|
+
@if (!leaf()) {
|
|
180
167
|
<a tabindex="0" [class]="cx('nodeToggleButton')" (click)="toggleNode($event, node)" (keydown.enter)="toggleNode($event, node)" (keydown.space)="toggleNode($event, node)" [pBind]="getPTOptions('nodeToggleButton')">
|
|
181
|
-
@if (!chart.togglerIconTemplate() && !chart._togglerIconTemplate) {
|
|
168
|
+
@if (!chart.togglerIconTemplate() && !chart._togglerIconTemplate()) {
|
|
182
169
|
@if (node.expanded) {
|
|
183
170
|
<svg data-p-icon="chevron-down" [class]="cx('nodeToggleButtonIcon')" [pBind]="getPTOptions('nodeToggleButtonIcon')" />
|
|
184
171
|
}
|
|
@@ -186,9 +173,9 @@ class OrganizationChartNode extends BaseComponent {
|
|
|
186
173
|
<svg data-p-icon="chevron-up" [class]="cx('nodeToggleButtonIcon')" [pBind]="getPTOptions('nodeToggleButtonIcon')" />
|
|
187
174
|
}
|
|
188
175
|
}
|
|
189
|
-
@if (chart.togglerIconTemplate() || chart._togglerIconTemplate) {
|
|
176
|
+
@if (chart.togglerIconTemplate() || chart._togglerIconTemplate()) {
|
|
190
177
|
<span [class]="cx('nodeToggleButtonIcon')" [pBind]="getPTOptions('nodeToggleButtonIcon')">
|
|
191
|
-
<ng-template *ngTemplateOutlet="chart.togglerIconTemplate() || chart._togglerIconTemplate; context: { $implicit: node.expanded }"></ng-template>
|
|
178
|
+
<ng-template *ngTemplateOutlet="chart.togglerIconTemplate() || chart._togglerIconTemplate(); context: { $implicit: node.expanded }"></ng-template>
|
|
192
179
|
</span>
|
|
193
180
|
}
|
|
194
181
|
</a>
|
|
@@ -198,13 +185,13 @@ class OrganizationChartNode extends BaseComponent {
|
|
|
198
185
|
</td>
|
|
199
186
|
</tr>
|
|
200
187
|
<tr [ngStyle]="getChildStyle(node)" [class]="cx('connectors')" [pBind]="ptm('connectors')">
|
|
201
|
-
<td [pBind]="ptm('lineCell')" [attr.colspan]="colspan">
|
|
188
|
+
<td [pBind]="ptm('lineCell')" [attr.colspan]="colspan()">
|
|
202
189
|
<div [pBind]="ptm('connectorDown')" [class]="cx('connectorDown')"></div>
|
|
203
190
|
</td>
|
|
204
191
|
</tr>
|
|
205
192
|
<tr [ngStyle]="getChildStyle(node)" [class]="cx('connectors')" [pBind]="ptm('connectors')">
|
|
206
193
|
@if (node.children && node.children.length === 1) {
|
|
207
|
-
<td [pBind]="ptm('lineCell')" [attr.colspan]="colspan">
|
|
194
|
+
<td [pBind]="ptm('lineCell')" [attr.colspan]="colspan()">
|
|
208
195
|
<div [pBind]="ptm('connectorDown')" [class]="cx('connectorDown')"></div>
|
|
209
196
|
</td>
|
|
210
197
|
}
|
|
@@ -218,25 +205,24 @@ class OrganizationChartNode extends BaseComponent {
|
|
|
218
205
|
<tr [ngStyle]="getChildStyle(node)" [class]="cx('nodeChildren')" [pBind]="ptm('nodeChildren')">
|
|
219
206
|
@for (child of node.children; track child) {
|
|
220
207
|
<td colspan="2" [pBind]="ptm('nodeCell')">
|
|
221
|
-
<table [class]="cx('table')" pOrganizationChartNode [unstyled]="unstyled()" [pt]="pt" [node]="child" [collapsible]="node.children && node.children.length > 0 && collapsible"></table>
|
|
208
|
+
<table [class]="cx('table')" pOrganizationChartNode [unstyled]="unstyled()" [pt]="pt()" [node]="child" [collapsible]="node.children && node.children.length > 0 && collapsible()"></table>
|
|
222
209
|
</td>
|
|
223
210
|
}
|
|
224
211
|
</tr>
|
|
225
212
|
</tbody>
|
|
226
213
|
}
|
|
227
|
-
`, isInline: true, dependencies: [{ kind: "component", type: OrganizationChartNode, selector: "[pOrganizationChartNode]", inputs: ["node", "
|
|
214
|
+
`, isInline: true, dependencies: [{ kind: "component", type: OrganizationChartNode, selector: "[pOrganizationChartNode]", inputs: ["node", "collapsible"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: ChevronDownIcon, selector: "[data-p-icon=\"chevron-down\"]" }, { kind: "component", type: ChevronUpIcon, selector: "[data-p-icon=\"chevron-up\"]" }, { kind: "ngmodule", type: SharedModule }, { kind: "ngmodule", type: BindModule }, { kind: "directive", type: i2.Bind, selector: "[pBind]", inputs: ["pBind"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
228
215
|
}
|
|
229
216
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChartNode, decorators: [{
|
|
230
217
|
type: Component,
|
|
231
218
|
args: [{
|
|
232
219
|
selector: '[pOrganizationChartNode]',
|
|
233
|
-
standalone: true,
|
|
234
220
|
imports: [CommonModule, ChevronDownIcon, ChevronUpIcon, SharedModule, BindModule],
|
|
235
221
|
template: `
|
|
236
|
-
@if (node) {
|
|
222
|
+
@if (node(); as node) {
|
|
237
223
|
<tbody [pBind]="ptm('body')">
|
|
238
224
|
<tr [pBind]="ptm('row')">
|
|
239
|
-
<td [attr.colspan]="colspan" [pBind]="ptm('cell')">
|
|
225
|
+
<td [attr.colspan]="colspan()" [pBind]="ptm('cell')">
|
|
240
226
|
<div [class]="cn(cx('node'), node.styleClass)" (click)="onNodeClick($event, node)" [pBind]="getPTOptions('node')">
|
|
241
227
|
@if (!chart.getTemplateForNode(node)) {
|
|
242
228
|
<div>{{ node.label }}</div>
|
|
@@ -246,10 +232,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
246
232
|
<ng-container *ngTemplateOutlet="chart.getTemplateForNode(node); context: { $implicit: node }"></ng-container>
|
|
247
233
|
</div>
|
|
248
234
|
}
|
|
249
|
-
@if (collapsible) {
|
|
250
|
-
@if (!leaf) {
|
|
235
|
+
@if (collapsible()) {
|
|
236
|
+
@if (!leaf()) {
|
|
251
237
|
<a tabindex="0" [class]="cx('nodeToggleButton')" (click)="toggleNode($event, node)" (keydown.enter)="toggleNode($event, node)" (keydown.space)="toggleNode($event, node)" [pBind]="getPTOptions('nodeToggleButton')">
|
|
252
|
-
@if (!chart.togglerIconTemplate() && !chart._togglerIconTemplate) {
|
|
238
|
+
@if (!chart.togglerIconTemplate() && !chart._togglerIconTemplate()) {
|
|
253
239
|
@if (node.expanded) {
|
|
254
240
|
<svg data-p-icon="chevron-down" [class]="cx('nodeToggleButtonIcon')" [pBind]="getPTOptions('nodeToggleButtonIcon')" />
|
|
255
241
|
}
|
|
@@ -257,9 +243,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
257
243
|
<svg data-p-icon="chevron-up" [class]="cx('nodeToggleButtonIcon')" [pBind]="getPTOptions('nodeToggleButtonIcon')" />
|
|
258
244
|
}
|
|
259
245
|
}
|
|
260
|
-
@if (chart.togglerIconTemplate() || chart._togglerIconTemplate) {
|
|
246
|
+
@if (chart.togglerIconTemplate() || chart._togglerIconTemplate()) {
|
|
261
247
|
<span [class]="cx('nodeToggleButtonIcon')" [pBind]="getPTOptions('nodeToggleButtonIcon')">
|
|
262
|
-
<ng-template *ngTemplateOutlet="chart.togglerIconTemplate() || chart._togglerIconTemplate; context: { $implicit: node.expanded }"></ng-template>
|
|
248
|
+
<ng-template *ngTemplateOutlet="chart.togglerIconTemplate() || chart._togglerIconTemplate(); context: { $implicit: node.expanded }"></ng-template>
|
|
263
249
|
</span>
|
|
264
250
|
}
|
|
265
251
|
</a>
|
|
@@ -269,13 +255,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
269
255
|
</td>
|
|
270
256
|
</tr>
|
|
271
257
|
<tr [ngStyle]="getChildStyle(node)" [class]="cx('connectors')" [pBind]="ptm('connectors')">
|
|
272
|
-
<td [pBind]="ptm('lineCell')" [attr.colspan]="colspan">
|
|
258
|
+
<td [pBind]="ptm('lineCell')" [attr.colspan]="colspan()">
|
|
273
259
|
<div [pBind]="ptm('connectorDown')" [class]="cx('connectorDown')"></div>
|
|
274
260
|
</td>
|
|
275
261
|
</tr>
|
|
276
262
|
<tr [ngStyle]="getChildStyle(node)" [class]="cx('connectors')" [pBind]="ptm('connectors')">
|
|
277
263
|
@if (node.children && node.children.length === 1) {
|
|
278
|
-
<td [pBind]="ptm('lineCell')" [attr.colspan]="colspan">
|
|
264
|
+
<td [pBind]="ptm('lineCell')" [attr.colspan]="colspan()">
|
|
279
265
|
<div [pBind]="ptm('connectorDown')" [class]="cx('connectorDown')"></div>
|
|
280
266
|
</td>
|
|
281
267
|
}
|
|
@@ -289,7 +275,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
289
275
|
<tr [ngStyle]="getChildStyle(node)" [class]="cx('nodeChildren')" [pBind]="ptm('nodeChildren')">
|
|
290
276
|
@for (child of node.children; track child) {
|
|
291
277
|
<td colspan="2" [pBind]="ptm('nodeCell')">
|
|
292
|
-
<table [class]="cx('table')" pOrganizationChartNode [unstyled]="unstyled()" [pt]="pt" [node]="child" [collapsible]="node.children && node.children.length > 0 && collapsible"></table>
|
|
278
|
+
<table [class]="cx('table')" pOrganizationChartNode [unstyled]="unstyled()" [pt]="pt()" [node]="child" [collapsible]="node.children && node.children.length > 0 && collapsible()"></table>
|
|
293
279
|
</td>
|
|
294
280
|
}
|
|
295
281
|
</tr>
|
|
@@ -297,77 +283,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
297
283
|
}
|
|
298
284
|
`,
|
|
299
285
|
encapsulation: ViewEncapsulation.None,
|
|
300
|
-
changeDetection: ChangeDetectionStrategy.
|
|
286
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
301
287
|
providers: [OrganizationChartStyle, { provide: PARENT_INSTANCE, useExisting: OrganizationChartNode }]
|
|
302
288
|
}]
|
|
303
|
-
}],
|
|
304
|
-
type: Input
|
|
305
|
-
}], root: [{
|
|
306
|
-
type: Input,
|
|
307
|
-
args: [{ transform: booleanAttribute }]
|
|
308
|
-
}], first: [{
|
|
309
|
-
type: Input,
|
|
310
|
-
args: [{ transform: booleanAttribute }]
|
|
311
|
-
}], last: [{
|
|
312
|
-
type: Input,
|
|
313
|
-
args: [{ transform: booleanAttribute }]
|
|
314
|
-
}], collapsible: [{
|
|
315
|
-
type: Input,
|
|
316
|
-
args: [{ transform: booleanAttribute }]
|
|
317
|
-
}] } });
|
|
289
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }] } });
|
|
318
290
|
/**
|
|
319
291
|
* OrganizationChart visualizes hierarchical organization data.
|
|
320
292
|
* @group Components
|
|
321
293
|
*/
|
|
322
294
|
class OrganizationChart extends BaseComponent {
|
|
323
|
-
el = inject(ElementRef);
|
|
324
|
-
cd = inject(ChangeDetectorRef);
|
|
325
295
|
componentName = 'OrganizationChart';
|
|
326
296
|
/**
|
|
327
297
|
* An array of nested TreeNodes.
|
|
328
298
|
* @group Props
|
|
329
299
|
*/
|
|
330
|
-
value
|
|
331
|
-
|
|
332
|
-
* Style class of the component.
|
|
333
|
-
* @deprecated since v20.0.0, use `class` instead.
|
|
334
|
-
* @group Props
|
|
335
|
-
*/
|
|
336
|
-
styleClass;
|
|
300
|
+
value = input(/* @ts-ignore */
|
|
301
|
+
...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
|
|
337
302
|
/**
|
|
338
303
|
* Defines the selection mode.
|
|
339
304
|
* @group Props
|
|
340
305
|
*/
|
|
341
|
-
selectionMode
|
|
306
|
+
selectionMode = input(/* @ts-ignore */
|
|
307
|
+
...(ngDevMode ? [undefined, { debugName: "selectionMode" }] : /* istanbul ignore next */ []));
|
|
342
308
|
/**
|
|
343
309
|
* Whether the nodes can be expanded or toggled.
|
|
344
310
|
* @group Props
|
|
345
311
|
*/
|
|
346
|
-
collapsible;
|
|
312
|
+
collapsible = input(undefined, { ...(ngDevMode ? { debugName: "collapsible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
347
313
|
/**
|
|
348
314
|
* Whether the space allocated by a node is preserved when hidden.
|
|
349
315
|
* @deprecated since v20.0.0.
|
|
350
316
|
* @group Props
|
|
351
317
|
*/
|
|
352
|
-
preserveSpace = true;
|
|
318
|
+
preserveSpace = input(true, { ...(ngDevMode ? { debugName: "preserveSpace" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
353
319
|
/**
|
|
354
|
-
* A single treenode instance or an array to refer to the selections.
|
|
320
|
+
* A single treenode instance or an array to refer to the selections, supports one or two-way binding as well.
|
|
321
|
+
* Emits `selectionChange` with the selected value on selection change.
|
|
355
322
|
* @group Props
|
|
356
323
|
*/
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
set selection(val) {
|
|
361
|
-
this._selection = val;
|
|
362
|
-
if (this.initialized)
|
|
363
|
-
this.selectionSource.next(null);
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
* Callback to invoke on selection change.
|
|
367
|
-
* @param {*} any - selected value.
|
|
368
|
-
* @group Emits
|
|
369
|
-
*/
|
|
370
|
-
selectionChange = output();
|
|
324
|
+
selection = model(/* @ts-ignore */
|
|
325
|
+
...(ngDevMode ? [undefined, { debugName: "selection" }] : /* istanbul ignore next */ []));
|
|
371
326
|
/**
|
|
372
327
|
* Callback to invoke when a node is selected.
|
|
373
328
|
* @param {OrganizationChartNodeSelectEvent} event - custom node select event.
|
|
@@ -395,38 +350,38 @@ class OrganizationChart extends BaseComponent {
|
|
|
395
350
|
templates = contentChildren(PrimeTemplate, /* @ts-ignore */
|
|
396
351
|
...(ngDevMode ? [{ debugName: "templates" }] : /* istanbul ignore next */ []));
|
|
397
352
|
togglerIconTemplate = contentChild('togglericon', { ...(ngDevMode ? { debugName: "togglerIconTemplate" } : /* istanbul ignore next */ {}), descendants: false });
|
|
398
|
-
templateMap
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
$pcOrganizationChart = inject(ORGANIZATIONCHART_INSTANCE, { optional: true, skipSelf: true }) ?? undefined;
|
|
407
|
-
ngAfterViewChecked() {
|
|
408
|
-
this.bindDirectiveInstance.setAttrs(this.ptms(['host', 'root']));
|
|
409
|
-
}
|
|
410
|
-
get root() {
|
|
411
|
-
return this.value && this.value.length ? this.value[0] : null;
|
|
412
|
-
}
|
|
413
|
-
onAfterContentInit() {
|
|
414
|
-
if (this.templates().length) {
|
|
415
|
-
this.templateMap = {};
|
|
416
|
-
}
|
|
417
|
-
this.templates().forEach((item) => {
|
|
418
|
-
if (item.getType() === 'togglericon') {
|
|
419
|
-
this._togglerIconTemplate = item.template;
|
|
420
|
-
}
|
|
421
|
-
else {
|
|
422
|
-
this.templateMap[item.getType()] = item.template;
|
|
353
|
+
templateMap = computed(() => {
|
|
354
|
+
const templates = this.templates();
|
|
355
|
+
if (!templates.length)
|
|
356
|
+
return undefined;
|
|
357
|
+
const templateMap = {};
|
|
358
|
+
templates.forEach((item) => {
|
|
359
|
+
if (item.getType() !== 'togglericon') {
|
|
360
|
+
templateMap[item.getType()] = item.template;
|
|
423
361
|
}
|
|
424
362
|
});
|
|
425
|
-
|
|
363
|
+
return templateMap;
|
|
364
|
+
}, /* @ts-ignore */
|
|
365
|
+
...(ngDevMode ? [{ debugName: "templateMap" }] : /* istanbul ignore next */ []));
|
|
366
|
+
_togglerIconTemplate = computed(() => this.templates()
|
|
367
|
+
.filter((item) => item.getType() === 'togglericon')
|
|
368
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
369
|
+
...(ngDevMode ? [{ debugName: "_togglerIconTemplate" }] : /* istanbul ignore next */ []));
|
|
370
|
+
_componentStyle = inject(OrganizationChartStyle);
|
|
371
|
+
bindDirectiveInstance = inject(Bind, { self: true });
|
|
372
|
+
constructor() {
|
|
373
|
+
super();
|
|
374
|
+
afterEveryRender(() => this.bindDirectiveInstance.setAttrs(this.ptms(['host', 'root'])));
|
|
426
375
|
}
|
|
376
|
+
root = computed(() => {
|
|
377
|
+
const value = this.value();
|
|
378
|
+
return value && value.length ? value[0] : null;
|
|
379
|
+
}, /* @ts-ignore */
|
|
380
|
+
...(ngDevMode ? [{ debugName: "root" }] : /* istanbul ignore next */ []));
|
|
427
381
|
getTemplateForNode(node) {
|
|
428
|
-
|
|
429
|
-
|
|
382
|
+
const templateMap = this.templateMap();
|
|
383
|
+
if (templateMap)
|
|
384
|
+
return node.type ? templateMap[node.type] : templateMap['default'];
|
|
430
385
|
else
|
|
431
386
|
return null;
|
|
432
387
|
}
|
|
@@ -435,45 +390,44 @@ class OrganizationChart extends BaseComponent {
|
|
|
435
390
|
if (isAttributeEquals(eventTarget, 'data-pc-section', 'nodetogglebutton') || isAttributeEquals(eventTarget, 'data-pc-section', 'nodetogglebuttonicon')) {
|
|
436
391
|
return;
|
|
437
392
|
}
|
|
438
|
-
else if (this.selectionMode) {
|
|
393
|
+
else if (this.selectionMode()) {
|
|
439
394
|
if (node.selectable === false) {
|
|
440
395
|
return;
|
|
441
396
|
}
|
|
442
397
|
let index = this.findIndexInSelection(node);
|
|
443
398
|
let selected = index >= 0;
|
|
444
|
-
if (this.selectionMode === 'single') {
|
|
399
|
+
if (this.selectionMode() === 'single') {
|
|
445
400
|
if (selected) {
|
|
446
|
-
this.selection
|
|
401
|
+
this.selection.set(null);
|
|
447
402
|
this.onNodeUnselect.emit({ originalEvent: event, node: node });
|
|
448
403
|
}
|
|
449
404
|
else {
|
|
450
|
-
this.selection
|
|
405
|
+
this.selection.set(node);
|
|
451
406
|
this.onNodeSelect.emit({ originalEvent: event, node: node });
|
|
452
407
|
}
|
|
453
408
|
}
|
|
454
|
-
else if (this.selectionMode === 'multiple') {
|
|
409
|
+
else if (this.selectionMode() === 'multiple') {
|
|
455
410
|
if (selected) {
|
|
456
|
-
this.selection
|
|
411
|
+
this.selection.set(this.selection().filter((val, i) => i != index));
|
|
457
412
|
this.onNodeUnselect.emit({ originalEvent: event, node: node });
|
|
458
413
|
}
|
|
459
414
|
else {
|
|
460
|
-
this.selection
|
|
415
|
+
this.selection.set([...(this.selection() || []), node]);
|
|
461
416
|
this.onNodeSelect.emit({ originalEvent: event, node: node });
|
|
462
417
|
}
|
|
463
418
|
}
|
|
464
|
-
this.selectionChange.emit(this.selection);
|
|
465
|
-
this.selectionSource.next(null);
|
|
466
419
|
}
|
|
467
420
|
}
|
|
468
421
|
findIndexInSelection(node) {
|
|
469
422
|
let index = -1;
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
423
|
+
const selection = this.selection();
|
|
424
|
+
if (this.selectionMode() && selection) {
|
|
425
|
+
if (this.selectionMode() === 'single') {
|
|
426
|
+
index = selection == node ? 0 : -1;
|
|
473
427
|
}
|
|
474
|
-
else if (this.selectionMode === 'multiple') {
|
|
475
|
-
for (let i = 0; i <
|
|
476
|
-
if (
|
|
428
|
+
else if (this.selectionMode() === 'multiple') {
|
|
429
|
+
for (let i = 0; i < selection.length; i++) {
|
|
430
|
+
if (selection[i] == node) {
|
|
477
431
|
index = i;
|
|
478
432
|
break;
|
|
479
433
|
}
|
|
@@ -485,46 +439,31 @@ class OrganizationChart extends BaseComponent {
|
|
|
485
439
|
isSelected(node) {
|
|
486
440
|
return this.findIndexInSelection(node) != -1;
|
|
487
441
|
}
|
|
488
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChart, deps:
|
|
489
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: OrganizationChart, isStandalone: true, selector: "p-organizationChart, p-organization-chart, p-organizationchart", inputs: { value: "value",
|
|
490
|
-
@if (root) {
|
|
491
|
-
<table [class]="cx('table')" [collapsible]="collapsible" pOrganizationChartNode [pt]="pt" [unstyled]="unstyled()" [node]="root" [pBind]="ptm('table')"></table>
|
|
442
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
443
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: OrganizationChart, isStandalone: true, selector: "p-organizationChart, p-organization-chart, p-organizationchart", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, preserveSpace: { classPropertyName: "preserveSpace", publicName: "preserveSpace", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", onNodeSelect: "onNodeSelect", onNodeUnselect: "onNodeUnselect", onNodeExpand: "onNodeExpand", onNodeCollapse: "onNodeCollapse" }, host: { properties: { "class": "cx('root')" } }, providers: [OrganizationChartStyle, { provide: PARENT_INSTANCE, useExisting: OrganizationChart }], queries: [{ propertyName: "templates", predicate: PrimeTemplate, isSignal: true }, { propertyName: "togglerIconTemplate", first: true, predicate: ["togglericon"], isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i2.Bind }], ngImport: i0, template: `
|
|
444
|
+
@if (root(); as root) {
|
|
445
|
+
<table [class]="cx('table')" [collapsible]="collapsible()" pOrganizationChartNode [pt]="pt()" [unstyled]="unstyled()" [node]="root" [pBind]="ptm('table')"></table>
|
|
492
446
|
}
|
|
493
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OrganizationChartNode, selector: "[pOrganizationChartNode]", inputs: ["node", "
|
|
447
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OrganizationChartNode, selector: "[pOrganizationChartNode]", inputs: ["node", "collapsible"] }, { kind: "ngmodule", type: SharedModule }, { kind: "ngmodule", type: BindModule }, { kind: "directive", type: i2.Bind, selector: "[pBind]", inputs: ["pBind"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
494
448
|
}
|
|
495
449
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChart, decorators: [{
|
|
496
450
|
type: Component,
|
|
497
451
|
args: [{
|
|
498
452
|
selector: 'p-organizationChart, p-organization-chart, p-organizationchart',
|
|
499
|
-
standalone: true,
|
|
500
453
|
imports: [CommonModule, OrganizationChartNode, SharedModule, BindModule],
|
|
501
454
|
template: `
|
|
502
|
-
@if (root) {
|
|
503
|
-
<table [class]="cx('table')" [collapsible]="collapsible" pOrganizationChartNode [pt]="pt" [unstyled]="unstyled()" [node]="root" [pBind]="ptm('table')"></table>
|
|
455
|
+
@if (root(); as root) {
|
|
456
|
+
<table [class]="cx('table')" [collapsible]="collapsible()" pOrganizationChartNode [pt]="pt()" [unstyled]="unstyled()" [node]="root" [pBind]="ptm('table')"></table>
|
|
504
457
|
}
|
|
505
458
|
`,
|
|
506
|
-
changeDetection: ChangeDetectionStrategy.
|
|
507
|
-
providers: [OrganizationChartStyle, { provide:
|
|
459
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
460
|
+
providers: [OrganizationChartStyle, { provide: PARENT_INSTANCE, useExisting: OrganizationChart }],
|
|
508
461
|
host: {
|
|
509
|
-
'[class]': "
|
|
462
|
+
'[class]': "cx('root')"
|
|
510
463
|
},
|
|
511
464
|
hostDirectives: [Bind]
|
|
512
465
|
}]
|
|
513
|
-
}], propDecorators: { value: [{
|
|
514
|
-
type: Input
|
|
515
|
-
}], styleClass: [{
|
|
516
|
-
type: Input
|
|
517
|
-
}], selectionMode: [{
|
|
518
|
-
type: Input
|
|
519
|
-
}], collapsible: [{
|
|
520
|
-
type: Input,
|
|
521
|
-
args: [{ transform: booleanAttribute }]
|
|
522
|
-
}], preserveSpace: [{
|
|
523
|
-
type: Input,
|
|
524
|
-
args: [{ transform: booleanAttribute }]
|
|
525
|
-
}], selection: [{
|
|
526
|
-
type: Input
|
|
527
|
-
}], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], onNodeSelect: [{ type: i0.Output, args: ["onNodeSelect"] }], onNodeUnselect: [{ type: i0.Output, args: ["onNodeUnselect"] }], onNodeExpand: [{ type: i0.Output, args: ["onNodeExpand"] }], onNodeCollapse: [{ type: i0.Output, args: ["onNodeCollapse"] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PrimeTemplate), { isSignal: true }] }], togglerIconTemplate: [{ type: i0.ContentChild, args: ['togglericon', { ...{ descendants: false }, isSignal: true }] }] } });
|
|
466
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }], preserveSpace: [{ type: i0.Input, args: [{ isSignal: true, alias: "preserveSpace", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], onNodeSelect: [{ type: i0.Output, args: ["onNodeSelect"] }], onNodeUnselect: [{ type: i0.Output, args: ["onNodeUnselect"] }], onNodeExpand: [{ type: i0.Output, args: ["onNodeExpand"] }], onNodeCollapse: [{ type: i0.Output, args: ["onNodeCollapse"] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PrimeTemplate), { isSignal: true }] }], togglerIconTemplate: [{ type: i0.ContentChild, args: ['togglericon', { ...{ descendants: false }, isSignal: true }] }] } });
|
|
528
467
|
class OrganizationChartModule {
|
|
529
468
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChartModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
530
469
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChartModule, imports: [OrganizationChart, OrganizationChartNode, SharedModule], exports: [OrganizationChart, OrganizationChartNode, SharedModule] });
|