@skyux/angular-tree-component 8.7.2 → 9.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.
Files changed (25) hide show
  1. package/documentation.json +24 -24
  2. package/{esm2020 → esm2022}/lib/modules/angular-tree/angular-tree-adapter.service.mjs +8 -11
  3. package/{esm2020 → esm2022}/lib/modules/angular-tree/angular-tree-context-menu.component.mjs +4 -4
  4. package/esm2022/lib/modules/angular-tree/angular-tree-node.component.mjs +254 -0
  5. package/{esm2020 → esm2022}/lib/modules/angular-tree/angular-tree-toolbar.component.mjs +4 -4
  6. package/esm2022/lib/modules/angular-tree/angular-tree-wrapper.component.mjs +190 -0
  7. package/esm2022/lib/modules/angular-tree/angular-tree.module.mjs +53 -0
  8. package/esm2022/lib/modules/shared/sky-angular-tree-component-resources.module.mjs +51 -0
  9. package/fesm2022/skyux-angular-tree-component.mjs +616 -0
  10. package/fesm2022/skyux-angular-tree-component.mjs.map +1 -0
  11. package/lib/modules/angular-tree/angular-tree-node.component.d.ts +2 -2
  12. package/lib/modules/angular-tree/angular-tree-toolbar.component.d.ts +1 -1
  13. package/lib/modules/angular-tree/angular-tree-wrapper.component.d.ts +3 -3
  14. package/lib/modules/angular-tree/angular-tree.module.d.ts +1 -1
  15. package/package.json +13 -19
  16. package/esm2020/lib/modules/angular-tree/angular-tree-node.component.mjs +0 -257
  17. package/esm2020/lib/modules/angular-tree/angular-tree-wrapper.component.mjs +0 -189
  18. package/esm2020/lib/modules/angular-tree/angular-tree.module.mjs +0 -53
  19. package/esm2020/lib/modules/shared/sky-angular-tree-component-resources.module.mjs +0 -51
  20. package/fesm2015/skyux-angular-tree-component.mjs +0 -625
  21. package/fesm2015/skyux-angular-tree-component.mjs.map +0 -1
  22. package/fesm2020/skyux-angular-tree-component.mjs +0 -619
  23. package/fesm2020/skyux-angular-tree-component.mjs.map +0 -1
  24. /package/{esm2020 → esm2022}/index.mjs +0 -0
  25. /package/{esm2020 → esm2022}/skyux-angular-tree-component.mjs +0 -0
@@ -0,0 +1,616 @@
1
+ import * as i1$1 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { NgModule, Component, ChangeDetectionStrategy, Injectable, EventEmitter, Input, Output, ContentChild, ElementRef, Optional, ViewChild } from '@angular/core';
5
+ import * as i6 from '@blackbaud/angular-tree-component';
6
+ import { TREE_ACTIONS, KEYS, TreeComponent, TreeModule } from '@blackbaud/angular-tree-component';
7
+ import * as i1 from '@skyux/core';
8
+ import { SkyCoreAdapterService } from '@skyux/core';
9
+ import * as i4$1 from '@skyux/forms';
10
+ import { SkyCheckboxModule } from '@skyux/forms';
11
+ import * as i2 from '@skyux/indicators';
12
+ import { SkyIconModule } from '@skyux/indicators';
13
+ import * as i3 from '@skyux/layout';
14
+ import { SkyToolbarModule } from '@skyux/layout';
15
+ import * as i4 from '@skyux/i18n';
16
+ import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
17
+
18
+ /**
19
+ * NOTICE: DO NOT MODIFY THIS FILE!
20
+ * The contents of this file were automatically generated by
21
+ * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-angular-tree-component' schematic.
22
+ * To update this file, simply rerun the command.
23
+ */
24
+ const RESOURCES = {
25
+ 'EN-US': {
26
+ skyux_angular_tree_clear_all: { message: 'Clear all' },
27
+ skyux_angular_tree_click_to_expand: { message: 'Click to expand' },
28
+ skyux_angular_tree_collapse_all: { message: 'Collapse' },
29
+ skyux_angular_tree_expand_all: { message: 'Expand' },
30
+ skyux_angular_tree_select_all: { message: 'Select all' },
31
+ },
32
+ };
33
+ class SkyAngularTreeComponentResourcesProvider {
34
+ getString(localeInfo, name) {
35
+ return getLibStringForLocale(RESOURCES, localeInfo.locale, name);
36
+ }
37
+ }
38
+ /**
39
+ * Import into any component library module that needs to use resource strings.
40
+ */
41
+ class SkyAngularTreeComponentResourcesModule {
42
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeComponentResourcesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
43
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeComponentResourcesModule, exports: [SkyI18nModule] }); }
44
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeComponentResourcesModule, providers: [
45
+ {
46
+ provide: SKY_LIB_RESOURCES_PROVIDERS,
47
+ useClass: SkyAngularTreeComponentResourcesProvider,
48
+ multi: true,
49
+ },
50
+ ], imports: [SkyI18nModule] }); }
51
+ }
52
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeComponentResourcesModule, decorators: [{
53
+ type: NgModule,
54
+ args: [{
55
+ exports: [SkyI18nModule],
56
+ providers: [
57
+ {
58
+ provide: SKY_LIB_RESOURCES_PROVIDERS,
59
+ useClass: SkyAngularTreeComponentResourcesProvider,
60
+ multi: true,
61
+ },
62
+ ],
63
+ }]
64
+ }] });
65
+
66
+ /**
67
+ * @internal
68
+ */
69
+ class SkyAngularTreeContextMenuComponent {
70
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeContextMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
71
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyAngularTreeContextMenuComponent, selector: "sky-angular-tree-context-menu", ngImport: i0, template: "<div class=\"sky-angular-tree-context-menu\">\n <ng-content></ng-content>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
72
+ }
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeContextMenuComponent, decorators: [{
74
+ type: Component,
75
+ args: [{ selector: 'sky-angular-tree-context-menu', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sky-angular-tree-context-menu\">\n <ng-content></ng-content>\n</div>\n" }]
76
+ }] });
77
+
78
+ /**
79
+ * @internal
80
+ */
81
+ class SkyAngularTreeAdapterService {
82
+ #coreAdapterService;
83
+ constructor(coreAdapterService) {
84
+ this.#coreAdapterService = coreAdapterService;
85
+ }
86
+ getFocusableChildren(element) {
87
+ return this.#coreAdapterService.getFocusableChildren(element);
88
+ }
89
+ setTabIndexOfFocusableEls(element, tabIndex) {
90
+ const focusableEls = this.#coreAdapterService.getFocusableChildren(element);
91
+ let index = focusableEls.length;
92
+ while (index--) {
93
+ focusableEls[index].tabIndex = tabIndex;
94
+ }
95
+ }
96
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeAdapterService, deps: [{ token: i1.SkyCoreAdapterService }], target: i0.ɵɵFactoryTarget.Injectable }); }
97
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeAdapterService }); }
98
+ }
99
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeAdapterService, decorators: [{
100
+ type: Injectable
101
+ }], ctorParameters: function () { return [{ type: i1.SkyCoreAdapterService }]; } });
102
+
103
+ /**
104
+ * @internal
105
+ */
106
+ class SkyTreeViewToolbarComponent {
107
+ constructor() {
108
+ this.clearAllClick = new EventEmitter();
109
+ this.collapseAllClick = new EventEmitter();
110
+ this.expandAllClick = new EventEmitter();
111
+ this.selectAllClick = new EventEmitter();
112
+ }
113
+ onClearAllClick() {
114
+ this.clearAllClick.emit();
115
+ }
116
+ onCollapseAllClick() {
117
+ this.collapseAllClick.emit();
118
+ }
119
+ onExpandAllClick() {
120
+ this.expandAllClick.emit();
121
+ }
122
+ onSelectAllClick() {
123
+ this.selectAllClick.emit();
124
+ }
125
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTreeViewToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
126
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyTreeViewToolbarComponent, selector: "sky-angular-tree-toolbar", inputs: { showSelectButtons: "showSelectButtons" }, outputs: { clearAllClick: "clearAllClick", collapseAllClick: "collapseAllClick", expandAllClick: "expandAllClick", selectAllClick: "selectAllClick" }, ngImport: i0, template: "<div class=\"sky-angular-tree-toolbar\" role=\"toolbar\">\n <sky-toolbar>\n <sky-toolbar-item *ngIf=\"showSelectButtons\">\n <button\n class=\"sky-btn sky-btn-link sky-angular-tree-select-all-btn\"\n type=\"button\"\n (click)=\"onSelectAllClick()\"\n >\n {{ 'skyux_angular_tree_select_all' | skyLibResources }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-item *ngIf=\"showSelectButtons\">\n <button\n class=\"sky-btn sky-btn-link sky-angular-tree-clear-all-btn\"\n type=\"button\"\n (click)=\"onClearAllClick()\"\n >\n {{ 'skyux_angular_tree_clear_all' | skyLibResources }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <button\n class=\"sky-btn sky-btn-default sky-margin-inline-default sky-angular-tree-expand-all-btn\"\n title=\"{{ 'skyux_angular_tree_expand_all' | skyLibResources }}\"\n type=\"button\"\n (click)=\"onExpandAllClick()\"\n >\n <sky-icon icon=\"angle-double-down\"> </sky-icon>\n </button>\n <button\n class=\"sky-btn sky-btn-default sky-margin-inline-default sky-angular-tree-collapse-all-btn\"\n title=\"{{ 'skyux_angular_tree_collapse_all' | skyLibResources }}\"\n type=\"button\"\n (click)=\"onCollapseAllClick()\"\n >\n <sky-icon icon=\"angle-double-up\"> </sky-icon>\n </button>\n </sky-toolbar-view-actions>\n </sky-toolbar>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { kind: "component", type: i3.λ37, selector: "sky-toolbar" }, { kind: "component", type: i3.λ39, selector: "sky-toolbar-item" }, { kind: "component", type: i3.λ40, selector: "sky-toolbar-view-actions" }, { kind: "pipe", type: i4.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
127
+ }
128
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTreeViewToolbarComponent, decorators: [{
129
+ type: Component,
130
+ args: [{ selector: 'sky-angular-tree-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sky-angular-tree-toolbar\" role=\"toolbar\">\n <sky-toolbar>\n <sky-toolbar-item *ngIf=\"showSelectButtons\">\n <button\n class=\"sky-btn sky-btn-link sky-angular-tree-select-all-btn\"\n type=\"button\"\n (click)=\"onSelectAllClick()\"\n >\n {{ 'skyux_angular_tree_select_all' | skyLibResources }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-item *ngIf=\"showSelectButtons\">\n <button\n class=\"sky-btn sky-btn-link sky-angular-tree-clear-all-btn\"\n type=\"button\"\n (click)=\"onClearAllClick()\"\n >\n {{ 'skyux_angular_tree_clear_all' | skyLibResources }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <button\n class=\"sky-btn sky-btn-default sky-margin-inline-default sky-angular-tree-expand-all-btn\"\n title=\"{{ 'skyux_angular_tree_expand_all' | skyLibResources }}\"\n type=\"button\"\n (click)=\"onExpandAllClick()\"\n >\n <sky-icon icon=\"angle-double-down\"> </sky-icon>\n </button>\n <button\n class=\"sky-btn sky-btn-default sky-margin-inline-default sky-angular-tree-collapse-all-btn\"\n title=\"{{ 'skyux_angular_tree_collapse_all' | skyLibResources }}\"\n type=\"button\"\n (click)=\"onCollapseAllClick()\"\n >\n <sky-icon icon=\"angle-double-up\"> </sky-icon>\n </button>\n </sky-toolbar-view-actions>\n </sky-toolbar>\n</div>\n" }]
131
+ }], propDecorators: { showSelectButtons: [{
132
+ type: Input
133
+ }], clearAllClick: [{
134
+ type: Output
135
+ }], collapseAllClick: [{
136
+ type: Output
137
+ }], expandAllClick: [{
138
+ type: Output
139
+ }], selectAllClick: [{
140
+ type: Output
141
+ }] } });
142
+
143
+ /**
144
+ * Wraps the Angular `tree-root` component as part of the `SkyAngularTreeModule` that provides
145
+ * SKY UX components and styles to complement the `angular-tree-component` library and apply SKY UX
146
+ * themes and functionality to hierarchical list views. For information about the `tree-root` component, see the
147
+ * [Angular tree component documentation](https://angular2-tree.readme.io/docs).
148
+ */
149
+ class SkyAngularTreeWrapperComponent {
150
+ constructor() {
151
+ /**
152
+ * Whether to render the tree view in read-only mode.
153
+ * This mode disables selected and active states on the tree view nodes.
154
+ * @default false
155
+ */
156
+ this.readOnly = false;
157
+ /**
158
+ * Whether to use leaf-only selection mode. For tree views with
159
+ * [checkboxes](https://angular2-tree.readme.io/docs/tri-state-checkboxes),
160
+ * this mode limits user selections to leaf nodes and prevents users from selecting parent nodes.
161
+ * @default false
162
+ */
163
+ this.selectLeafNodesOnly = false;
164
+ /**
165
+ * Whether to use single-select mode. For tree views with
166
+ * [checkboxes](https://angular2-tree.readme.io/docs/tri-state-checkboxes),
167
+ * this mode limits user selections to one node at a time.
168
+ * @default false
169
+ */
170
+ this.selectSingle = false;
171
+ /**
172
+ * Whether to display a toolbar with buttons to expand and collapse all nodes and buttons to select and clear all checkboxes.
173
+ * The select and clear buttons only appear when you enable checkboxes.
174
+ * To enable [checkboxes](https://angular2-tree.readme.io/docs/tri-state-checkboxes).
175
+ * @default false
176
+ */
177
+ this.showToolbar = false;
178
+ this.selectableNodeIds = {};
179
+ }
180
+ ngAfterViewInit() {
181
+ if (this.selectSingle &&
182
+ this.treeComponent?.treeModel.options.useTriState) {
183
+ console.warn('Single select mode should not be enabled while the tree is in triState mode (cascading selection). ' +
184
+ 'Please set "useTriState" to "false" if you want to remain in single select mode.');
185
+ }
186
+ this.#overrideActionMapping();
187
+ }
188
+ multiselectable() {
189
+ return (!!this.treeComponent &&
190
+ this.treeComponent.treeModel.options.useCheckbox &&
191
+ !this.selectSingle);
192
+ }
193
+ onClearAllClick() {
194
+ /* istanbul ignore else */
195
+ if (!this.selectSingle && this.treeComponent) {
196
+ const currentState = this.treeComponent.treeModel.getState();
197
+ this.treeComponent.state = {
198
+ ...currentState,
199
+ selectedLeafNodeIds: {},
200
+ };
201
+ }
202
+ }
203
+ onCollapseAllClick() {
204
+ this.treeComponent?.treeModel.collapseAll();
205
+ }
206
+ onExpandAllClick() {
207
+ this.treeComponent?.treeModel.expandAll();
208
+ }
209
+ onSelectAllClick() {
210
+ /* istanbul ignore else */
211
+ if (!this.selectSingle && this.treeComponent) {
212
+ // Get a list of all node ids that are selectable.
213
+ this.selectableNodeIds = {};
214
+ const getSelectableNodeIds = (node) => {
215
+ const selectable = node.isSelectable() &&
216
+ !(node.hasChildren && this.selectLeafNodesOnly);
217
+ if (selectable && !node.data.virtual) {
218
+ this.selectableNodeIds[node.id] = true;
219
+ }
220
+ if (!node.children) {
221
+ return;
222
+ }
223
+ node.children.forEach((child) => getSelectableNodeIds(child));
224
+ };
225
+ getSelectableNodeIds(this.treeComponent.treeModel.virtualRoot);
226
+ // Update tree state with new list of selected node ids.
227
+ const currentState = this.treeComponent.treeModel.getState();
228
+ this.treeComponent.state = {
229
+ ...currentState,
230
+ selectedLeafNodeIds: this.selectableNodeIds,
231
+ };
232
+ }
233
+ }
234
+ showSelectButtons() {
235
+ return (!!this.treeComponent &&
236
+ this.treeComponent.treeModel.options.useCheckbox &&
237
+ !this.selectSingle);
238
+ }
239
+ #isSelectable(node) {
240
+ return node.isLeaf || !node.hasChildren || !this.selectLeafNodesOnly;
241
+ }
242
+ #nodeDefaultAction(tree, node, event) {
243
+ if (this.readOnly) {
244
+ return;
245
+ }
246
+ if (node.options.useCheckbox && this.#isSelectable(node)) {
247
+ this.#toggleSelected(node, event);
248
+ }
249
+ else {
250
+ TREE_ACTIONS.TOGGLE_ACTIVE(tree, node, event);
251
+ }
252
+ return;
253
+ }
254
+ #onKeyDownAction(tree, node, event) {
255
+ const targetNodeId = event.target.getAttribute('data-node-id');
256
+ // Key press did not happen on the node.
257
+ if (targetNodeId !== node.id.toString()) {
258
+ // angular-tree-component will preventDefault() on anything using a key action handler,
259
+ // thus stopping "enter" and "space" keys to throw "click" events on interactive elements.
260
+ // This logic ensures components looking for "clicks" on those keystrokes still work (dropdown component).
261
+ // https://github.com/500tech/angular-tree-component/blob/master/lib/models/tree.model.ts#L341
262
+ /* istanbul ignore else */
263
+ if (event.defaultPrevented) {
264
+ event.target.click();
265
+ }
266
+ return;
267
+ }
268
+ this.#nodeDefaultAction(tree, node, event);
269
+ }
270
+ #overrideActionMapping() {
271
+ const defaultActionMapping = this.treeComponent?.treeModel.options.actionMapping;
272
+ if (defaultActionMapping?.mouse) {
273
+ // Override default click/enter/space action to check for unsupported options (leaf node, single-select).
274
+ defaultActionMapping.mouse.click = (tree, node, event) => this.#nodeDefaultAction(tree, node, event);
275
+ }
276
+ if (defaultActionMapping?.keys) {
277
+ defaultActionMapping.keys[KEYS.SPACE] = (tree, node, event) => this.#onKeyDownAction(tree, node, event);
278
+ defaultActionMapping.keys[KEYS.ENTER] = (tree, node, event) => this.#onKeyDownAction(tree, node, event);
279
+ // Disable left/right arrow keys to support navigating through interactive elements with keyboard.
280
+ // See onArrowLeft() / onArrowRight() methods inside the angular-tree-node.component.ts.
281
+ /* istanbul ignore next */
282
+ defaultActionMapping.keys[KEYS.RIGHT] = (tree, node, $event) => undefined;
283
+ /* istanbul ignore next */
284
+ defaultActionMapping.keys[KEYS.LEFT] = (tree, node, $event) => undefined;
285
+ /* istanbul ignore next */
286
+ defaultActionMapping.keys[KEYS.DOWN] = (tree, node, $event) => undefined;
287
+ /* istanbul ignore next */
288
+ defaultActionMapping.keys[KEYS.UP] = (tree, node, $event) => undefined;
289
+ }
290
+ }
291
+ #toggleSelected(node, event) {
292
+ // If single-selection is enabled, only select the node clicked.
293
+ if (this.selectSingle && !node.isSelected) {
294
+ const oldState = this.treeComponent?.treeModel.getState();
295
+ const newState = {
296
+ expandedNodeIds: oldState?.expandedNodeIds,
297
+ selectedLeafNodeIds: Object.assign({}, node.id, { [node.id]: true }),
298
+ activeNodeIds: oldState?.activeNodeIds,
299
+ hiddenNodeIds: oldState?.hiddenNodeIds,
300
+ focusedNodeId: node.id,
301
+ };
302
+ // Reconstruct the state in one go, so we don't create multiple events for the consumer.
303
+ this.treeComponent?.treeModel.setState(newState);
304
+ }
305
+ else {
306
+ TREE_ACTIONS.TOGGLE_SELECTED(node.treeModel, node, event);
307
+ }
308
+ }
309
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
310
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyAngularTreeWrapperComponent, selector: "sky-angular-tree-wrapper", inputs: { readOnly: "readOnly", selectLeafNodesOnly: "selectLeafNodesOnly", selectSingle: "selectSingle", showToolbar: "showToolbar" }, queries: [{ propertyName: "treeComponent", first: true, predicate: TreeComponent, descendants: true }], ngImport: i0, template: "<div\n class=\"sky-angular-tree-wrapper\"\n [class.sky-angular-tree-read-only]=\"readOnly\"\n>\n <sky-angular-tree-toolbar\n *ngIf=\"showToolbar\"\n [showSelectButtons]=\"showSelectButtons()\"\n (clearAllClick)=\"onClearAllClick()\"\n (collapseAllClick)=\"onCollapseAllClick()\"\n (expandAllClick)=\"onExpandAllClick()\"\n (selectAllClick)=\"onSelectAllClick()\"\n >\n </sky-angular-tree-toolbar>\n <div\n class=\"sky-angular-tree-root\"\n role=\"tree\"\n [attr.aria-multiselectable]=\"multiselectable()\"\n >\n <ng-content select=\"tree-root\"></ng-content>\n </div>\n</div>\n", styles: [".sky-angular-tree-wrapper ::ng-deep .angular-tree-component{cursor:initial;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.sky-angular-tree-wrapper ::ng-deep .node-wrapper{display:flex;align-items:center;padding:4px 5px;border-left:4px solid transparent}.sky-angular-tree-wrapper ::ng-deep .node-content-wrapper{display:flex;align-items:center;padding:0;cursor:pointer}.sky-angular-tree-wrapper ::ng-deep .tree-children{padding-left:30px;overflow:hidden}.sky-angular-tree-wrapper ::ng-deep .sky-toggle-children{color:#cdcfd2;cursor:pointer;min-height:19px;min-width:20px;margin:0 10px 0 0;padding:0;line-height:1}.sky-angular-tree-wrapper ::ng-deep .sky-toggle-children:hover{color:#979ba2;transition:color .15s}.sky-angular-tree-wrapper ::ng-deep .toggle-children-placeholder{display:inline-block;height:19px;width:20px;margin:0 10px 0 0}.sky-angular-tree-wrapper ::ng-deep .sky-angular-tree-node-selected{background:#f1eef6}.sky-angular-tree-wrapper ::ng-deep .sky-angular-tree-node-active{background-color:#eeeeef;color:#212327;border-left:4px solid #00b4f1}.sky-angular-tree-wrapper ::ng-deep sky-checkbox{display:inline-flex}.sky-angular-tree-wrapper ::ng-deep .sky-switch-control{margin:0 8px 0 0}.sky-angular-tree-wrapper ::ng-deep .sky-angular-tree-context-menu{margin:0 10px 0 0}.sky-angular-tree-wrapper ::ng-deep .node-drop-slot{display:block;height:2px}.sky-angular-tree-wrapper ::ng-deep .node-drop-slot.is-dragging-over{height:20px;background:#eeeeef;border:1px solid #e2e3e4}.sky-angular-tree-wrapper.sky-angular-tree-read-only ::ng-deep .node-content-wrapper{cursor:initial}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SkyTreeViewToolbarComponent, selector: "sky-angular-tree-toolbar", inputs: ["showSelectButtons"], outputs: ["clearAllClick", "collapseAllClick", "expandAllClick", "selectAllClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
311
+ }
312
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeWrapperComponent, decorators: [{
313
+ type: Component,
314
+ args: [{ selector: 'sky-angular-tree-wrapper', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"sky-angular-tree-wrapper\"\n [class.sky-angular-tree-read-only]=\"readOnly\"\n>\n <sky-angular-tree-toolbar\n *ngIf=\"showToolbar\"\n [showSelectButtons]=\"showSelectButtons()\"\n (clearAllClick)=\"onClearAllClick()\"\n (collapseAllClick)=\"onCollapseAllClick()\"\n (expandAllClick)=\"onExpandAllClick()\"\n (selectAllClick)=\"onSelectAllClick()\"\n >\n </sky-angular-tree-toolbar>\n <div\n class=\"sky-angular-tree-root\"\n role=\"tree\"\n [attr.aria-multiselectable]=\"multiselectable()\"\n >\n <ng-content select=\"tree-root\"></ng-content>\n </div>\n</div>\n", styles: [".sky-angular-tree-wrapper ::ng-deep .angular-tree-component{cursor:initial;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.sky-angular-tree-wrapper ::ng-deep .node-wrapper{display:flex;align-items:center;padding:4px 5px;border-left:4px solid transparent}.sky-angular-tree-wrapper ::ng-deep .node-content-wrapper{display:flex;align-items:center;padding:0;cursor:pointer}.sky-angular-tree-wrapper ::ng-deep .tree-children{padding-left:30px;overflow:hidden}.sky-angular-tree-wrapper ::ng-deep .sky-toggle-children{color:#cdcfd2;cursor:pointer;min-height:19px;min-width:20px;margin:0 10px 0 0;padding:0;line-height:1}.sky-angular-tree-wrapper ::ng-deep .sky-toggle-children:hover{color:#979ba2;transition:color .15s}.sky-angular-tree-wrapper ::ng-deep .toggle-children-placeholder{display:inline-block;height:19px;width:20px;margin:0 10px 0 0}.sky-angular-tree-wrapper ::ng-deep .sky-angular-tree-node-selected{background:#f1eef6}.sky-angular-tree-wrapper ::ng-deep .sky-angular-tree-node-active{background-color:#eeeeef;color:#212327;border-left:4px solid #00b4f1}.sky-angular-tree-wrapper ::ng-deep sky-checkbox{display:inline-flex}.sky-angular-tree-wrapper ::ng-deep .sky-switch-control{margin:0 8px 0 0}.sky-angular-tree-wrapper ::ng-deep .sky-angular-tree-context-menu{margin:0 10px 0 0}.sky-angular-tree-wrapper ::ng-deep .node-drop-slot{display:block;height:2px}.sky-angular-tree-wrapper ::ng-deep .node-drop-slot.is-dragging-over{height:20px;background:#eeeeef;border:1px solid #e2e3e4}.sky-angular-tree-wrapper.sky-angular-tree-read-only ::ng-deep .node-content-wrapper{cursor:initial}\n"] }]
315
+ }], propDecorators: { readOnly: [{
316
+ type: Input
317
+ }], selectLeafNodesOnly: [{
318
+ type: Input
319
+ }], selectSingle: [{
320
+ type: Input
321
+ }], showToolbar: [{
322
+ type: Input
323
+ }], treeComponent: [{
324
+ type: ContentChild,
325
+ args: [TreeComponent]
326
+ }] } });
327
+
328
+ /**
329
+ * Replaces the default tree node template with a SKY UX node as part of the `SkyAngularTreeModule` that
330
+ * provides SKY UX components and styles to complement the `angular-tree-component` library and apply SKY UX
331
+ * themes and functionality to hierarchical list views. You must wrap this component in an `ng-template`
332
+ * tag with the template reference variable `#treeNodeFullTemplate`. For information about tree node templates,
333
+ * see the [Angular tree component documentation](https://angular2-tree.readme.io/docs/templates).
334
+ * To display context menus with actions for individual items in hierarchical lists, place
335
+ * [dropdowns](https://developer.blackbaud.com/skyux-popovers/docs/dropdown?docs-active-tab=design) inside the
336
+ * Angular tree node component, which automatically handles styling and positioning for context menus.
337
+ */
338
+ class SkyAngularTreeNodeComponent {
339
+ set childFocusIndex(value) {
340
+ if (value !== this.#_childFocusIndex) {
341
+ this.#_childFocusIndex = value;
342
+ if (this.#focusableChildren.length > 0 && value !== undefined) {
343
+ this.#focusableChildren[value].focus();
344
+ }
345
+ else {
346
+ this.nodeContentWrapperRef?.nativeElement.focus();
347
+ }
348
+ }
349
+ }
350
+ get childFocusIndex() {
351
+ return this.#_childFocusIndex;
352
+ }
353
+ set focused(value) {
354
+ this.tabIndex = value ? 0 : -1;
355
+ if (value) {
356
+ this.nodeContentWrapperRef?.nativeElement.focus();
357
+ }
358
+ }
359
+ set isPartiallySelected(value) {
360
+ if (value !== this.#_isPartiallySelected) {
361
+ this.#_isPartiallySelected = value;
362
+ this.#changeDetectorRef.markForCheck();
363
+ }
364
+ }
365
+ get isPartiallySelected() {
366
+ return this.#_isPartiallySelected;
367
+ }
368
+ set isSelected(value) {
369
+ if (value !== this.#_isSelected) {
370
+ this.#_isSelected = value;
371
+ this.#changeDetectorRef.markForCheck();
372
+ }
373
+ }
374
+ get isSelected() {
375
+ return this.#_isSelected;
376
+ }
377
+ set tabIndex(value) {
378
+ this.#_tabIndex = value;
379
+ }
380
+ get tabIndex() {
381
+ return this.#_tabIndex;
382
+ }
383
+ #focusableChildren = [];
384
+ #mouseDown = false;
385
+ #_childFocusIndex;
386
+ #_isPartiallySelected = false;
387
+ #_isSelected = false;
388
+ #_tabIndex = -1;
389
+ #changeDetectorRef;
390
+ #adapterService;
391
+ #skyAngularTreeWrapper;
392
+ constructor(changeDetectorRef, adapterService, skyAngularTreeWrapper) {
393
+ this.#changeDetectorRef = changeDetectorRef;
394
+ this.#adapterService = adapterService;
395
+ this.#skyAngularTreeWrapper = skyAngularTreeWrapper;
396
+ }
397
+ ngOnInit() {
398
+ if (!this.#skyAngularTreeWrapper) {
399
+ console.error(`<sky-angular-tree-node-wrapper> must be wrapped inside a <sky-angular-tree-wrapper> component.`);
400
+ }
401
+ if (this.node) {
402
+ // Because we're binding the checkbox to node's children properties, we need to manually control change detection.
403
+ // Here, we listen to the tree's state and force change detection in the setters if the value has changed.
404
+ this.node.treeModel.subscribeToState((state) => {
405
+ if (this.node) {
406
+ this.isSelected = this.node.isSelected;
407
+ this.isPartiallySelected = this.node.isPartiallySelected;
408
+ if (state.focusedNodeId) {
409
+ this.focused = state.focusedNodeId === this.node.id;
410
+ }
411
+ }
412
+ });
413
+ // Make the first root node tabbable.
414
+ if (this.node.isRoot && this.node.index === 0) {
415
+ this.tabIndex = 0;
416
+ }
417
+ }
418
+ }
419
+ ngAfterViewInit() {
420
+ // Wait 1s for the node to render, then reset all child tabIndexes to -1.
421
+ // Units smaller than 1s may consistently fail if there are many nodes, or multiple trees are on the same screen.
422
+ setTimeout(() => {
423
+ if (this.nodeContentWrapperRef) {
424
+ this.#focusableChildren = this.#adapterService.getFocusableChildren(this.nodeContentWrapperRef.nativeElement);
425
+ this.#adapterService.setTabIndexOfFocusableEls(this.nodeContentWrapperRef.nativeElement, -1);
426
+ }
427
+ }, 1000);
428
+ }
429
+ /**
430
+ * If single-select, set aria-selected=true for the selected node and undefined for all the others.
431
+ * For multiple-select, set aria-selected to either true or false.
432
+ * If node cannot be selected, aria-selected should be undefined (e.g. parent nodes in leaf-select-only mode).
433
+ * @internal
434
+ */
435
+ ariaSelected() {
436
+ if (!this.#skyAngularTreeWrapper) {
437
+ return;
438
+ }
439
+ if (this.#skyAngularTreeWrapper.selectSingle) {
440
+ return this.isSelected ? true : undefined;
441
+ }
442
+ if (!this.#isSelectable()) {
443
+ return;
444
+ }
445
+ return !!this.isSelected;
446
+ }
447
+ showCheckbox() {
448
+ // Check for checkbox mode enabled, but also respect leaf-node and single-select settings.
449
+ return (!!this.node &&
450
+ this.node.options.useCheckbox &&
451
+ this.#isSelectable() &&
452
+ (!this.#skyAngularTreeWrapper ||
453
+ !this.#skyAngularTreeWrapper.selectSingle));
454
+ }
455
+ showSelectedClass() {
456
+ return this.#isSelectable() && this.isSelected && !this.isPartiallySelected;
457
+ }
458
+ showActiveClass() {
459
+ return (!!this.node &&
460
+ this.node.isActive &&
461
+ !this.node.treeModel.options.useCheckbox);
462
+ }
463
+ showTogglePlaceholder() {
464
+ return (!this.node?.hasChildren &&
465
+ !this.#skyAngularTreeWrapper?.selectLeafNodesOnly);
466
+ }
467
+ onFocus() {
468
+ // <tree-node-content> has its own click handler, so we need to check if this focus event
469
+ // is coming from the mouse click or the keyboard to prevent the logic from running twice.
470
+ if (!this.#mouseDown) {
471
+ this.node?.treeModel.setFocus(true);
472
+ this.node?.focus();
473
+ this.childFocusIndex = undefined;
474
+ }
475
+ }
476
+ onMouseDown() {
477
+ this.#mouseDown = true;
478
+ }
479
+ onMouseUp() {
480
+ this.#mouseDown = false;
481
+ }
482
+ onKeyDown(event) {
483
+ /* istanbul ignore else */
484
+ if (document.activeElement === event.target) {
485
+ const key = event.key.toLowerCase();
486
+ switch (key) {
487
+ case 'up':
488
+ case 'arrowup':
489
+ // Focus on previous node.
490
+ this.node?.treeModel.focusPreviousNode();
491
+ break;
492
+ case 'down':
493
+ case 'arrowdown':
494
+ // Focus on next node.
495
+ this.node?.treeModel.focusNextNode();
496
+ break;
497
+ case 'left':
498
+ case 'arrowleft':
499
+ // Cycle backwards through interactive child elements
500
+ // If user reaches the beginning, activate drill up.
501
+ /* istanbul ignore else */
502
+ if (this.childFocusIndex !== undefined) {
503
+ if (this.childFocusIndex === 0) {
504
+ this.childFocusIndex = undefined;
505
+ }
506
+ else {
507
+ this.childFocusIndex--;
508
+ }
509
+ }
510
+ else {
511
+ this.node?.setIsExpanded(false);
512
+ }
513
+ event.stopPropagation();
514
+ event.preventDefault();
515
+ break;
516
+ case 'right':
517
+ case 'arrowright':
518
+ // Cycle forward through interactive child elements.
519
+ // If user reaches the end, activate drill down.
520
+ /* istanbul ignore else */
521
+ if (this.#focusableChildren.length <= 0 ||
522
+ this.childFocusIndex === this.#focusableChildren.length - 1) {
523
+ this.node?.setIsExpanded(true);
524
+ }
525
+ else {
526
+ if (this.childFocusIndex === undefined) {
527
+ this.childFocusIndex = 0;
528
+ }
529
+ else {
530
+ this.childFocusIndex++;
531
+ }
532
+ }
533
+ event.stopPropagation();
534
+ event.preventDefault();
535
+ break;
536
+ default:
537
+ break;
538
+ }
539
+ }
540
+ }
541
+ #isSelectable() {
542
+ if (this.#skyAngularTreeWrapper) {
543
+ return (!!this.node &&
544
+ (this.node.isLeaf ||
545
+ !this.node.hasChildren ||
546
+ !this.#skyAngularTreeWrapper.selectLeafNodesOnly));
547
+ }
548
+ else {
549
+ return false;
550
+ }
551
+ }
552
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeNodeComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: SkyAngularTreeAdapterService }, { token: SkyAngularTreeWrapperComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
553
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyAngularTreeNodeComponent, selector: "sky-angular-tree-node", inputs: { index: "index", node: "node", templates: "templates" }, providers: [SkyAngularTreeAdapterService], viewQueries: [{ propertyName: "nodeContentWrapperRef", first: true, predicate: ["nodeContentWrapper"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div\n *ngIf=\"node && index !== undefined\"\n [class]=\"node.getClass()\"\n [class.tree-node]=\"true\"\n [class.tree-node-active]=\"node.isActive\"\n [class.tree-node-collapsed]=\"node.isCollapsed && node.hasChildren\"\n [class.tree-node-expanded]=\"node.isExpanded && node.hasChildren\"\n [class.tree-node-focused]=\"node.isFocused\"\n [class.tree-node-leaf]=\"node.isLeaf\"\n>\n <tree-node-drop-slot\n *ngIf=\"index === 0\"\n [dropIndex]=\"node.index\"\n [node]=\"node.parent\"\n >\n </tree-node-drop-slot>\n\n <!-- #region <tree-node-wrapper> custom template --->\n <div\n class=\"node-wrapper\"\n role=\"treeitem\"\n [allowDragoverStyling]=\"node.allowDragoverStyling()\"\n [attr.aria-current]=\"node.isActive\"\n [attr.aria-expanded]=\"node.children?.length ? node.isExpanded : null\"\n [attr.aria-selected]=\"ariaSelected()\"\n [attr.data-node-id]=\"node.id\"\n [attr.tabindex]=\"tabIndex\"\n [class.sky-angular-tree-node-active]=\"showActiveClass()\"\n [class.sky-angular-tree-node-selected]=\"showSelectedClass()\"\n [style.padding-left]=\"node.getNodePadding()\"\n [treeAllowDrop]=\"node.allowDrop\"\n [treeDrag]=\"node\"\n [treeDragEnabled]=\"node.allowDrag()\"\n (contextmenu)=\"node.mouseAction('contextMenu', $event)\"\n (dblclick)=\"node.mouseAction('dblClick', $event)\"\n (focus)=\"onFocus()\"\n (mousedown)=\"onMouseDown()\"\n (mouseup)=\"onMouseUp()\"\n (keydown)=\"onKeyDown($event)\"\n (treeDrop)=\"node.onDrop($event)\"\n (treeDropDragEnter)=\"node.mouseAction('dragEnter', $event)\"\n (treeDropDragLeave)=\"node.mouseAction('dragLeave', $event)\"\n (treeDropDragOver)=\"node.mouseAction('dragOver', $event)\"\n #nodeContentWrapper\n >\n <!-- #region <tree-node-expander> custom template --->\n <div class=\"sky-toggle-children-wrapper\">\n <button\n *ngIf=\"node.hasChildren\"\n class=\"sky-btn sky-btn-link sky-toggle-children\"\n tabindex=\"-1\"\n type=\"button\"\n [attr.aria-label]=\"\n 'skyux_angular_tree_click_to_expand' | skyLibResources\n \"\n [class.toggle-children-wrapper-expanded]=\"node.isExpanded\"\n [class.toggle-children-wrapper-collapsed]=\"node.isCollapsed\"\n (click)=\"node.mouseAction('expanderClick', $event)\"\n >\n <sky-icon\n [icon]=\"node.isExpanded ? 'chevron-down' : 'chevron-right'\"\n size=\"sm\"\n >\n </sky-icon>\n </button>\n <span *ngIf=\"showTogglePlaceholder()\" class=\"toggle-children-placeholder\">\n </span>\n </div>\n <!-- #endregion <tree-node-expander> --->\n\n <!-- Note: we've made changes to the click event, tabindex, and classes when compared to the original template. -->\n <!-- https://github.com/500tech/angular-tree-component/blob/master/lib/components/tree-node-wrapper.component.ts -->\n <div class=\"node-content-wrapper\">\n <sky-checkbox\n *ngIf=\"showCheckbox()\"\n [checked]=\"isSelected\"\n [id]=\"node.data.id\"\n [label]=\"node.data.name\"\n [indeterminate]=\"isPartiallySelected\"\n (change)=\"node.mouseAction('checkboxClick', $event)\"\n >\n </sky-checkbox>\n\n <sky-angular-tree-context-menu>\n <ng-content select=\"sky-dropdown\"></ng-content>\n </sky-angular-tree-context-menu>\n\n <tree-node-content\n [index]=\"index\"\n [node]=\"node\"\n [template]=\"templates?.treeNodeTemplate\"\n (click)=\"node.mouseAction('click', $event)\"\n >\n </tree-node-content\n ><span class=\"sky-control-help-container\"\n ><ng-content select=\".sky-control-help\"></ng-content\n ></span>\n </div>\n </div>\n\n <ng-container\n [ngTemplateOutlet]=\"templates?.treeNodeWrapperTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: node,\n node: node,\n index: index,\n templates: templates\n }\"\n >\n </ng-container>\n <!-- #endregion <tree-node-wrapper> -->\n\n <tree-node-children role=\"group\" [node]=\"node\" [templates]=\"templates\">\n </tree-node-children>\n\n <tree-node-drop-slot [dropIndex]=\"node.index + 1\" [node]=\"node.parent\">\n </tree-node-drop-slot>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i4$1.λ3, selector: "sky-checkbox", inputs: ["label", "labelledBy", "id", "disabled", "tabindex", "name", "icon", "checkboxType", "checked", "indeterminate", "required"], outputs: ["change", "checkedChange", "disabledChange", "indeterminateChange"] }, { kind: "component", type: i2.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { kind: "component", type: i6.TreeNodeContent, selector: "tree-node-content", inputs: ["node", "index", "template"] }, { kind: "directive", type: i6.TreeDropDirective, selector: "[treeDrop]", inputs: ["allowDragoverStyling", "treeAllowDrop"], outputs: ["treeDrop", "treeDropDragOver", "treeDropDragLeave", "treeDropDragEnter"] }, { kind: "directive", type: i6.TreeDragDirective, selector: "[treeDrag]", inputs: ["treeDrag", "treeDragEnabled"] }, { kind: "component", type: i6.TreeNodeChildrenComponent, selector: "tree-node-children", inputs: ["node", "templates"] }, { kind: "component", type: i6.TreeNodeDropSlot, selector: "TreeNodeDropSlot, tree-node-drop-slot", inputs: ["node", "dropIndex"] }, { kind: "component", type: SkyAngularTreeContextMenuComponent, selector: "sky-angular-tree-context-menu" }, { kind: "pipe", type: i4.SkyLibResourcesPipe, name: "skyLibResources" }] }); }
554
+ }
555
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeNodeComponent, decorators: [{
556
+ type: Component,
557
+ args: [{ selector: 'sky-angular-tree-node', providers: [SkyAngularTreeAdapterService], template: "<div\n *ngIf=\"node && index !== undefined\"\n [class]=\"node.getClass()\"\n [class.tree-node]=\"true\"\n [class.tree-node-active]=\"node.isActive\"\n [class.tree-node-collapsed]=\"node.isCollapsed && node.hasChildren\"\n [class.tree-node-expanded]=\"node.isExpanded && node.hasChildren\"\n [class.tree-node-focused]=\"node.isFocused\"\n [class.tree-node-leaf]=\"node.isLeaf\"\n>\n <tree-node-drop-slot\n *ngIf=\"index === 0\"\n [dropIndex]=\"node.index\"\n [node]=\"node.parent\"\n >\n </tree-node-drop-slot>\n\n <!-- #region <tree-node-wrapper> custom template --->\n <div\n class=\"node-wrapper\"\n role=\"treeitem\"\n [allowDragoverStyling]=\"node.allowDragoverStyling()\"\n [attr.aria-current]=\"node.isActive\"\n [attr.aria-expanded]=\"node.children?.length ? node.isExpanded : null\"\n [attr.aria-selected]=\"ariaSelected()\"\n [attr.data-node-id]=\"node.id\"\n [attr.tabindex]=\"tabIndex\"\n [class.sky-angular-tree-node-active]=\"showActiveClass()\"\n [class.sky-angular-tree-node-selected]=\"showSelectedClass()\"\n [style.padding-left]=\"node.getNodePadding()\"\n [treeAllowDrop]=\"node.allowDrop\"\n [treeDrag]=\"node\"\n [treeDragEnabled]=\"node.allowDrag()\"\n (contextmenu)=\"node.mouseAction('contextMenu', $event)\"\n (dblclick)=\"node.mouseAction('dblClick', $event)\"\n (focus)=\"onFocus()\"\n (mousedown)=\"onMouseDown()\"\n (mouseup)=\"onMouseUp()\"\n (keydown)=\"onKeyDown($event)\"\n (treeDrop)=\"node.onDrop($event)\"\n (treeDropDragEnter)=\"node.mouseAction('dragEnter', $event)\"\n (treeDropDragLeave)=\"node.mouseAction('dragLeave', $event)\"\n (treeDropDragOver)=\"node.mouseAction('dragOver', $event)\"\n #nodeContentWrapper\n >\n <!-- #region <tree-node-expander> custom template --->\n <div class=\"sky-toggle-children-wrapper\">\n <button\n *ngIf=\"node.hasChildren\"\n class=\"sky-btn sky-btn-link sky-toggle-children\"\n tabindex=\"-1\"\n type=\"button\"\n [attr.aria-label]=\"\n 'skyux_angular_tree_click_to_expand' | skyLibResources\n \"\n [class.toggle-children-wrapper-expanded]=\"node.isExpanded\"\n [class.toggle-children-wrapper-collapsed]=\"node.isCollapsed\"\n (click)=\"node.mouseAction('expanderClick', $event)\"\n >\n <sky-icon\n [icon]=\"node.isExpanded ? 'chevron-down' : 'chevron-right'\"\n size=\"sm\"\n >\n </sky-icon>\n </button>\n <span *ngIf=\"showTogglePlaceholder()\" class=\"toggle-children-placeholder\">\n </span>\n </div>\n <!-- #endregion <tree-node-expander> --->\n\n <!-- Note: we've made changes to the click event, tabindex, and classes when compared to the original template. -->\n <!-- https://github.com/500tech/angular-tree-component/blob/master/lib/components/tree-node-wrapper.component.ts -->\n <div class=\"node-content-wrapper\">\n <sky-checkbox\n *ngIf=\"showCheckbox()\"\n [checked]=\"isSelected\"\n [id]=\"node.data.id\"\n [label]=\"node.data.name\"\n [indeterminate]=\"isPartiallySelected\"\n (change)=\"node.mouseAction('checkboxClick', $event)\"\n >\n </sky-checkbox>\n\n <sky-angular-tree-context-menu>\n <ng-content select=\"sky-dropdown\"></ng-content>\n </sky-angular-tree-context-menu>\n\n <tree-node-content\n [index]=\"index\"\n [node]=\"node\"\n [template]=\"templates?.treeNodeTemplate\"\n (click)=\"node.mouseAction('click', $event)\"\n >\n </tree-node-content\n ><span class=\"sky-control-help-container\"\n ><ng-content select=\".sky-control-help\"></ng-content\n ></span>\n </div>\n </div>\n\n <ng-container\n [ngTemplateOutlet]=\"templates?.treeNodeWrapperTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: node,\n node: node,\n index: index,\n templates: templates\n }\"\n >\n </ng-container>\n <!-- #endregion <tree-node-wrapper> -->\n\n <tree-node-children role=\"group\" [node]=\"node\" [templates]=\"templates\">\n </tree-node-children>\n\n <tree-node-drop-slot [dropIndex]=\"node.index + 1\" [node]=\"node.parent\">\n </tree-node-drop-slot>\n</div>\n" }]
558
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: SkyAngularTreeAdapterService }, { type: SkyAngularTreeWrapperComponent, decorators: [{
559
+ type: Optional
560
+ }] }]; }, propDecorators: { index: [{
561
+ type: Input
562
+ }], node: [{
563
+ type: Input
564
+ }], templates: [{
565
+ type: Input
566
+ }], nodeContentWrapperRef: [{
567
+ type: ViewChild,
568
+ args: ['nodeContentWrapper', { read: ElementRef }]
569
+ }] } });
570
+
571
+ class SkyAngularTreeModule {
572
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
573
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeModule, declarations: [SkyAngularTreeContextMenuComponent,
574
+ SkyAngularTreeNodeComponent,
575
+ SkyAngularTreeWrapperComponent,
576
+ SkyTreeViewToolbarComponent], imports: [CommonModule,
577
+ SkyAngularTreeComponentResourcesModule,
578
+ SkyCheckboxModule,
579
+ SkyIconModule,
580
+ SkyToolbarModule,
581
+ TreeModule], exports: [SkyAngularTreeNodeComponent, SkyAngularTreeWrapperComponent] }); }
582
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeModule, providers: [SkyCoreAdapterService], imports: [CommonModule,
583
+ SkyAngularTreeComponentResourcesModule,
584
+ SkyCheckboxModule,
585
+ SkyIconModule,
586
+ SkyToolbarModule,
587
+ TreeModule] }); }
588
+ }
589
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyAngularTreeModule, decorators: [{
590
+ type: NgModule,
591
+ args: [{
592
+ declarations: [
593
+ SkyAngularTreeContextMenuComponent,
594
+ SkyAngularTreeNodeComponent,
595
+ SkyAngularTreeWrapperComponent,
596
+ SkyTreeViewToolbarComponent,
597
+ ],
598
+ imports: [
599
+ CommonModule,
600
+ SkyAngularTreeComponentResourcesModule,
601
+ SkyCheckboxModule,
602
+ SkyIconModule,
603
+ SkyToolbarModule,
604
+ TreeModule,
605
+ ],
606
+ providers: [SkyCoreAdapterService],
607
+ exports: [SkyAngularTreeNodeComponent, SkyAngularTreeWrapperComponent],
608
+ }]
609
+ }] });
610
+
611
+ /**
612
+ * Generated bundle index. Do not edit.
613
+ */
614
+
615
+ export { SkyAngularTreeModule, SkyAngularTreeWrapperComponent as λ1, SkyAngularTreeNodeComponent as λ2 };
616
+ //# sourceMappingURL=skyux-angular-tree-component.mjs.map