@eui/components 18.0.1-snapshot-1718060280735 → 18.0.1-snapshot-1718117003984
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/docs/classes/CustomNodeSelectFnHelper.html +556 -0
- package/docs/components/EuiDatepickerComponent.html +1 -1
- package/docs/components/EuiMenuComponent.html +1 -1
- package/docs/components/EuiNotificationsComponent.html +1 -1
- package/docs/components/EuiTreeComponent.html +19 -0
- package/docs/dependencies.html +1 -1
- package/docs/directives/EuiTreeFormControlDirective.html +1 -1
- package/docs/index.html +1 -1
- package/docs/js/menu-wc.js +9 -6
- package/docs/js/menu-wc_es5.js +1 -1
- package/docs/js/search/search_index.js +2 -2
- package/docs/miscellaneous/typealiases.html +67 -48
- package/esm2022/eui-button/eui-button.component.mjs +2 -2
- package/esm2022/eui-dashboard-card/eui-dashboard-card.component.mjs +2 -2
- package/esm2022/eui-datepicker/eui-datepicker.component.mjs +3 -3
- package/esm2022/eui-discussion-thread/eui-discussion-thread.component.mjs +2 -2
- package/esm2022/eui-input-group/eui-input-group.component.mjs +2 -2
- package/esm2022/eui-menu/eui-menu-item.component.mjs +2 -2
- package/esm2022/eui-menu/eui-menu.component.mjs +3 -3
- package/esm2022/eui-timeline/eui-timeline-item.component.mjs +2 -2
- package/esm2022/eui-timeline/eui-timeline.component.mjs +2 -2
- package/esm2022/eui-tree/eui-tree-form-control.directive.mjs +2 -2
- package/esm2022/eui-tree/eui-tree.component.mjs +46 -24
- package/esm2022/eui-tree/eui-tree.model.mjs +20 -1
- package/esm2022/eui-wizard/eui-wizard-step.component.mjs +2 -2
- package/esm2022/eui-wizard/eui-wizard.component.mjs +2 -2
- package/esm2022/layout/eui-notifications/eui-notifications.component.mjs +3 -3
- package/eui-tree/eui-tree.component.d.ts +5 -2
- package/eui-tree/eui-tree.component.d.ts.map +1 -1
- package/eui-tree/eui-tree.model.d.ts +9 -0
- package/eui-tree/eui-tree.model.d.ts.map +1 -1
- package/fesm2022/eui-components-eui-button.mjs +2 -2
- package/fesm2022/eui-components-eui-button.mjs.map +1 -1
- package/fesm2022/eui-components-eui-dashboard-card.mjs +2 -2
- package/fesm2022/eui-components-eui-dashboard-card.mjs.map +1 -1
- package/fesm2022/eui-components-eui-datepicker.mjs +2 -2
- package/fesm2022/eui-components-eui-datepicker.mjs.map +1 -1
- package/fesm2022/eui-components-eui-discussion-thread.mjs +2 -2
- package/fesm2022/eui-components-eui-discussion-thread.mjs.map +1 -1
- package/fesm2022/eui-components-eui-input-group.mjs +2 -2
- package/fesm2022/eui-components-eui-input-group.mjs.map +1 -1
- package/fesm2022/eui-components-eui-menu.mjs +4 -4
- package/fesm2022/eui-components-eui-menu.mjs.map +1 -1
- package/fesm2022/eui-components-eui-timeline.mjs +4 -4
- package/fesm2022/eui-components-eui-timeline.mjs.map +1 -1
- package/fesm2022/eui-components-eui-tree.mjs +65 -24
- package/fesm2022/eui-components-eui-tree.mjs.map +1 -1
- package/fesm2022/eui-components-eui-wizard.mjs +4 -4
- package/fesm2022/eui-components-eui-wizard.mjs.map +1 -1
- package/fesm2022/eui-components-layout.mjs +2 -2
- package/fesm2022/eui-components-layout.mjs.map +1 -1
- package/package.json +3 -3
@@ -102,6 +102,25 @@ class EuiTreePagination {
|
|
102
102
|
};
|
103
103
|
}
|
104
104
|
}
|
105
|
+
class CustomNodeSelectFnHelper {
|
106
|
+
// TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
|
107
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
108
|
+
constructor(compInstance) {
|
109
|
+
this.compInstance = compInstance;
|
110
|
+
}
|
111
|
+
select(path, isChecked) {
|
112
|
+
this.compInstance.silentSelect(path, isChecked);
|
113
|
+
}
|
114
|
+
getParents(path) {
|
115
|
+
return this.compInstance.getParentPaths(path);
|
116
|
+
}
|
117
|
+
getTreeItem(path) {
|
118
|
+
return this.compInstance.getTreeItem(path);
|
119
|
+
}
|
120
|
+
getSelectionRecursiveState(path) {
|
121
|
+
return this.compInstance.getRunTimeSelectionRecursiveState(path);
|
122
|
+
}
|
123
|
+
}
|
105
124
|
|
106
125
|
class EuiTreeComponent {
|
107
126
|
get cssClasses() {
|
@@ -223,12 +242,15 @@ class EuiTreeComponent {
|
|
223
242
|
}
|
224
243
|
}
|
225
244
|
setAllSelection(isChecked) {
|
245
|
+
this.tempSelectionModel = new SelectionModel(true, this.selectionModel.selected, true, (a, b) => a?.path === b?.path);
|
226
246
|
this.setIsCheckedForAll(this.treeDataRunTime, isChecked);
|
247
|
+
this.selectionModel.setSelection(...this.tempSelectionModel.selected);
|
227
248
|
this.changeDetectorRef.markForCheck();
|
228
249
|
}
|
229
250
|
updateTreeItem(givenTreeItem, path) {
|
230
251
|
const treeItem = structuredClone(givenTreeItem);
|
231
252
|
if (treeItem && path) {
|
253
|
+
this.tempSelectionModel = new SelectionModel(true, this.selectionModel.selected, true, (a, b) => a?.path === b?.path);
|
232
254
|
this.setTreeData(path, this.processInputs([treeItem])[0]);
|
233
255
|
const pathArr = path.split('.');
|
234
256
|
const index = parseInt(pathArr.pop(), 10);
|
@@ -242,10 +264,6 @@ class EuiTreeComponent {
|
|
242
264
|
const itemRecursiveSelectionState = this.calculateItemSelectionRecursiveState(treeItem);
|
243
265
|
this.setRunTimeSelectionRecursiveStateTree(path, itemRecursiveSelectionState);
|
244
266
|
this.syncStateChangesAtPath(path);
|
245
|
-
// Rendering
|
246
|
-
this.changeDetectorRef.detectChanges();
|
247
|
-
this.treeComponentInstance.renderNodeChanges([]);
|
248
|
-
this.treeComponentInstance.renderNodeChanges(this.treeDataRunTime);
|
249
267
|
if (this.cdkTreeControl.isExpanded(treeItemRuntime) && !treeItem.node.isExpanded) {
|
250
268
|
this.cdkTreeControl.toggle(treeItemRuntime);
|
251
269
|
}
|
@@ -256,7 +274,11 @@ class EuiTreeComponent {
|
|
256
274
|
this.getInitialSelection(this.getRunTimeTreeItem(path)?.children)?.forEach((runTimeItem) => {
|
257
275
|
this.selectTreeItem(this.getRunTimeBackupTreeItem(runTimeItem.path));
|
258
276
|
});
|
277
|
+
this.selectionModel.setSelection(...this.tempSelectionModel.selected);
|
278
|
+
// Rendering
|
259
279
|
this.changeDetectorRef.detectChanges();
|
280
|
+
this.treeComponentInstance.renderNodeChanges([]);
|
281
|
+
this.treeComponentInstance.renderNodeChanges(this.treeDataRunTime);
|
260
282
|
}
|
261
283
|
}
|
262
284
|
onNodeClick(treeRunTimeItem) {
|
@@ -276,9 +298,14 @@ class EuiTreeComponent {
|
|
276
298
|
const item = this.getTreeItem(path);
|
277
299
|
const runTimeBackupTreeItem = this.getRunTimeBackupTreeItem(path);
|
278
300
|
const renderedRunTimeTreeItem = this.getRunTimeTreeItem(path);
|
279
|
-
const node = item
|
301
|
+
const node = item?.node;
|
302
|
+
this.tempSelectionModel = new SelectionModel(true, this.selectionModel.selected, true, (a, b) => a?.path === b?.path);
|
280
303
|
// console.log(path,item,runTimeTreeItem, renderedRunTimeTreeItem);
|
281
|
-
if (
|
304
|
+
if (this.customNodeSelectFn) {
|
305
|
+
this.customNodeSelectFn(path, evt.target.checked, item, new CustomNodeSelectFnHelper(this));
|
306
|
+
this.selectionModel.setSelection(...this.tempSelectionModel.selected);
|
307
|
+
}
|
308
|
+
else if (!node?.selectConfig?.singleSelect) {
|
282
309
|
node.isSelected = evt.target.checked;
|
283
310
|
node.isIndeterminate = false;
|
284
311
|
// If the node is recursive it sets every children with the change.
|
@@ -317,6 +344,7 @@ class EuiTreeComponent {
|
|
317
344
|
else {
|
318
345
|
this.changeDetectorRef.detectChanges();
|
319
346
|
}
|
347
|
+
this.selectionModel.setSelection(...this.tempSelectionModel.selected);
|
320
348
|
}
|
321
349
|
else {
|
322
350
|
const prevItem = this.selectionModel.selected[0];
|
@@ -480,6 +508,9 @@ class EuiTreeComponent {
|
|
480
508
|
});
|
481
509
|
}
|
482
510
|
runScrollListener() {
|
511
|
+
/* if (this.scrollDispatcherSubs) { todo
|
512
|
+
this.scrollDispatcherSubs.unsubscribe();
|
513
|
+
}*/
|
483
514
|
this.scrollDispatcherSubs = this.scrollDispatcher.scrolled().subscribe((scrollable) => {
|
484
515
|
if (scrollable && this.checkIfCurrentScrollable(scrollable)) {
|
485
516
|
const isAtBottom = scrollable?.getElementRef().nativeElement.scrollTop + scrollable?.getElementRef().nativeElement.clientHeight >=
|
@@ -532,19 +563,27 @@ class EuiTreeComponent {
|
|
532
563
|
getSelectionIndexOfItem(runTimeTreeItem) {
|
533
564
|
return this.selectionModel.selected.findIndex((i) => i?.path === runTimeTreeItem?.path);
|
534
565
|
}
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
566
|
+
// todo re-think about the access from custom on node select helper
|
567
|
+
silentSelect(path, isChecked) {
|
568
|
+
const runtimeBackupTreeItem = this.getRunTimeBackupTreeItem(path);
|
569
|
+
const treeItem = this.getTreeItem(path);
|
570
|
+
const node = treeItem.node;
|
571
|
+
if (node?.selectable) {
|
572
|
+
node.isSelected = isChecked;
|
573
|
+
node.isIndeterminate = false;
|
574
|
+
if (isChecked) {
|
575
|
+
this.tempSelectionModel.select(runtimeBackupTreeItem);
|
576
|
+
}
|
577
|
+
else {
|
578
|
+
this.tempSelectionModel.deselect(runtimeBackupTreeItem);
|
579
|
+
}
|
539
580
|
}
|
540
581
|
}
|
582
|
+
selectTreeItem(runTimeBackupTreeItem) {
|
583
|
+
this.tempSelectionModel.select(runTimeBackupTreeItem);
|
584
|
+
}
|
541
585
|
deselectTreeItem(runTimeTreeItem) {
|
542
|
-
|
543
|
-
if (indexOfItem > -1) {
|
544
|
-
const newSelection = [...this.selectionModel.selected];
|
545
|
-
newSelection.splice(indexOfItem, 1);
|
546
|
-
this.selectionModel.setSelection(...newSelection);
|
547
|
-
}
|
586
|
+
this.tempSelectionModel.deselect(runTimeTreeItem);
|
548
587
|
}
|
549
588
|
createTreeDataRuntime(nodes) {
|
550
589
|
return structuredClone(nodes)?.map((item, index) => {
|
@@ -580,7 +619,7 @@ class EuiTreeComponent {
|
|
580
619
|
});
|
581
620
|
}
|
582
621
|
const childStates = childrenSelectionRecursive.map((_) => _.selectionRecursiveState);
|
583
|
-
const itemState = this.decideSelectionRecursiveState(childStates, treeItem.node.isSelected, treeItem.node?.selectConfig?.recursive, treeItem.node?.selectConfig?.noAutoSelectParent);
|
622
|
+
const itemState = treeItem.node.selectable ? this.decideSelectionRecursiveState(childStates, treeItem.node.isSelected, treeItem.node?.selectConfig?.recursive, treeItem.node?.selectConfig?.noAutoSelectParent) : undefined;
|
584
623
|
return {
|
585
624
|
selectionRecursiveState: itemState,
|
586
625
|
children: childrenSelectionRecursive,
|
@@ -588,16 +627,16 @@ class EuiTreeComponent {
|
|
588
627
|
}
|
589
628
|
decideSelectionRecursiveState(childStates = [], isSelected, recursive, noAutoSelectParent) {
|
590
629
|
let itemState = 'indeterminate';
|
591
|
-
if (isSelected && childStates.every((state) => state === 'allSelected')) {
|
630
|
+
if (isSelected && childStates.filter((childStates) => childStates).every((state) => state === 'allSelected')) {
|
592
631
|
itemState = 'allSelected';
|
593
632
|
}
|
594
|
-
else if (!isSelected && childStates.every((state) => state === 'allNotSelected')) {
|
633
|
+
else if (!isSelected && childStates.filter((childStates) => childStates).every((state) => state === 'allNotSelected')) {
|
595
634
|
itemState = 'allNotSelected';
|
596
635
|
}
|
597
|
-
else if (recursive && childStates.every((state) => state === 'allSelected') && !isSelected && !noAutoSelectParent) {
|
636
|
+
else if (recursive && childStates.filter((childStates) => childStates).every((state) => state === 'allSelected') && !isSelected && !noAutoSelectParent) {
|
598
637
|
itemState = 'allSelected';
|
599
638
|
}
|
600
|
-
else if (recursive && childStates.every((state) => state === 'allNotSelected') && isSelected) {
|
639
|
+
else if (recursive && childStates.filter((childStates) => childStates).every((state) => state === 'allNotSelected') && isSelected) {
|
601
640
|
itemState = 'allNotSelected';
|
602
641
|
}
|
603
642
|
return itemState;
|
@@ -902,7 +941,7 @@ class EuiTreeComponent {
|
|
902
941
|
return scrolled.getElementRef().nativeElement === this.cdkScrollableRef.getElementRef().nativeElement;
|
903
942
|
}
|
904
943
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: EuiTreeComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.ScrollDispatcher }], target: i0.ɵɵFactoryTarget.Component }); }
|
905
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.2", type: EuiTreeComponent, selector: "eui-tree", inputs: { e2eAttr: "e2eAttr", nodes: "nodes", nodeTemplateRef: "nodeTemplateRef", nodeContentMetadataTemplateRef: "nodeContentMetadataTemplateRef", rightContextMenuTemplateRef: "rightContextMenuTemplateRef", expandedIconClass: "expandedIconClass", collapsedIconClass: "collapsedIconClass", expandedSvgIconClass: "expandedSvgIconClass", collapsedSvgIconClass: "collapsedSvgIconClass", isClickTogglingNode: ["isClickTogglingNode", "isClickTogglingNode", booleanAttribute], isMultiselect: ["isMultiselect", "isMultiselect", booleanAttribute], isSingleSelect: ["isSingleSelect", "isSingleSelect", booleanAttribute], isRecursiveSelection: ["isRecursiveSelection", "isRecursiveSelection", booleanAttribute], isRecursiveParentSelection: ["isRecursiveParentSelection", "isRecursiveParentSelection", booleanAttribute], showUnderlinedLinks: ["showUnderlinedLinks", "showUnderlinedLinks", booleanAttribute], showLines: ["showLines", "showLines", booleanAttribute], autoTranslate: ["autoTranslate", "autoTranslate", booleanAttribute], highlightPath: ["highlightPath", "highlightPath", booleanAttribute] }, outputs: { selectionChange: "selectionChange", nodeClick: "nodeClick", nodeToggle: "nodeToggle" }, host: { properties: { "class": "this.cssClasses", "attr.data-e2e": "this.e2eAttr" } }, viewQueries: [{ propertyName: "cdkScrollableRef", first: true, predicate: ["cdkScrollableRef"], descendants: true, read: CdkScrollable }, { propertyName: "treeComponentInstance", first: true, predicate: ["treeComponentInstance"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"eui-ul-rep eui-tree__wrapper\" cdkScrollable #cdkScrollableRef>\n <cdk-tree\n #treeComponentInstance\n [dataSource]=\"cdkArrayDataSource\"\n [treeControl]=\"cdkTreeControl\"\n [trackBy]=\"trackBy\"\n *ngIf=\"renderTree\"\n class=\"eui-cdk-tree\">\n <!-- There are two states of generic cdk-nested-tree-node declarations.\n First one is without child. No sub rendering.\n -->\n <cdk-nested-tree-node *cdkTreeNodeDef=\"let treeRunTimeItemModel\" class=\"eui-cdk-nested-tree-node\">\n <div *ngIf=\"treeRunTimeItemModel\"\n class=\"eui-li-rep eui-tree-node\"\n [class.eui-tree-node--first]=\"treeRunTimeItemModel?.path === '0'\"\n [class.eui-tree-node--last]=\"treeRunTimeItemModel.last\"\n title=\"{{\n getTreeItem(treeRunTimeItemModel?.path)?.node?.treeContentBlock?.tooltipLabel ||\n getTreeItem(treeRunTimeItemModel?.path)?.node?.treeContentBlock?.label\n }}\">\n <div class=\"eui-tree-node-wrapper\"\n (click)=\"onNodeClick(treeRunTimeItemModel)\">\n <div class=\"eui-tree-node-wrapper__container\">\n <!--\n Renders node in default or provided template's context.\n Generates onSelect with onSelectFn for developers to send the events from their custom check events.\n Provides id to be used on generic template\n -->\n <ng-container\n [ngTemplateOutlet]=\"nodeTemplateRef || nodeTemplateDefault\"\n [ngTemplateOutletContext]=\"{\n $implicit: getTreeItem(treeRunTimeItemModel?.path)?.node,\n onSelect: onSelectFn(treeRunTimeItemModel.path),\n id: uid + treeRunTimeItemModel.path,\n path: treeRunTimeItemModel.path\n }\">\n </ng-container>\n </div>\n </div>\n </div>\n </cdk-nested-tree-node>\n <!-- This is the tree node template for expandable nodes -->\n <cdk-nested-tree-node\n *cdkTreeNodeDef=\"let treeRunTimeItemModel; when: hasChild\"\n class=\"eui-cdk-nested-tree-node eui-cdk-nested-tree-node--with-child\">\n <div\n class=\"eui-li-rep eui-tree-node eui-tree-node--with-child\"\n [class.eui-tree-node--first]=\"treeRunTimeItemModel?.path === '0'\"\n [class.eui-tree-node--last]=\"treeRunTimeItemModel.last\"\n *ngIf=\"treeRunTimeItemModel\"\n title=\"{{\n getTreeItem(treeRunTimeItemModel?.path)?.node?.treeContentBlock?.tooltipLabel ||\n getTreeItem(treeRunTimeItemModel?.path)?.node?.treeContentBlock?.label\n }}\">\n <div\n class=\"eui-tree-node-wrapper\">\n <!--Here wraps the node, and listen for node clicks.-->\n <div (click)=\"onNodeClick(treeRunTimeItemModel)\" class=\"eui-tree-node-wrapper__container\">\n <!-- Expand/collapse action button -->\n <button\n euiButton\n euiIconButton\n euiBasicButton\n euiRounded\n euiSizeS\n type=\"button\"\n [attr.aria-label]=\"'Toggle ' + getTreeItem(treeRunTimeItemModel?.path)?.node?.treeContentBlock?.label\"\n (click)=\"onNodeToggle(treeRunTimeItemModel)\"\n cdkTreeNodeToggle\n class=\"eui-tree-node__button\">\n <eui-icon-svg\n *ngIf=\"!cdkTreeControl.isExpanded(treeRunTimeItemModel) && !collapsedIconClass\"\n [icon]=\"expandedSvgIconClass\"></eui-icon-svg>\n <eui-icon-svg\n *ngIf=\"cdkTreeControl.isExpanded(treeRunTimeItemModel) && !expandedIconClass\"\n [icon]=\"collapsedSvgIconClass\"></eui-icon-svg>\n </button>\n <!--\n Renders node in default or provided template's context.\n Generates onSelect with onSelectFn for developers to send the events from their custom check events.\n Provides id to be used on generic template\n -->\n <ng-container\n [ngTemplateOutlet]=\"nodeTemplateRef || nodeTemplateDefault\"\n [ngTemplateOutletContext]=\"{\n $implicit: getTreeItem(treeRunTimeItemModel.path)?.node,\n onSelect: onSelectFn(treeRunTimeItemModel.path),\n id: uid + treeRunTimeItemModel.path,\n path: treeRunTimeItemModel.path,\n children: getTreeItem(treeRunTimeItemModel?.path)?.children\n }\">\n </ng-container>\n </div>\n </div>\n <!--uses cdkTreeNodeOutlet to render children nodes, CdkTreeControl is used to control isExpanded state.-->\n <div class=\"eui-ul-rep eui-tree-node\" role=\"group\" *ngIf=\"cdkTreeControl.isExpanded(treeRunTimeItemModel)\">\n <ng-container cdkTreeNodeOutlet></ng-container>\n </div>\n </div>\n </cdk-nested-tree-node>\n </cdk-tree>\n</div>\n\n<ng-template #nodeTemplateDefault let-node let-onSelect=\"onSelect\" let-id=\"id\" let-path=\"path\">\n <ng-container *ngIf=\"node\">\n <div class=\"eui-tree-node-wrapper__container-left\" [class.eui-tree-node-wrapper__container-left--selected]=\"node?.isSelected\">\n <!--input checkbox area-->\n <input\n euiInputCheckBox\n *ngIf=\"node && node.selectable\"\n type=\"checkbox\"\n id=\"{{ id }}\"\n [checked]=\"!!node?.isSelected\"\n [indeterminate]=\"!!node?.isIndeterminate\"\n (change)=\"onSelect($event)\"\n class=\"eui-u-mr-m\" />\n\n <!--icon area-->\n <ng-container *ngIf=\"node?.treeContentBlock?.iconSvgName\">\n <eui-icon-svg\n icon=\"{{ node?.treeContentBlock?.iconSvgName }}\"\n fillColor=\"{{ node?.treeContentBlock?.iconTypeClass || 'neutral' }}\"\n size=\"s\"\n class=\"eui-u-mr-xs\">\n </eui-icon-svg>\n </ng-container>\n\n <!--chips area-->\n <ng-container *ngIf=\"node?.treeContentBlock?.chips\">\n <eui-chip\n *ngFor=\"let chip of node.treeContentBlock.chips\"\n euiSizeS\n [euiVariant]=\"chip.typeClass || 'secondary'\"\n [euiOutline]=\"chip.isOutline\"\n class=\"eui-chip--rounded eui-u-mb-none eui-u-mr-xs\">\n <span euiLabel>{{ chip.label }}</span>\n </eui-chip>\n </ng-container>\n\n <!--badge (typeLabel & typeClass) area-->\n <ng-container *ngIf=\"node?.treeContentBlock?.typeLabel\" [ngSwitch]=\"node?.treeContentBlock?.typeClass\">\n <eui-badge euiSizeM [euiVariant]=\"node?.treeContentBlock?.typeClass || 'primary'\" class=\"eui-u-flex-no-shrink eui-u-mr-xs\">\n {{ node?.treeContentBlock?.typeLabel }}\n </eui-badge>\n </ng-container>\n </div>\n\n <!--label area-->\n <div class=\"eui-tree-node-wrapper__container-middle\">\n <label\n *ngIf=\"!node?.treeContentBlock?.url && !node?.treeContentBlock?.urlExternal\"\n euiLabel\n for=\"{{ id }}\"\n class=\"eui-u-text-truncate eui-u-p-2xs\"\n [class.eui-label--selected]=\"\n highlightPath\n ? getRunTimeSelectionRecursiveState(path)?.selectionRecursiveState === 'indeterminate' || node?.isSelected\n : node?.isSelected\n \"\n [class.eui-u-cursor-pointer]=\"node?.selectable\">\n {{ autoTranslate ? (node?.treeContentBlock?.label | translate) : node?.treeContentBlock?.label }}\n </label>\n <label *ngIf=\"node?.treeContentBlock?.url\" euiLabel for=\"{{ id }}\" class=\"eui-u-text-truncate eui-u-p-2xs\">\n <a\n class=\"eui-u-text-link\"\n [class.eui-u-text-link-standalone]=\"!showUnderlinedLinks\"\n [routerLink]=\"node?.treeContentBlock?.url\">\n {{ autoTranslate ? (node?.treeContentBlock?.label | translate) : node?.treeContentBlock?.label }}\n </a>\n </label>\n <label *ngIf=\"node?.treeContentBlock?.urlExternal\" euiLabel for=\"{{ id }}\" class=\"eui-u-text-truncate eui-u-p-2xs\">\n <a\n class=\"eui-u-text-link-external\"\n [class.eui-u-text-link-external-standalone]=\"!showUnderlinedLinks\"\n href=\"{{ node?.treeContentBlock?.urlExternal }}\"\n target=\"{{ node?.treeContentBlock?.urlExternalTarget || 'blank' }}\">\n {{ autoTranslate ? (node?.treeContentBlock?.label | translate) : node?.treeContentBlock?.label }}\n </a>\n </label>\n </div>\n\n <div *ngIf=\"node?.treeContentBlock?.rightContent\" class=\"eui-tree-node-wrapper__container-right\">\n <!--badges area-->\n <ng-container *ngFor=\"let badge of node.treeContentBlock.rightContent?.badges\">\n <eui-badge euiOutline [euiVariant]=\"badge.typeClass || 'secondary'\" class=\"eui-u-ml-xs\">\n <span euiLabel>{{ badge.label }}</span>\n </eui-badge>\n </ng-container>\n\n <!--chips area-->\n <ng-container *ngFor=\"let chip of node.treeContentBlock.rightContent?.chips\">\n <eui-chip\n euiSizeS\n [euiVariant]=\"chip.typeClass || 'secondary'\"\n [euiOutline]=\"chip.isOutline\"\n class=\"eui-chip--rounded eui-u-mb-none eui-u-ml-xs\">\n <span euiLabel>{{ chip.label }}</span>\n </eui-chip>\n </ng-container>\n\n <!--Context menu-->\n <ng-container *ngIf=\"node.treeContentBlock.rightContent?.contextMenuMetaData && rightContextMenuTemplateRef\">\n <eui-dropdown class=\"eui-u-ml-xs\">\n <button euiButton euiSizeS euiRounded euiIconButton euiBasicButton euiSecondary [attr.aria-label]=\"'Options menu'\">\n <eui-icon-svg icon=\"ellipsis-vertical:sharp\"></eui-icon-svg>\n </button>\n <eui-dropdown-content>\n <ng-template\n [ngTemplateOutlet]=\"rightContextMenuTemplateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: node?.treeContentBlock?.rightContent?.contextMenuMetaData,\n metadata: node?.treeContentBlock?.rightContent?.contextMenuMetaData\n }\">\n </ng-template>\n </eui-dropdown-content>\n </eui-dropdown>\n </ng-container>\n </div>\n\n <!--metadata, uses the help of ng template to generate dynamic expand variable without handling state -->\n <ng-container\n *ngIf=\"node.treeContentBlock?.metadata && nodeContentMetadataTemplateRef\"\n [ngTemplateOutlet]=\"nodeContentMetadataContainer\"\n [ngTemplateOutletContext]=\"{\n $implicit: { expanded: false }\n }\">\n </ng-container>\n <ng-template #nodeContentMetadataContainer let-metaDataContainer>\n <button\n euiButton\n euiBasicButton\n euiIconButton\n euiRounded\n euiSizeS\n type=\"button\"\n aria-label=\"expand collapse tree item\"\n (click)=\"metaDataContainer.expanded = !metaDataContainer.expanded\">\n <eui-icon-svg [icon]=\"metaDataContainer.expanded ? 'chevron-down:sharp' : 'chevron-forward:sharp'\"></eui-icon-svg>\n </button>\n <div *ngIf=\"metaDataContainer.expanded\" class=\"eui-tree-node__metacontent\">\n <!--passing metadata of the node content to provided template-ref:nodeContentMetadataTemplateRef-->\n <ng-template\n [ngTemplateOutlet]=\"nodeContentMetadataTemplateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: node?.treeContentBlock?.metadata,\n metadata: node?.treeContentBlock?.metadata\n }\">\n </ng-template>\n </div>\n </ng-template>\n </ng-container>\n</ng-template>\n", styles: [".eui-tree{display:flex;overflow-x:hidden;overflow-y:auto;position:relative;width:100%}.eui-tree .eui-tree__wrapper{display:flex;list-style:none;margin:0;overflow-y:auto;padding:var(--eui-s-2xs);position:relative;width:100%}.eui-tree .eui-tree__wrapper::-webkit-scrollbar{display:inherit;height:8px;width:8px;background-color:var(--eui-c-neutral-bg-light)}.eui-tree .eui-tree__wrapper::-webkit-scrollbar-thumb{background-color:var(--eui-c-neutral-lightest);border-radius:5rem}.eui-tree .eui-tree__wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--eui-c-neutral-lighter)}.eui-tree .eui-tree__wrapper::-webkit-scrollbar-track{background-color:var(--eui-c-neutral-bg-light);border-radius:0}.eui-tree .eui-tree__wrapper .eui-cdk-tree{display:flex;flex-direction:column;width:100%}.eui-tree .eui-tree__wrapper .eui-cdk-tree .eui-cdk-nested-tree-node{display:flex;width:auto}.eui-tree .eui-tree__wrapper .eui-cdk-tree .eui-cdk-nested-tree-node:not(.eui-cdk-nested-tree-node--with-child){padding-inline-start:var(--eui-s-xl)}.eui-tree .eui-tree__wrapper .eui-cdk-tree .eui-cdk-nested-tree-node--with-child{display:flex;width:100%}.eui-tree .eui-tree__wrapper .eui-tree-node{display:flex;flex-direction:column;width:100%}.eui-tree .eui-tree__wrapper .eui-tree-node__metacontent{display:flex}.eui-tree .eui-tree__wrapper .eui-tree-node__button{margin-left:calc(-3 * var(--eui-s-2xs));margin-right:var(--eui-s-2xs)}.eui-tree .eui-tree__wrapper .eui-tree-node-wrapper{align-items:center;display:flex;min-height:var(--eui-s-xl);width:100%}.eui-tree .eui-tree__wrapper .eui-tree-node-wrapper:hover{background-color:var(--eui-c-neutral-bg-light)}.eui-tree .eui-tree__wrapper .eui-tree-node-wrapper__container{align-items:center;display:flex;width:100%}.eui-tree .eui-tree__wrapper .eui-tree-node-wrapper__container-left{align-items:center;display:flex;justify-content:flex-start}.eui-tree .eui-tree__wrapper .eui-tree-node-wrapper__container-middle{align-items:center;display:flex;justify-content:flex-start;overflow:hidden;width:100%}.eui-tree .eui-tree__wrapper .eui-tree-node-wrapper__container-right{align-items:center;display:flex;justify-content:flex-end;margin-left:auto}.eui-tree:not(.eui-tree--with-children) .eui-tree__wrapper .eui-cdk-tree .eui-cdk-nested-tree-node{padding-inline-start:2px}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-ul-rep{padding-inline-start:var(--eui-s-s)}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-ul-rep:before{border-left:1px solid var(--eui-c-neutral-lightest);content:\"\";height:calc(100% - var(--eui-s-m) - var(--eui-s-xl));position:absolute;top:var(--eui-s-xl)}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-ul-rep:first-child:before{height:calc(100% - var(--eui-s-m) - var(--eui-s-2xs));top:0}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-li-rep{padding-inline-start:var(--eui-s-s);position:relative}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-li-rep:before:not(.eui-tree-node--first){border-top:1px solid var(--eui-c-neutral-lightest);content:\"\";display:block;height:0;left:0;position:absolute;top:var(--eui-s-m);width:var(--eui-s-xl)}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-li-rep.eui-tree-node:not(.eui-tree-node--with-child):before{position:relative;left:0;display:inline-flex;width:var(--eui-s-2xl);border-bottom:1px solid var(--eui-c-neutral-lightest);content:\"\";margin-left:calc(-2 * var(--eui-s-l) + var(--eui-s-2xs));top:var(--eui-s-m)}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-li-rep.eui-tree-node.eui-tree-node--with-child:before{position:absolute;left:calc(1 * var(--eui-s-2xl) + var(--eui-s-2xs));display:inline-flex;width:var(--eui-s-s);border-bottom:1px solid var(--eui-c-neutral-lightest);border-left:1px solid var(--eui-c-neutral-lightest);content:\"\";margin-left:calc(-2 * var(--eui-s-l) + var(--eui-s-2xs));top:var(--eui-s-m)}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-li-rep.eui-tree-node--last:before{height:auto;top:var(--eui-s-m)}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i4.EuiInputCheckboxComponent, selector: "input[euiInputCheckBox]", inputs: ["indeterminate", "isInvalid", "checked"], outputs: ["indeterminateChange"] }, { kind: "directive", type: i5.CdkNestedTreeNode, selector: "cdk-nested-tree-node", exportAs: ["cdkNestedTreeNode"] }, { kind: "directive", type: i5.CdkTreeNodeDef, selector: "[cdkTreeNodeDef]", inputs: ["cdkTreeNodeDefWhen"] }, { kind: "directive", type: i5.CdkTreeNodeToggle, selector: "[cdkTreeNodeToggle]", inputs: ["cdkTreeNodeToggleRecursive"] }, { kind: "component", type: i5.CdkTree, selector: "cdk-tree", inputs: ["dataSource", "treeControl", "trackBy"], exportAs: ["cdkTree"] }, { kind: "directive", type: i5.CdkTreeNodeOutlet, selector: "[cdkTreeNodeOutlet]" }, { kind: "component", type: i6.EuiButtonComponent, selector: "button[euiButton], a[euiButton]", inputs: ["e2eAttr", "id", "euiBasicButton", "euiButtonCall", "euiBlockButton", "euiIconButton", "euiLineWrap", "isChecked", "euiDisabled"], outputs: ["buttonClick"] }, { kind: "component", type: i7.EuiIconSvgComponent, selector: "eui-icon-svg, span[euiIconSvg], i[euiIconSvg]", inputs: ["icon", "fillColor", "set", "size", "style", "iconUrl", "transform", "euiVariant", "aria-label", "ariaHidden", "focusable", "isLoading", "isInputIcon", "euiStart", "euiEnd"] }, { kind: "component", type: i8.EuiLabelComponent, selector: "label[euiLabel], span[euiLabel], div[euiLabel], a[euiLabel], eui-label, label[euiSublabel], span[euiSublabel], div[euiSublabel], a[euiSublabel], eui-sublabel", inputs: ["euiRequired", "euiReadonly", "euiSublabel"] }, { kind: "component", type: i9.EuiBadgeComponent, selector: "div[euiBadge], span[euiBadge], eui-badge", inputs: ["e2eAttr", "aria-label", "maxCharCount", "charReplacement", "euiIconBadge", "euiDottedBadge"] }, { kind: "component", type: i10.EuiChipComponent, selector: "eui-chip, span[euiChip], li[euiChip]", inputs: ["ariaLabel", "e2eAttr", "euiInternalId", "tooltipMessage", "id", "data", "isChipRemovable", "isSquared", "isFilled"], outputs: ["remove"] }, { kind: "component", type: i11.EuiDropdownComponent, selector: "eui-dropdown", inputs: ["e2eAttr", "tabIndex", "width", "position", "isBlock", "isDropDownRightAligned", "hasClosedOnClickInside", "isLabelUpdatedFromSelectedItem", "isExpandOnHover", "hasTabNavigation", "isRightClickEnabled", "euiDisabled"], outputs: ["expand"] }, { kind: "directive", type: i11.EuiDropdownContentDirective, selector: "eui-dropdown-content" }, { kind: "directive", type: i1.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "pipe", type: i12.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
944
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.2", type: EuiTreeComponent, selector: "eui-tree", inputs: { e2eAttr: "e2eAttr", nodes: "nodes", nodeTemplateRef: "nodeTemplateRef", nodeContentMetadataTemplateRef: "nodeContentMetadataTemplateRef", rightContextMenuTemplateRef: "rightContextMenuTemplateRef", customNodeSelectFn: "customNodeSelectFn", expandedIconClass: "expandedIconClass", collapsedIconClass: "collapsedIconClass", expandedSvgIconClass: "expandedSvgIconClass", collapsedSvgIconClass: "collapsedSvgIconClass", isClickTogglingNode: ["isClickTogglingNode", "isClickTogglingNode", booleanAttribute], isMultiselect: ["isMultiselect", "isMultiselect", booleanAttribute], isSingleSelect: ["isSingleSelect", "isSingleSelect", booleanAttribute], isRecursiveSelection: ["isRecursiveSelection", "isRecursiveSelection", booleanAttribute], isRecursiveParentSelection: ["isRecursiveParentSelection", "isRecursiveParentSelection", booleanAttribute], showUnderlinedLinks: ["showUnderlinedLinks", "showUnderlinedLinks", booleanAttribute], showLines: ["showLines", "showLines", booleanAttribute], autoTranslate: ["autoTranslate", "autoTranslate", booleanAttribute], highlightPath: ["highlightPath", "highlightPath", booleanAttribute] }, outputs: { selectionChange: "selectionChange", nodeClick: "nodeClick", nodeToggle: "nodeToggle" }, host: { properties: { "class": "this.cssClasses", "attr.data-e2e": "this.e2eAttr" } }, viewQueries: [{ propertyName: "cdkScrollableRef", first: true, predicate: ["cdkScrollableRef"], descendants: true, read: CdkScrollable }, { propertyName: "treeComponentInstance", first: true, predicate: ["treeComponentInstance"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"eui-ul-rep eui-tree__wrapper\" cdkScrollable #cdkScrollableRef>\n <cdk-tree\n #treeComponentInstance\n [dataSource]=\"cdkArrayDataSource\"\n [treeControl]=\"cdkTreeControl\"\n [trackBy]=\"trackBy\"\n *ngIf=\"renderTree\"\n class=\"eui-cdk-tree\">\n <!-- There are two states of generic cdk-nested-tree-node declarations.\n First one is without child. No sub rendering.\n -->\n <cdk-nested-tree-node *cdkTreeNodeDef=\"let treeRunTimeItemModel\" class=\"eui-cdk-nested-tree-node\">\n <div *ngIf=\"treeRunTimeItemModel\"\n class=\"eui-li-rep eui-tree-node\"\n [class.eui-tree-node--first]=\"treeRunTimeItemModel?.path === '0'\"\n [class.eui-tree-node--last]=\"treeRunTimeItemModel.last\"\n title=\"{{\n getTreeItem(treeRunTimeItemModel?.path)?.node?.treeContentBlock?.tooltipLabel ||\n getTreeItem(treeRunTimeItemModel?.path)?.node?.treeContentBlock?.label\n }}\">\n <div class=\"eui-tree-node-wrapper\"\n (click)=\"onNodeClick(treeRunTimeItemModel)\">\n <div class=\"eui-tree-node-wrapper__container\">\n <!--\n Renders node in default or provided template's context.\n Generates onSelect with onSelectFn for developers to send the events from their custom check events.\n Provides id to be used on generic template\n -->\n <ng-container\n [ngTemplateOutlet]=\"nodeTemplateRef || nodeTemplateDefault\"\n [ngTemplateOutletContext]=\"{\n $implicit: getTreeItem(treeRunTimeItemModel?.path)?.node,\n onSelect: onSelectFn(treeRunTimeItemModel.path),\n id: uid + treeRunTimeItemModel.path,\n path: treeRunTimeItemModel.path\n }\">\n </ng-container>\n </div>\n </div>\n </div>\n </cdk-nested-tree-node>\n <!-- This is the tree node template for expandable nodes -->\n <cdk-nested-tree-node\n *cdkTreeNodeDef=\"let treeRunTimeItemModel; when: hasChild\"\n class=\"eui-cdk-nested-tree-node eui-cdk-nested-tree-node--with-child\">\n <div\n class=\"eui-li-rep eui-tree-node eui-tree-node--with-child\"\n [class.eui-tree-node--first]=\"treeRunTimeItemModel?.path === '0'\"\n [class.eui-tree-node--last]=\"treeRunTimeItemModel.last\"\n *ngIf=\"treeRunTimeItemModel\"\n title=\"{{\n getTreeItem(treeRunTimeItemModel?.path)?.node?.treeContentBlock?.tooltipLabel ||\n getTreeItem(treeRunTimeItemModel?.path)?.node?.treeContentBlock?.label\n }}\">\n <div\n class=\"eui-tree-node-wrapper\">\n <!--Here wraps the node, and listen for node clicks.-->\n <div (click)=\"onNodeClick(treeRunTimeItemModel)\" class=\"eui-tree-node-wrapper__container\">\n <!-- Expand/collapse action button -->\n <button\n euiButton\n euiIconButton\n euiBasicButton\n euiRounded\n euiSizeS\n type=\"button\"\n [attr.aria-label]=\"'Toggle ' + getTreeItem(treeRunTimeItemModel?.path)?.node?.treeContentBlock?.label\"\n (click)=\"onNodeToggle(treeRunTimeItemModel)\"\n cdkTreeNodeToggle\n class=\"eui-tree-node__button\">\n <eui-icon-svg\n *ngIf=\"!cdkTreeControl.isExpanded(treeRunTimeItemModel) && !collapsedIconClass\"\n [icon]=\"expandedSvgIconClass\"></eui-icon-svg>\n <eui-icon-svg\n *ngIf=\"cdkTreeControl.isExpanded(treeRunTimeItemModel) && !expandedIconClass\"\n [icon]=\"collapsedSvgIconClass\"></eui-icon-svg>\n </button>\n <!--\n Renders node in default or provided template's context.\n Generates onSelect with onSelectFn for developers to send the events from their custom check events.\n Provides id to be used on generic template\n -->\n <ng-container\n [ngTemplateOutlet]=\"nodeTemplateRef || nodeTemplateDefault\"\n [ngTemplateOutletContext]=\"{\n $implicit: getTreeItem(treeRunTimeItemModel.path)?.node,\n onSelect: onSelectFn(treeRunTimeItemModel.path),\n id: uid + treeRunTimeItemModel.path,\n path: treeRunTimeItemModel.path,\n children: getTreeItem(treeRunTimeItemModel?.path)?.children\n }\">\n </ng-container>\n </div>\n </div>\n <!--uses cdkTreeNodeOutlet to render children nodes, CdkTreeControl is used to control isExpanded state.-->\n <div class=\"eui-ul-rep eui-tree-node\" role=\"group\" *ngIf=\"cdkTreeControl.isExpanded(treeRunTimeItemModel)\">\n <ng-container cdkTreeNodeOutlet></ng-container>\n </div>\n </div>\n </cdk-nested-tree-node>\n </cdk-tree>\n</div>\n\n<ng-template #nodeTemplateDefault let-node let-onSelect=\"onSelect\" let-id=\"id\" let-path=\"path\">\n <ng-container *ngIf=\"node\">\n <div class=\"eui-tree-node-wrapper__container-left\" [class.eui-tree-node-wrapper__container-left--selected]=\"node?.isSelected\">\n <!--input checkbox area-->\n <input\n euiInputCheckBox\n *ngIf=\"node && node.selectable\"\n type=\"checkbox\"\n id=\"{{ id }}\"\n [checked]=\"!!node?.isSelected\"\n [indeterminate]=\"!!node?.isIndeterminate\"\n (change)=\"onSelect($event)\"\n class=\"eui-u-mr-m\" />\n\n <!--icon area-->\n <ng-container *ngIf=\"node?.treeContentBlock?.iconSvgName\">\n <eui-icon-svg\n icon=\"{{ node?.treeContentBlock?.iconSvgName }}\"\n fillColor=\"{{ node?.treeContentBlock?.iconTypeClass || 'neutral' }}\"\n size=\"s\"\n class=\"eui-u-mr-xs\">\n </eui-icon-svg>\n </ng-container>\n\n <!--chips area-->\n <ng-container *ngIf=\"node?.treeContentBlock?.chips\">\n <eui-chip\n *ngFor=\"let chip of node.treeContentBlock.chips\"\n euiSizeS\n [euiVariant]=\"chip.typeClass || 'secondary'\"\n [euiOutline]=\"chip.isOutline\"\n class=\"eui-chip--rounded eui-u-mb-none eui-u-mr-xs\">\n <span euiLabel>{{ chip.label }}</span>\n </eui-chip>\n </ng-container>\n\n <!--badge (typeLabel & typeClass) area-->\n <ng-container *ngIf=\"node?.treeContentBlock?.typeLabel\" [ngSwitch]=\"node?.treeContentBlock?.typeClass\">\n <eui-badge euiSizeM [euiVariant]=\"node?.treeContentBlock?.typeClass || 'primary'\" class=\"eui-u-flex-no-shrink eui-u-mr-xs\">\n {{ node?.treeContentBlock?.typeLabel }}\n </eui-badge>\n </ng-container>\n </div>\n\n <!--label area-->\n <div class=\"eui-tree-node-wrapper__container-middle\">\n <label\n *ngIf=\"!node?.treeContentBlock?.url && !node?.treeContentBlock?.urlExternal\"\n euiLabel\n for=\"{{ id }}\"\n class=\"eui-u-text-truncate eui-u-p-2xs\"\n [class.eui-label--selected]=\"\n highlightPath\n ? getRunTimeSelectionRecursiveState(path)?.selectionRecursiveState === 'indeterminate' || node?.isSelected\n : node?.isSelected\n \"\n [class.eui-u-cursor-pointer]=\"node?.selectable\">\n {{ autoTranslate ? (node?.treeContentBlock?.label | translate) : node?.treeContentBlock?.label }}\n </label>\n <label *ngIf=\"node?.treeContentBlock?.url\" euiLabel for=\"{{ id }}\" class=\"eui-u-text-truncate eui-u-p-2xs\">\n <a\n class=\"eui-u-text-link\"\n [class.eui-u-text-link-standalone]=\"!showUnderlinedLinks\"\n [routerLink]=\"node?.treeContentBlock?.url\">\n {{ autoTranslate ? (node?.treeContentBlock?.label | translate) : node?.treeContentBlock?.label }}\n </a>\n </label>\n <label *ngIf=\"node?.treeContentBlock?.urlExternal\" euiLabel for=\"{{ id }}\" class=\"eui-u-text-truncate eui-u-p-2xs\">\n <a\n class=\"eui-u-text-link-external\"\n [class.eui-u-text-link-external-standalone]=\"!showUnderlinedLinks\"\n href=\"{{ node?.treeContentBlock?.urlExternal }}\"\n target=\"{{ node?.treeContentBlock?.urlExternalTarget || 'blank' }}\">\n {{ autoTranslate ? (node?.treeContentBlock?.label | translate) : node?.treeContentBlock?.label }}\n </a>\n </label>\n </div>\n\n <div *ngIf=\"node?.treeContentBlock?.rightContent\" class=\"eui-tree-node-wrapper__container-right\">\n <!--badges area-->\n <ng-container *ngFor=\"let badge of node.treeContentBlock.rightContent?.badges\">\n <eui-badge euiOutline [euiVariant]=\"badge.typeClass || 'secondary'\" class=\"eui-u-ml-xs\">\n <span euiLabel>{{ badge.label }}</span>\n </eui-badge>\n </ng-container>\n\n <!--chips area-->\n <ng-container *ngFor=\"let chip of node.treeContentBlock.rightContent?.chips\">\n <eui-chip\n euiSizeS\n [euiVariant]=\"chip.typeClass || 'secondary'\"\n [euiOutline]=\"chip.isOutline\"\n class=\"eui-chip--rounded eui-u-mb-none eui-u-ml-xs\">\n <span euiLabel>{{ chip.label }}</span>\n </eui-chip>\n </ng-container>\n\n <!--Context menu-->\n <ng-container *ngIf=\"node.treeContentBlock.rightContent?.contextMenuMetaData && rightContextMenuTemplateRef\">\n <eui-dropdown class=\"eui-u-ml-xs\">\n <button euiButton euiSizeS euiRounded euiIconButton euiBasicButton euiSecondary [attr.aria-label]=\"'Options menu'\">\n <eui-icon-svg icon=\"ellipsis-vertical:sharp\"></eui-icon-svg>\n </button>\n <eui-dropdown-content>\n <ng-template\n [ngTemplateOutlet]=\"rightContextMenuTemplateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: node?.treeContentBlock?.rightContent?.contextMenuMetaData,\n metadata: node?.treeContentBlock?.rightContent?.contextMenuMetaData\n }\">\n </ng-template>\n </eui-dropdown-content>\n </eui-dropdown>\n </ng-container>\n </div>\n\n <!--metadata, uses the help of ng template to generate dynamic expand variable without handling state -->\n <ng-container\n *ngIf=\"node.treeContentBlock?.metadata && nodeContentMetadataTemplateRef\"\n [ngTemplateOutlet]=\"nodeContentMetadataContainer\"\n [ngTemplateOutletContext]=\"{\n $implicit: { expanded: false }\n }\">\n </ng-container>\n <ng-template #nodeContentMetadataContainer let-metaDataContainer>\n <button\n euiButton\n euiBasicButton\n euiIconButton\n euiRounded\n euiSizeS\n type=\"button\"\n aria-label=\"expand collapse tree item\"\n (click)=\"metaDataContainer.expanded = !metaDataContainer.expanded\">\n <eui-icon-svg [icon]=\"metaDataContainer.expanded ? 'chevron-down:sharp' : 'chevron-forward:sharp'\"></eui-icon-svg>\n </button>\n <div *ngIf=\"metaDataContainer.expanded\" class=\"eui-tree-node__metacontent\">\n <!--passing metadata of the node content to provided template-ref:nodeContentMetadataTemplateRef-->\n <ng-template\n [ngTemplateOutlet]=\"nodeContentMetadataTemplateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: node?.treeContentBlock?.metadata,\n metadata: node?.treeContentBlock?.metadata\n }\">\n </ng-template>\n </div>\n </ng-template>\n </ng-container>\n</ng-template>\n", styles: [".eui-tree{display:flex;overflow-x:hidden;overflow-y:auto;position:relative;width:100%}.eui-tree .eui-tree__wrapper{display:flex;list-style:none;margin:0;overflow-y:auto;padding:var(--eui-s-2xs);position:relative;width:100%}.eui-tree .eui-tree__wrapper::-webkit-scrollbar{display:inherit;height:8px;width:8px;background-color:var(--eui-c-neutral-bg-light)}.eui-tree .eui-tree__wrapper::-webkit-scrollbar-thumb{background-color:var(--eui-c-neutral-lightest);border-radius:5rem}.eui-tree .eui-tree__wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--eui-c-neutral-lighter)}.eui-tree .eui-tree__wrapper::-webkit-scrollbar-track{background-color:var(--eui-c-neutral-bg-light);border-radius:0}.eui-tree .eui-tree__wrapper .eui-cdk-tree{display:flex;flex-direction:column;width:100%}.eui-tree .eui-tree__wrapper .eui-cdk-tree .eui-cdk-nested-tree-node{display:flex;width:auto}.eui-tree .eui-tree__wrapper .eui-cdk-tree .eui-cdk-nested-tree-node:not(.eui-cdk-nested-tree-node--with-child){padding-inline-start:var(--eui-s-xl)}.eui-tree .eui-tree__wrapper .eui-cdk-tree .eui-cdk-nested-tree-node--with-child{display:flex;width:100%}.eui-tree .eui-tree__wrapper .eui-tree-node{display:flex;flex-direction:column;width:100%}.eui-tree .eui-tree__wrapper .eui-tree-node__metacontent{display:flex}.eui-tree .eui-tree__wrapper .eui-tree-node__button{margin-left:calc(-3 * var(--eui-s-2xs));margin-right:var(--eui-s-2xs)}.eui-tree .eui-tree__wrapper .eui-tree-node-wrapper{align-items:center;display:flex;min-height:var(--eui-s-xl);width:100%}.eui-tree .eui-tree__wrapper .eui-tree-node-wrapper:hover{background-color:var(--eui-c-neutral-bg-light)}.eui-tree .eui-tree__wrapper .eui-tree-node-wrapper__container{align-items:center;display:flex;width:100%}.eui-tree .eui-tree__wrapper .eui-tree-node-wrapper__container-left{align-items:center;display:flex;justify-content:flex-start}.eui-tree .eui-tree__wrapper .eui-tree-node-wrapper__container-middle{align-items:center;display:flex;justify-content:flex-start;overflow:hidden;width:100%}.eui-tree .eui-tree__wrapper .eui-tree-node-wrapper__container-right{align-items:center;display:flex;justify-content:flex-end;margin-left:auto}.eui-tree:not(.eui-tree--with-children) .eui-tree__wrapper .eui-cdk-tree .eui-cdk-nested-tree-node{padding-inline-start:2px}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-ul-rep{padding-inline-start:var(--eui-s-s)}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-ul-rep:before{border-left:1px solid var(--eui-c-neutral-lightest);content:\"\";height:calc(100% - var(--eui-s-m) - var(--eui-s-xl));position:absolute;top:var(--eui-s-xl)}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-ul-rep:first-child:before{height:calc(100% - var(--eui-s-m) - var(--eui-s-2xs));top:0}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-li-rep{padding-inline-start:var(--eui-s-s);position:relative}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-li-rep:before:not(.eui-tree-node--first){border-top:1px solid var(--eui-c-neutral-lightest);content:\"\";display:block;height:0;left:0;position:absolute;top:var(--eui-s-m);width:var(--eui-s-xl)}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-li-rep.eui-tree-node:not(.eui-tree-node--with-child):before{position:relative;left:0;display:inline-flex;width:var(--eui-s-2xl);border-bottom:1px solid var(--eui-c-neutral-lightest);content:\"\";margin-left:calc(-2 * var(--eui-s-l) + var(--eui-s-2xs));top:var(--eui-s-m)}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-li-rep.eui-tree-node.eui-tree-node--with-child:before{position:absolute;left:calc(1 * var(--eui-s-2xl) + var(--eui-s-2xs));display:inline-flex;width:var(--eui-s-s);border-bottom:1px solid var(--eui-c-neutral-lightest);border-left:1px solid var(--eui-c-neutral-lightest);content:\"\";margin-left:calc(-2 * var(--eui-s-l) + var(--eui-s-2xs));top:var(--eui-s-m)}.eui-tree.eui-tree--show-lines.eui-tree--with-children div.eui-li-rep.eui-tree-node--last:before{height:auto;top:var(--eui-s-m)}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i4.EuiInputCheckboxComponent, selector: "input[euiInputCheckBox]", inputs: ["indeterminate", "isInvalid", "checked"], outputs: ["indeterminateChange"] }, { kind: "directive", type: i5.CdkNestedTreeNode, selector: "cdk-nested-tree-node", exportAs: ["cdkNestedTreeNode"] }, { kind: "directive", type: i5.CdkTreeNodeDef, selector: "[cdkTreeNodeDef]", inputs: ["cdkTreeNodeDefWhen"] }, { kind: "directive", type: i5.CdkTreeNodeToggle, selector: "[cdkTreeNodeToggle]", inputs: ["cdkTreeNodeToggleRecursive"] }, { kind: "component", type: i5.CdkTree, selector: "cdk-tree", inputs: ["dataSource", "treeControl", "trackBy"], exportAs: ["cdkTree"] }, { kind: "directive", type: i5.CdkTreeNodeOutlet, selector: "[cdkTreeNodeOutlet]" }, { kind: "component", type: i6.EuiButtonComponent, selector: "button[euiButton], a[euiButton]", inputs: ["e2eAttr", "id", "euiBasicButton", "euiButtonCall", "euiBlockButton", "euiIconButton", "euiLineWrap", "isChecked", "euiDisabled"], outputs: ["buttonClick"] }, { kind: "component", type: i7.EuiIconSvgComponent, selector: "eui-icon-svg, span[euiIconSvg], i[euiIconSvg]", inputs: ["icon", "fillColor", "set", "size", "style", "iconUrl", "transform", "euiVariant", "aria-label", "ariaHidden", "focusable", "isLoading", "isInputIcon", "euiStart", "euiEnd"] }, { kind: "component", type: i8.EuiLabelComponent, selector: "label[euiLabel], span[euiLabel], div[euiLabel], a[euiLabel], eui-label, label[euiSublabel], span[euiSublabel], div[euiSublabel], a[euiSublabel], eui-sublabel", inputs: ["euiRequired", "euiReadonly", "euiSublabel"] }, { kind: "component", type: i9.EuiBadgeComponent, selector: "div[euiBadge], span[euiBadge], eui-badge", inputs: ["e2eAttr", "aria-label", "maxCharCount", "charReplacement", "euiIconBadge", "euiDottedBadge"] }, { kind: "component", type: i10.EuiChipComponent, selector: "eui-chip, span[euiChip], li[euiChip]", inputs: ["ariaLabel", "e2eAttr", "euiInternalId", "tooltipMessage", "id", "data", "isChipRemovable", "isSquared", "isFilled"], outputs: ["remove"] }, { kind: "component", type: i11.EuiDropdownComponent, selector: "eui-dropdown", inputs: ["e2eAttr", "tabIndex", "width", "position", "isBlock", "isDropDownRightAligned", "hasClosedOnClickInside", "isLabelUpdatedFromSelectedItem", "isExpandOnHover", "hasTabNavigation", "isRightClickEnabled", "euiDisabled"], outputs: ["expand"] }, { kind: "directive", type: i11.EuiDropdownContentDirective, selector: "eui-dropdown-content" }, { kind: "directive", type: i1.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "pipe", type: i12.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
906
945
|
}
|
907
946
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: EuiTreeComponent, decorators: [{
|
908
947
|
type: Component,
|
@@ -923,6 +962,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
|
|
923
962
|
type: Input
|
924
963
|
}], rightContextMenuTemplateRef: [{
|
925
964
|
type: Input
|
965
|
+
}], customNodeSelectFn: [{
|
966
|
+
type: Input
|
926
967
|
}], expandedIconClass: [{
|
927
968
|
type: Input
|
928
969
|
}], collapsedIconClass: [{
|
@@ -1185,7 +1226,7 @@ class EuiTreeFormControlDirective {
|
|
1185
1226
|
// TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
|
1186
1227
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
1187
1228
|
this.euiTreeControlValueSetter = (selection) => {
|
1188
|
-
return selection;
|
1229
|
+
return new EuiTreeHelper(this.tree.nodes).getItems(selection.map(item => item.node.treeContentBlock.id), 'node.treeContentBlock.id');
|
1189
1230
|
};
|
1190
1231
|
// TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
|
1191
1232
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
@@ -1266,5 +1307,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
|
|
1266
1307
|
* Generated bundle index. Do not edit.
|
1267
1308
|
*/
|
1268
1309
|
|
1269
|
-
export { EuiDropdownTreeDirective, EuiDropdownTreeDirectiveModule, EuiTreeComponent, EuiTreeFormControlDirective, EuiTreeFormControlDirectiveModule, EuiTreeHelper, EuiTreeModule, EuiTreePagination, uxTreeNodesMetaDataMapper };
|
1310
|
+
export { CustomNodeSelectFnHelper, EuiDropdownTreeDirective, EuiDropdownTreeDirectiveModule, EuiTreeComponent, EuiTreeFormControlDirective, EuiTreeFormControlDirectiveModule, EuiTreeHelper, EuiTreeModule, EuiTreePagination, uxTreeNodesMetaDataMapper };
|
1270
1311
|
//# sourceMappingURL=eui-components-eui-tree.mjs.map
|