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