carbon-components-angular 5.38.2 → 5.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/documentation/components/TextareaLabelComponent.html +79 -5
- package/docs/documentation/components/TreeNodeComponent.html +94 -55
- package/docs/documentation/components/TreeViewComponent.html +240 -32
- package/docs/documentation/coverage.html +23 -11
- package/docs/documentation/injectables/TreeViewService.html +158 -11
- package/docs/documentation/interfaces/EventOnNode.html +343 -0
- package/docs/documentation/interfaces/Node.html +53 -1
- package/docs/documentation/js/menu-wc.js +3 -0
- package/docs/documentation/js/menu-wc_es5.js +1 -1
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/documentation/modules/ComboBoxModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ComboBoxModule.html +4 -4
- package/docs/documentation/modules/ContentSwitcherModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ContentSwitcherModule.html +4 -4
- package/docs/documentation/modules/DatePickerInputModule/dependencies.svg +41 -37
- package/docs/documentation/modules/DatePickerInputModule.html +41 -37
- package/docs/documentation/modules/DatePickerModule/dependencies.svg +38 -38
- package/docs/documentation/modules/DatePickerModule.html +38 -38
- package/docs/documentation/modules/GridModule/dependencies.svg +60 -60
- package/docs/documentation/modules/GridModule.html +60 -60
- package/docs/documentation/modules/LoadingModule/dependencies.svg +4 -4
- package/docs/documentation/modules/LoadingModule.html +4 -4
- package/docs/documentation/modules/NFormsModule/dependencies.svg +4 -4
- package/docs/documentation/modules/NFormsModule.html +4 -4
- package/docs/documentation/modules/NumberModule/dependencies.svg +4 -4
- package/docs/documentation/modules/NumberModule.html +4 -4
- package/docs/documentation/modules/ProgressIndicatorModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ProgressIndicatorModule.html +4 -4
- package/docs/documentation/modules/RadioModule/dependencies.svg +4 -4
- package/docs/documentation/modules/RadioModule.html +4 -4
- package/docs/documentation/modules/SelectModule/dependencies.svg +58 -58
- package/docs/documentation/modules/SelectModule.html +58 -58
- package/docs/documentation/modules/SliderModule/dependencies.svg +4 -4
- package/docs/documentation/modules/SliderModule.html +4 -4
- package/docs/documentation/modules/TableModule/dependencies.svg +216 -216
- package/docs/documentation/modules/TableModule.html +216 -216
- package/docs/documentation/modules/TabsModule/dependencies.svg +69 -69
- package/docs/documentation/modules/TabsModule.html +69 -69
- package/docs/documentation/modules/ThemeModule/dependencies.svg +13 -13
- package/docs/documentation/modules/ThemeModule.html +13 -13
- package/docs/documentation/modules/TilesModule/dependencies.svg +98 -98
- package/docs/documentation/modules/TilesModule.html +98 -98
- package/docs/documentation/modules/TimePickerModule/dependencies.svg +45 -41
- package/docs/documentation/modules/TimePickerModule.html +45 -41
- package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +46 -42
- package/docs/documentation/modules/TimePickerSelectModule.html +46 -42
- package/docs/documentation/modules/ToggleModule/dependencies.svg +41 -45
- package/docs/documentation/modules/ToggleModule.html +41 -45
- package/docs/documentation/modules/ToggletipModule/dependencies.svg +39 -39
- package/docs/documentation/modules/ToggletipModule.html +39 -39
- package/docs/documentation/modules/TooltipModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TooltipModule.html +4 -4
- package/docs/documentation/modules/TreeviewModule/dependencies.svg +36 -36
- package/docs/documentation/modules/TreeviewModule.html +36 -36
- package/docs/documentation/modules/UIShellModule/dependencies.svg +4 -4
- package/docs/documentation/modules/UIShellModule.html +4 -4
- package/docs/documentation/overview.html +1 -1
- package/docs/documentation.json +341 -110
- package/docs/storybook/{1345.9201efca.iframe.bundle.js → 1345.9eabf5e2.iframe.bundle.js} +1 -1
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/input-textarea-stories.1a3b5e80.iframe.bundle.js +1 -0
- package/docs/storybook/main.338bd361.iframe.bundle.js +1 -0
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/{runtime~main.b26c0bbe.iframe.bundle.js → runtime~main.16c5e56d.iframe.bundle.js} +1 -1
- package/docs/storybook/treeview-treeview-stories.fa77fc60.iframe.bundle.js +1 -0
- package/esm2020/input/textarea-label.component.mjs +8 -2
- package/esm2020/treeview/tree-node.component.mjs +23 -10
- package/esm2020/treeview/tree-node.types.mjs +1 -1
- package/esm2020/treeview/treeview.component.mjs +34 -8
- package/esm2020/treeview/treeview.service.mjs +10 -1
- package/fesm2015/carbon-components-angular-input.mjs +8 -1
- package/fesm2015/carbon-components-angular-input.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-treeview.mjs +75 -27
- package/fesm2015/carbon-components-angular-treeview.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-input.mjs +7 -1
- package/fesm2020/carbon-components-angular-input.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-treeview.mjs +64 -16
- package/fesm2020/carbon-components-angular-treeview.mjs.map +1 -1
- package/input/textarea-label.component.d.ts +1 -0
- package/package.json +1 -1
- package/treeview/tree-node.component.d.ts +7 -6
- package/treeview/tree-node.types.d.ts +5 -0
- package/treeview/treeview.component.d.ts +13 -2
- package/treeview/treeview.service.d.ts +7 -0
- package/docs/storybook/input-textarea-stories.51dab44c.iframe.bundle.js +0 -1
- package/docs/storybook/main.99dffacb.iframe.bundle.js +0 -1
- package/docs/storybook/treeview-treeview-stories.85954a19.iframe.bundle.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carbon-components-angular-treeview.mjs","sources":["../../src/treeview/treeview.service.ts","../../src/treeview/tree-node.component.ts","../../src/treeview/treeview.component.ts","../../src/treeview/treeview.module.ts","../../src/treeview/carbon-components-angular-treeview.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\nimport { Observable, ReplaySubject } from \"rxjs\";\nimport { Node } from \"./tree-node.types\";\n\n@Injectable()\nexport class TreeViewService {\n\tselectionObservable: Observable<any | any[]>;\n\t/**\n\t * Variable used across all nodes and wrapper to determine if we should allow content projection\n\t * or generate the tree\n\t *\n\t * Value is updated by passing a value to `tree` input in wrapper component.\n\t */\n\tcontentProjected = true;\n\t/**\n\t * **Experimental**\n\t */\n\tisMultiSelect = false;\n\n\tprivate selectionSubject = new ReplaySubject<Map<string, Node>>(1);\n\n\t/**\n\t * Hold's list of selected nodes and preserves order\n\t */\n\tprivate value = new Map();\n\n\tconstructor() {\n\t\tthis.selectionObservable = this.selectionSubject.asObservable();\n\t}\n\n\t/**\n\t * Store selected node in map\n\t * @param node: Node\n\t */\n\tselectNode(node: Node) {\n\t\tif (!node) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Since multiselect is not enabled, we clear existing map\n\t\tif (!this.isMultiSelect) {\n\t\t\tthis.value.clear();\n\t\t}\n\t\tthis.value.set(node.id, node);\n\t\tthis.selectionSubject.next(this.value);\n\t}\n\n\t/**\n\t * Removes selected node from the map\n\t * @param node: Node\n\t */\n\tdeselectNode(node: Node) {\n\t\tif (!node) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.value.delete(node.id);\n\t\tthis.selectionSubject.next(this.value);\n\t}\n\n\t/**\n\t * Removes all selected nodes from the map\n\t */\n\tdeselectAllNodes() {\n\t\tthis.value.clear();\n\t\tthis.selectionSubject.next(this.value);\n\t}\n}\n","import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tOnInit,\n\tOnDestroy,\n\tAfterContentInit,\n\tTemplateRef,\n\tAfterContentChecked\n} from \"@angular/core\";\nimport { Subscription } from \"rxjs\";\nimport { TreeViewService } from \"./treeview.service\";\nimport { Node } from \"./tree-node.types\";\n\n@Component({\n\tselector: \"cds-tree-node\",\n\ttemplate: `\n\t\t<div\n\t\t\t[id]=\"id\"\n\t\t\tclass=\"cds--tree-node\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--tree-node--active': active,\n\t\t\t\t'cds--tree-node--disabled': disabled,\n\t\t\t\t'cds--tree-node--selected': selected,\n\t\t\t\t'cds--tree-leaf-node': !children.length,\n\t\t\t\t'cds--tree-parent-node': children.length,\n\t\t\t\t'cds--tree-node--with-icon': icon\n\t\t\t}\"\n\t\t\t[attr.aria-expanded]=\"expanded || null\"\n\t\t\t[attr.aria-current]=\"active || null\"\n\t\t\t[attr.aria-selected]=\"disabled ? null : selected\"\n\t\t\t[attr.aria-disabled]=\"disabled\"\n\t\t\trole=\"treeitem\"\n\t\t\t[attr.tabindex]=\"selected ? 0 : -1\"\n\t\t\t(focus)=\"emitFocusEvent($event)\"\n\t\t\t(blur)=\"emitBlurEvent($event)\"\n\t\t\t(keydown)=\"navigateTree($event)\">\n\t\t\t<div\n\t\t\t\t*ngIf=\"!children.length\"\n\t\t\t\tclass=\"cds--tree-node__label\"\n\t\t\t\t[style.padding-inline-start.rem]=\"offset\"\n\t\t\t\t[style.margin-inline-start.rem]=\"-offset\"\n\t\t\t\t(click)=\"nodeClick($event)\">\n\t\t\t\t<!-- Icon -->\n\t\t\t\t<ng-container *ngIf=\"icon && !isTemplate(icon)\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclass=\"cds--tree-node__icon\"\n\t\t\t\t\t\t[cdsIcon]=\"icon\"\n\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(icon)\" [ngTemplateOutlet]=\"icon\"></ng-template>\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template\n\t\t\t\t\t*ngIf=\"isTemplate(label)\"\n\t\t\t\t\t[ngTemplateOutlet]=\"label\"\n\t\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t\t\t\t</ng-template>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t*ngIf=\"children.length\"\n\t\t\t\tclass=\"cds--tree-node__label\"\n\t\t\t\t[style.padding-inline-start.rem]=\"offset\"\n\t\t\t\t[style.margin-inline-start.rem]=\"-offset\"\n\t\t\t\trole=\"group\"\n\t\t\t\t(click)=\"nodeClick($event)\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"cds--tree-parent-node__toggle\"\n\t\t\t\t\t[attr.disabled]=\"disabled || null\"\n\t\t\t\t\t(click)=\"toggleExpanded($event)\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclass=\"cds--tree-parent-node__toggle-icon\"\n\t\t\t\t\t\t[ngClass]=\"{'cds--tree-parent-node__toggle-icon--expanded' : expanded}\"\n\t\t\t\t\t\tibmIcon=\"caret--down\"\n\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t</svg>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"cds--tree-node__label__details\">\n\t\t\t\t\t<!-- Icon -->\n\t\t\t\t\t<ng-container *ngIf=\"icon && !isTemplate(icon)\">\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\tclass=\"cds--tree-node__icon\"\n\t\t\t\t\t\t\t[cdsIcon]=\"icon\"\n\t\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</ng-container>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t*ngIf=\"isTemplate(icon)\"\n\t\t\t\t\t\t[ngTemplateOutlet]=\"icon\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: iconContext }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t*ngIf=\"isTemplate(label)\"\n\t\t\t\t\t\t[ngTemplateOutlet]=\"label\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t*ngIf=\"expanded\"\n\t\t\t\trole=\"group\"\n\t\t\t\tclass=\"cds--tree-node__children\">\n\t\t\t\t<ng-container *ngIf=\"isProjected(); else notProjected\">\n\t\t\t\t\t<ng-content></ng-content>\n\t\t\t\t</ng-container>\n\t\t\t\t<ng-template #notProjected>\n\t\t\t\t\t<cds-tree-node\n\t\t\t\t\t\t*ngFor=\"let childNode of children\"\n\t\t\t\t\t\t[node]=\"childNode\"\n\t\t\t\t\t\t[depth]=\"depth + 1\"\n\t\t\t\t\t\t[disabled]=\"disabled\">\n\t\t\t\t\t</cds-tree-node>\n\t\t\t\t</ng-template>\n\t\t\t</div>\n\t\t</div>\n\t`\n})\nexport class TreeNodeComponent implements AfterContentChecked, OnInit, OnDestroy {\n\tstatic treeNodeCount = 0;\n\t@Input() id = `tree-node-${TreeNodeComponent.treeNodeCount++}`;\n\t@Input() active = false;\n\t@Input() disabled = false;\n\t@Input() expanded = false;\n\t@Input() label: string | TemplateRef<any>;\n\t@Input() labelContext: any;\n\t@Input() selected = false;\n\t@Input() value;\n\t@Input() icon: string | TemplateRef<any>;\n\t@Input() iconContext: any;\n\t@Input() gap = 0;\n\t@Input() children: Node[] = [];\n\n\t/**\n\t * Determines the depth of the node\n\t * Calculated by default when passing `Node` array to `TreeViewComponent`, manual entry required otherwise\n\t */\n\t@Input() depth = 0;\n\n\t/**\n\t * Simple way to set all attributes of Node component via node object\n\t * Would simplify setting component attributes when dynamically rendering node.\n\t */\n\t@Input() set node(node: Node) {\n\t\tthis._node = node;\n\n\t\tthis.id = node.id ?? this.id;\n\t\tthis.active = node.active ?? this.active;\n\t\tthis.disabled = node.disabled ?? this.disabled;\n\t\tthis.expanded = node.expanded ?? this.expanded;\n\t\tthis.label = node.label ?? this.label;\n\t\tthis.labelContext = node.labelContext ?? this.labelContext;\n\t\tthis.value = node.value ?? this.value;\n\t\tthis.icon = node.icon ?? this.icon;\n\t\tthis.selected = node.selected ?? this.selected;\n\t\tthis.depth = node.depth ?? this.depth;\n\t\tthis.gap = node.gap ?? this.gap;\n\t\tthis.children = node.children ?? this.children;\n\t\tthis.iconContext = node.iconText ?? this.iconContext;\n\t}\n\n\tget node() {\n\t\treturn this._node;\n\t}\n\n\t@Output() nodeFocus = new EventEmitter();\n\t@Output() nodeBlur = new EventEmitter();\n\t@Output() nodeSelect = new EventEmitter();\n\t@Output() nodetoggle = new EventEmitter();\n\n\toffset;\n\tprivate _node;\n\tprivate subscription: Subscription;\n\n\tconstructor(private treeViewService: TreeViewService) {}\n\n\t/**\n\t * Caclulate offset for margin/padding\n\t */\n\tngAfterContentChecked(): void {\n\t\tthis.offset = this.calculateOffset();\n\t}\n\n\t/**\n\t * Highlight the node\n\t */\n\tngOnInit(): void {\n\t\t// Highlight the node\n\t\tthis.subscription = this.treeViewService.selectionObservable.subscribe((value: Map<string, Node>) => {\n\t\t\tthis.selected = value.has(this.id);\n\t\t\tthis.active = this.selected;\n\t\t});\n\t}\n\n\t/**\n\t * Unsubscribe from subscriptions\n\t */\n\tngOnDestroy(): void {\n\t\tthis.subscription?.unsubscribe();\n\t}\n\n\t/**\n\t * Selects the node and emits the event from the tree view component\n\t * @param event\n\t */\n\tnodeClick(event) {\n\t\tif (!this.disabled) {\n\t\t\tthis.selected = true;\n\t\t\tthis.active = true;\n\t\t\tevent.target.parentElement.focus();\n\t\t\t// Passes event to all nodes to update highlighting & parent to emit\n\t\t\tthis.treeViewService.selectNode({ id: this.id, label: this.label, value: this.value });\n\t\t}\n\t}\n\n\t/**\n\t * Calculate the node offset\n\t * @returns Number\n\t */\n\tcalculateOffset() {\n\t\t// Parent node with icon\n\t\tif (this.children.length && this.icon) {\n\t\t\treturn this.depth + 1 + this.depth * 0.5;\n\t\t}\n\n\t\t// parent node without icon\n\t\tif (this.children.length) {\n\t\t\treturn this.depth + 1;\n\t\t}\n\n\t\t// leaf node with icon\n\t\tif (this.icon) {\n\t\t\treturn this.depth + 2 + this.depth * 0.5;\n\t\t}\n\n\t\treturn this.depth + this.gap + 2.5;\n\t}\n\n\temitFocusEvent(event) {\n\t\tthis.nodeFocus.emit({ node: { id: this.id, label: this.label, value: this.value }, event });\n\t}\n\n\temitBlurEvent(event) {\n\t\tthis.nodeBlur.emit({ node: { id: this.id, label: this.label, value: this.value }, event });\n\t}\n\n\t/**\n\t * Expand children if not disabled\n\t * @param event: Event\n\t */\n\ttoggleExpanded(event) {\n\t\tif (!this.disabled) {\n\t\t\tthis.nodetoggle.emit({ node: { id: this.id, label: this.label, value: this.value }, event });\n\t\t\tthis.expanded = !this.expanded;\n\t\t\t// Prevent selection of the node\n\t\t\tevent.stopPropagation();\n\t\t}\n\t}\n\n\t/**\n\t * Manages the keyboard accessibility for children expansion & selection\n\t */\n\tnavigateTree(event: KeyboardEvent) {\n\t\tif (event.key === \"ArrowLeft\" || event.key === \"ArrowRight\" || event.key === \"Enter\") {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\t// Unexpand\n\t\tif (event.key === \"ArrowLeft\") {\n\t\t\tif (this.expanded && this.children) {\n\t\t\t\tthis.toggleExpanded(event);\n\t\t\t}\n\t\t}\n\n\t\tif (event.key === \"ArrowRight\") {\n\t\t\tif (!this.expanded && this.children) {\n\t\t\t\tthis.toggleExpanded(event);\n\t\t\t}\n\t\t}\n\n\t\tif (event.key === \"Enter\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.nodeClick(event);\n\t\t}\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\tpublic isProjected() {\n\t\treturn this.treeViewService.contentProjected;\n\t}\n}\n","import { DOCUMENT } from \"@angular/common\";\nimport {\n\tComponent,\n\tInput,\n\tOutput,\n\tTemplateRef,\n\tEventEmitter,\n\tAfterViewInit,\n\tInject,\n\tViewChild,\n\tElementRef,\n\tOnInit,\n\tOnDestroy\n} from \"@angular/core\";\nimport { Subscription } from \"rxjs\";\nimport { Node } from \"./tree-node.types\";\nimport { TreeViewService } from \"./treeview.service\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { TreeviewModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-tree-view--basic)\n */\n@Component({\n\tselector: \"cds-tree-view\",\n\ttemplate: `\n\t\t<label\n\t\t\t*ngIf=\"label\"\n\t\t\t[id]=\"id\"\n\t\t\tclass=\"cds--label\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t<ng-template\n\t\t\t\t*ngIf=\"isTemplate(label)\"\n\t\t\t\t[ngTemplateOutlet]=\"label\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t\t\t</ng-template>\n\t\t</label>\n\t\t<div\n\t\t\tclass=\"cds--tree\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--tree--sm': size === 'sm',\n\t\t\t\t'cds--tree--xs': size === 'xs'\n\t\t\t}\"\n\t\t\t[attr.aria-label]=\"label ? label : null\"\n\t\t\t[attr.aria-labelledby]=\"!label ? id : null\"\n\t\t\t[attr.aria-multiselectable]=\"isMultiSelect || null\"\n\t\t\trole=\"tree\"\n\t\t\t(keydown)=\"navigateTree($event)\"\n\t\t\t#treeWrapper>\n\t\t\t<ng-container *ngIf=\"isProjected(); else notProjected\">\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</ng-container>\n\t\t\t<ng-template #notProjected>\n\t\t\t\t<cds-tree-node\n\t\t\t\t\t*ngFor=\"let node of tree\"\n\t\t\t\t\t[node]=\"node\">\n\t\t\t\t</cds-tree-node>\n\t\t\t</ng-template>\n\t\t</div>\n\t`,\n\tproviders: [TreeViewService]\n})\nexport class TreeViewComponent implements AfterViewInit, OnInit, OnDestroy {\n\t/**\n\t * Pass `Node[]` array to have tree view render the nodes\n\t * Passing value will disregard projected content\n\t */\n\t@Input() set tree(treeNodes: Node[]) {\n\t\tthis._tree = treeNodes.map((node) => this.copyNode(node));\n\t\tthis.treeViewService.contentProjected = false;\n\t}\n\n\tget tree() {\n\t\treturn this._tree;\n\t}\n\n\tstatic treeViewCount = 0;\n\n\t@Input() id = `tree-view-${TreeViewComponent.treeViewCount++}`;\n\t/**\n\t * Tree view label\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Optional context for label if it's a template\n\t */\n\t@Input() labelContext: any;\n\t/**\n\t * Specify the size of the list items in the tree\n\t */\n\t@Input() size: \"xs\" | \"sm\" = \"sm\";\n\t/**\n\t * **Experimental** - Enable to select multiple nodes\n\t */\n\t@Input() set isMultiSelect(isMulti: boolean) {\n\t\tthis.treeViewService.isMultiSelect = isMulti;\n\t}\n\n\t@Output() select = new EventEmitter<Node | Node[]>();\n\t@ViewChild(\"treeWrapper\") root: ElementRef;\n\n\tprivate treeWalker: TreeWalker;\n\tprivate _tree: Node[] = [];\n\tprivate subscription: Subscription;\n\n\tconstructor(\n\t\t@Inject(DOCUMENT) private document: Document,\n\t\tpublic treeViewService: TreeViewService,\n\t\tprivate elementRef: ElementRef\n\t) {}\n\n\t/**\n\t * Subscribe for node selection\n\t */\n\tngOnInit(): void {\n\t\tthis.subscription = this.treeViewService.selectionObservable.subscribe((nodesMap: Map<string, Node>) => {\n\t\t\t// Get all values from the map to emit\n\t\t\tconst nodes = [...nodesMap.values()];\n\n\t\t\t// Update focus to reset arrow key traversal\n\t\t\t// Select the current highlight node as the last node, since we preserve order in map\n\t\t\tthis.treeWalker.currentNode = this.elementRef.nativeElement.querySelector(`#${CSS.escape(nodes[nodes.length - 1].id)}`);\n\t\t\tthis.select.emit(this.treeViewService.isMultiSelect ? nodes : nodes[0]);\n\t\t});\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.subscription.unsubscribe();\n\t}\n\n\t/**\n\t * Initialize tree walker to support keyboard navigation\n\t */\n\tngAfterViewInit(): void {\n\t\tthis.treeWalker = this.document.createTreeWalker(this.root.nativeElement, NodeFilter.SHOW_ELEMENT, {\n\t\t\tacceptNode: function (node: HTMLElement) {\n\t\t\t\tif (node.classList.contains(`cds--tree-node--disabled`)) {\n\t\t\t\t\treturn NodeFilter.FILTER_REJECT;\n\t\t\t\t}\n\t\t\t\tif (node.matches(`div.cds--tree-node`)) {\n\t\t\t\t\treturn NodeFilter.FILTER_ACCEPT;\n\t\t\t\t}\n\t\t\t\treturn NodeFilter.FILTER_SKIP;\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Navigate tree using tree walker\n\t * @param event - KeyboardEvent\n\t */\n\tnavigateTree(event: KeyboardEvent) {\n\t\tif (event.key === \"ArrowUp\") {\n\t\t\t(this.treeWalker.previousNode() as HTMLElement)?.focus();\n\t\t}\n\n\t\tif (event.key === \"ArrowDown\") {\n\t\t\t(this.treeWalker.nextNode() as HTMLElement)?.focus();\n\t\t}\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\tpublic isProjected() {\n\t\treturn this.treeViewService.contentProjected;\n\t}\n\n\tprivate copyNode(node: Node): Node {\n\t\t// making a recursive shallow copy to avoid performance issues when deeply cloning templateRefs if defined in the node\n\t\tconst copiedNode = Object.assign({}, node);\n\t\tif (node.children) {\n\t\t copiedNode.children = node.children.map(child => this.copyNode(child));\n\t\t}\n\t\treturn copiedNode;\n\t}\n}\n","import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\n\nimport { IconModule } from \"carbon-components-angular/icon\";\n\nimport { TreeViewComponent } from \"./treeview.component\";\nimport { TreeNodeComponent } from \"./tree-node.component\";\n\n@NgModule({\n\tdeclarations: [TreeViewComponent, TreeNodeComponent],\n\texports: [TreeViewComponent, TreeNodeComponent],\n\timports: [CommonModule, IconModule]\n})\nexport class TreeviewModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.TreeViewService","i3.TreeNodeComponent"],"mappings":";;;;;;;;MAKa,eAAe,CAAA;AAqB3B,IAAA,WAAA,GAAA;AAnBA;;;;;AAKG;QACH,IAAgB,CAAA,gBAAA,GAAG,IAAI,CAAC;AACxB;;AAEG;QACH,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC;AAEd,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,aAAa,CAAoB,CAAC,CAAC,CAAC;AAEnE;;AAEG;AACK,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC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O,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;AACnC,iBAAA,CAAA;;;ACZD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"carbon-components-angular-treeview.mjs","sources":["../../src/treeview/treeview.service.ts","../../src/treeview/tree-node.component.ts","../../src/treeview/treeview.component.ts","../../src/treeview/treeview.module.ts","../../src/treeview/carbon-components-angular-treeview.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\nimport { Observable, ReplaySubject } from \"rxjs\";\nimport { Node } from \"./tree-node.types\";\n\n@Injectable()\nexport class TreeViewService {\n\tselectionObservable: Observable<any | any[]>;\n\tfocusNodeObservable: Observable<Node>;\n\t/**\n\t * Variable used across all nodes and wrapper to determine if we should allow content projection\n\t * or generate the tree\n\t *\n\t * Value is updated by passing a value to `tree` input in wrapper component.\n\t */\n\tcontentProjected = true;\n\t/**\n\t * **Experimental**\n\t */\n\tisMultiSelect = false;\n\n\tprivate selectionSubject = new ReplaySubject<Map<string, Node>>(1);\n\tprivate focusNodeSubject = new ReplaySubject<Node>(1);\n\n\t/**\n\t * Hold's list of selected nodes and preserves order\n\t */\n\tprivate value = new Map();\n\n\tconstructor() {\n\t\tthis.selectionObservable = this.selectionSubject.asObservable();\n\t\tthis.focusNodeObservable = this.focusNodeSubject.asObservable();\n\t}\n\n\t/**\n\t * Emits the focused node\n\t * @param node: Node\n\t */\n\tfocusNode(node: Node) {\n\t\tthis.focusNodeSubject.next(node);\n\t}\n\n\t/**\n\t * Store selected node in map\n\t * @param node: Node\n\t */\n\tselectNode(node: Node) {\n\t\tif (!node) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Since multiselect is not enabled, we clear existing map\n\t\tif (!this.isMultiSelect) {\n\t\t\tthis.value.clear();\n\t\t}\n\t\tthis.value.set(node.id, node);\n\t\tthis.selectionSubject.next(this.value);\n\t}\n\n\t/**\n\t * Removes selected node from the map\n\t * @param node: Node\n\t */\n\tdeselectNode(node: Node) {\n\t\tif (!node) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.value.delete(node.id);\n\t\tthis.selectionSubject.next(this.value);\n\t}\n\n\t/**\n\t * Removes all selected nodes from the map\n\t */\n\tdeselectAllNodes() {\n\t\tthis.value.clear();\n\t\tthis.selectionSubject.next(this.value);\n\t}\n}\n","import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tOnInit,\n\tOnDestroy,\n\tAfterContentInit,\n\tTemplateRef,\n\tAfterContentChecked\n} from \"@angular/core\";\nimport { Subscription } from \"rxjs\";\nimport { TreeViewService } from \"./treeview.service\";\nimport { EventOnNode, Node } from \"./tree-node.types\";\n\n@Component({\n\tselector: \"cds-tree-node\",\n\ttemplate: `\n\t\t<div\n\t\t\t[id]=\"id\"\n\t\t\tclass=\"cds--tree-node\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--tree-node--active': active,\n\t\t\t\t'cds--tree-node--disabled': disabled,\n\t\t\t\t'cds--tree-node--selected': selected,\n\t\t\t\t'cds--tree-leaf-node': !children.length,\n\t\t\t\t'cds--tree-parent-node': children.length,\n\t\t\t\t'cds--tree-node--with-icon': icon\n\t\t\t}\"\n\t\t\t[attr.aria-expanded]=\"expanded || null\"\n\t\t\t[attr.aria-current]=\"active || null\"\n\t\t\t[attr.aria-selected]=\"disabled ? null : selected\"\n\t\t\t[attr.aria-disabled]=\"disabled\"\n\t\t\trole=\"treeitem\"\n\t\t\t[attr.tabindex]=\"selected ? 0 : -1\"\n\t\t\t(focus)=\"emitFocusEvent($event)\"\n\t\t\t(blur)=\"emitBlurEvent($event)\"\n\t\t\t(keydown)=\"navigateTree($event)\">\n\t\t\t<div\n\t\t\t\t*ngIf=\"!children.length\"\n\t\t\t\tclass=\"cds--tree-node__label\"\n\t\t\t\t[style.padding-inline-start.rem]=\"offset\"\n\t\t\t\t[style.margin-inline-start.rem]=\"-offset\"\n\t\t\t\t(click)=\"nodeClick($event)\">\n\t\t\t\t<!-- Icon -->\n\t\t\t\t<ng-container *ngIf=\"icon && !isTemplate(icon)\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclass=\"cds--tree-node__icon\"\n\t\t\t\t\t\t[cdsIcon]=\"icon\"\n\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(icon)\" [ngTemplateOutlet]=\"icon\"></ng-template>\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template\n\t\t\t\t\t*ngIf=\"isTemplate(label)\"\n\t\t\t\t\t[ngTemplateOutlet]=\"label\"\n\t\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t\t\t\t</ng-template>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t*ngIf=\"children.length\"\n\t\t\t\tclass=\"cds--tree-node__label\"\n\t\t\t\t[style.padding-inline-start.rem]=\"offset\"\n\t\t\t\t[style.margin-inline-start.rem]=\"-offset\"\n\t\t\t\trole=\"group\"\n\t\t\t\t(click)=\"nodeClick($event)\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"cds--tree-parent-node__toggle\"\n\t\t\t\t\t[attr.disabled]=\"disabled || null\"\n\t\t\t\t\t(click)=\"toggleExpanded($event)\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclass=\"cds--tree-parent-node__toggle-icon\"\n\t\t\t\t\t\t[ngClass]=\"{'cds--tree-parent-node__toggle-icon--expanded' : expanded}\"\n\t\t\t\t\t\tibmIcon=\"caret--down\"\n\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t</svg>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"cds--tree-node__label__details\">\n\t\t\t\t\t<!-- Icon -->\n\t\t\t\t\t<ng-container *ngIf=\"icon && !isTemplate(icon)\">\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\tclass=\"cds--tree-node__icon\"\n\t\t\t\t\t\t\t[cdsIcon]=\"icon\"\n\t\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</ng-container>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t*ngIf=\"isTemplate(icon)\"\n\t\t\t\t\t\t[ngTemplateOutlet]=\"icon\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: iconContext }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t*ngIf=\"isTemplate(label)\"\n\t\t\t\t\t\t[ngTemplateOutlet]=\"label\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t*ngIf=\"expanded\"\n\t\t\t\trole=\"group\"\n\t\t\t\tclass=\"cds--tree-node__children\">\n\t\t\t\t<ng-container *ngIf=\"isProjected(); else notProjected\">\n\t\t\t\t\t<ng-content></ng-content>\n\t\t\t\t</ng-container>\n\t\t\t\t<ng-template #notProjected>\n\t\t\t\t\t<cds-tree-node\n\t\t\t\t\t\t*ngFor=\"let childNode of children\"\n\t\t\t\t\t\t[node]=\"childNode\"\n\t\t\t\t\t\t[depth]=\"depth + 1\"\n\t\t\t\t\t\t[disabled]=\"disabled\">\n\t\t\t\t\t</cds-tree-node>\n\t\t\t\t</ng-template>\n\t\t\t</div>\n\t\t</div>\n\t`\n})\nexport class TreeNodeComponent implements AfterContentChecked, OnInit, OnDestroy {\n\tstatic treeNodeCount = 0;\n\t@Input() id = `tree-node-${TreeNodeComponent.treeNodeCount++}`;\n\t@Input() active = false;\n\t@Input() disabled = false;\n\t@Input() selectable = true;\n\t@Input() expanded = false;\n\t@Input() label: string | TemplateRef<any>;\n\t@Input() labelContext: any;\n\t@Input() selected = false;\n\t@Input() value;\n\t@Input() icon: string | TemplateRef<any>;\n\t@Input() iconContext: any;\n\t@Input() gap = 0;\n\t@Input() children: Node[] = [];\n\n\t/**\n\t * Determines the depth of the node\n\t * Calculated by default when passing `Node` array to `TreeViewComponent`, manual entry required otherwise\n\t */\n\t@Input() depth = 0;\n\n\t/**\n\t * Simple way to set all attributes of Node component via node object\n\t * Would simplify setting component attributes when dynamically rendering node.\n\t */\n\t@Input() set node(node: Node) {\n\t\tthis._node = node;\n\n\t\tthis.id = node.id ?? this.id;\n\t\tthis.active = node.active ?? this.active;\n\t\tthis.disabled = node.disabled ?? this.disabled;\n\t\tthis.selectable = node.selectable ?? this.selectable;\n\t\tthis.expanded = node.expanded ?? this.expanded;\n\t\tthis.label = node.label ?? this.label;\n\t\tthis.labelContext = node.labelContext ?? this.labelContext;\n\t\tthis.value = node.value ?? this.value;\n\t\tthis.icon = node.icon ?? this.icon;\n\t\tthis.selected = node.selected ?? this.selected;\n\t\tthis.depth = node.depth ?? this.depth;\n\t\tthis.gap = node.gap ?? this.gap;\n\t\tthis.children = node.children ?? this.children;\n\t\tthis.iconContext = node.iconText ?? this.iconContext;\n\t}\n\n\tget node() {\n\t\treturn this._node;\n\t}\n\n\t@Output() nodeFocus = new EventEmitter<EventOnNode>();\n\t@Output() nodeBlur = new EventEmitter<EventOnNode>();\n\t@Output() nodeSelect = new EventEmitter<Node>();\n\t@Output() nodetoggle = new EventEmitter<EventOnNode>();\n\n\toffset;\n\tprivate _node;\n\tprivate subscription: Subscription;\n\n\tconstructor(private treeViewService: TreeViewService) {}\n\n\t/**\n\t * Caclulate offset for margin/padding\n\t */\n\tngAfterContentChecked(): void {\n\t\tthis.offset = this.calculateOffset();\n\t}\n\n\t/**\n\t * Highlight the node\n\t */\n\tngOnInit(): void {\n\t\t// Highlight the node\n\t\tthis.subscription = this.treeViewService.selectionObservable.subscribe((value: Map<string, Node>) => {\n\t\t\tthis.selected = this.selectable && value.has(this.id);\n\t\t\tthis.active = this.selectable && this.selected;\n\t\t});\n\t}\n\n\t/**\n\t * Unsubscribe from subscriptions\n\t */\n\tngOnDestroy(): void {\n\t\tthis.subscription?.unsubscribe();\n\t}\n\n\t/**\n\t * Selects the node and emits the event from the tree view component\n\t * @param event\n\t */\n\tnodeClick(event) {\n\t\tif (!this.disabled) {\n\t\t\tevent.target.parentElement.focus();\n\t\t\tif (this.selectable || this.children.length === 0) {\n\t\t\t\tthis.selected = true;\n\t\t\t\tthis.active = true;\n\t\t\t\tconst node = { id: this.id, label: this.label, value: this.value };\n\t\t\t\t// Passes event to all nodes to update highlighting & parent to emit\n\t\t\t\tthis.treeViewService.selectNode(node);\n\t\t\t\tthis.nodeSelect.emit(node);\n\t\t\t} else {\n\t\t\t\tthis.toggleExpanded(event);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Calculate the node offset\n\t * @returns Number\n\t */\n\tcalculateOffset() {\n\t\t// Parent node with icon\n\t\tif (this.children.length && this.icon) {\n\t\t\treturn this.depth + 1 + this.depth * 0.5;\n\t\t}\n\n\t\t// parent node without icon\n\t\tif (this.children.length) {\n\t\t\treturn this.depth + 1;\n\t\t}\n\n\t\t// leaf node with icon\n\t\tif (this.icon) {\n\t\t\treturn this.depth + 2 + this.depth * 0.5;\n\t\t}\n\n\t\treturn this.depth + this.gap + 2.5;\n\t}\n\n\temitFocusEvent(event) {\n\t\tconst node = { id: this.id, label: this.label, value: this.value }\n\t\tthis.nodeFocus.emit({ node, event });\n\t\tthis.treeViewService.focusNode(node);\n\t}\n\n\temitBlurEvent(event) {\n\t\tthis.nodeBlur.emit({ node: { id: this.id, label: this.label, value: this.value }, event });\n\t}\n\n\t/**\n\t * Expand children if not disabled\n\t * @param event: Event\n\t */\n\ttoggleExpanded(event) {\n\t\tif (!this.disabled) {\n\t\t\tthis.nodetoggle.emit({ node: { id: this.id, label: this.label, value: this.value }, event });\n\t\t\tthis.expanded = !this.expanded;\n\t\t\t// Prevent selection of the node\n\t\t\tevent.stopPropagation();\n\t\t}\n\t}\n\n\t/**\n\t * Manages the keyboard accessibility for children expansion & selection\n\t */\n\tnavigateTree(event: KeyboardEvent) {\n\t\tif (event.key === \"ArrowLeft\" || event.key === \"ArrowRight\" || event.key === \"Enter\") {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\t// Unexpand\n\t\tif (event.key === \"ArrowLeft\") {\n\t\t\tif (this.expanded && this.children) {\n\t\t\t\tthis.toggleExpanded(event);\n\t\t\t}\n\t\t}\n\n\t\tif (event.key === \"ArrowRight\") {\n\t\t\tif (!this.expanded && this.children) {\n\t\t\t\tthis.toggleExpanded(event);\n\t\t\t}\n\t\t}\n\n\t\tif (event.key === \"Enter\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.nodeClick(event);\n\t\t}\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\tpublic isProjected() {\n\t\treturn this.treeViewService.contentProjected;\n\t}\n}\n","import { DOCUMENT } from \"@angular/common\";\nimport {\n\tComponent,\n\tInput,\n\tOutput,\n\tTemplateRef,\n\tEventEmitter,\n\tAfterViewInit,\n\tInject,\n\tViewChild,\n\tElementRef,\n\tOnInit,\n\tOnDestroy\n} from \"@angular/core\";\nimport { Subscription } from \"rxjs\";\nimport { EventOnNode, Node } from \"./tree-node.types\";\nimport { TreeViewService } from \"./treeview.service\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { TreeviewModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-tree-view--basic)\n */\n@Component({\n\tselector: \"cds-tree-view\",\n\ttemplate: `\n\t\t<label\n\t\t\t*ngIf=\"label\"\n\t\t\t[id]=\"id\"\n\t\t\tclass=\"cds--label\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t<ng-template\n\t\t\t\t*ngIf=\"isTemplate(label)\"\n\t\t\t\t[ngTemplateOutlet]=\"label\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t\t\t</ng-template>\n\t\t</label>\n\t\t<div\n\t\t\tclass=\"cds--tree\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--tree--sm': size === 'sm',\n\t\t\t\t'cds--tree--xs': size === 'xs'\n\t\t\t}\"\n\t\t\t[attr.aria-label]=\"label ? label : null\"\n\t\t\t[attr.aria-labelledby]=\"!label ? id : null\"\n\t\t\t[attr.aria-multiselectable]=\"isMultiSelect || null\"\n\t\t\trole=\"tree\"\n\t\t\t(keydown)=\"navigateTree($event)\"\n\t\t\t#treeWrapper>\n\t\t\t<ng-container *ngIf=\"isProjected(); else notProjected\">\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</ng-container>\n\t\t\t<ng-template #notProjected>\n\t\t\t\t<cds-tree-node\n\t\t\t\t\t*ngFor=\"let node of tree\"\n\t\t\t\t\t[node]=\"node\"\n\t\t\t\t\t(nodetoggle)=\"onNodeToggle($event)\">\n\t\t\t\t</cds-tree-node>\n\t\t\t</ng-template>\n\t\t</div>\n\t`,\n\tproviders: [TreeViewService]\n})\nexport class TreeViewComponent implements AfterViewInit, OnInit, OnDestroy {\n\t/**\n\t * Pass `Node[]` array to have tree view render the nodes\n\t * Passing value will disregard projected content\n\t */\n\t@Input() set tree(treeNodes: Node[]) {\n\t\tthis._tree = treeNodes.map((node) => this.copyNode(node));\n\t\tthis.treeViewService.contentProjected = false;\n\t}\n\n\tget tree() {\n\t\treturn this._tree;\n\t}\n\n\tstatic treeViewCount = 0;\n\n\t@Input() id = `tree-view-${TreeViewComponent.treeViewCount++}`;\n\t/**\n\t * Tree view label\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Optional context for label if it's a template\n\t */\n\t@Input() labelContext: any;\n\t/**\n\t * Specify the size of the list items in the tree\n\t */\n\t@Input() size: \"xs\" | \"sm\" = \"sm\";\n\t/**\n\t * **Experimental** - Enable to select multiple nodes\n\t */\n\t@Input() set isMultiSelect(isMulti: boolean) {\n\t\tthis.treeViewService.isMultiSelect = isMulti;\n\t}\n\n\t@Output() select = new EventEmitter<Node | Node[]>();\n\t@Output() toggle = new EventEmitter<Node>();\n\t@ViewChild(\"treeWrapper\") root: ElementRef;\n\n\tprivate treeWalker: TreeWalker;\n\tprivate _tree: Node[] = [];\n\tprivate subscription: Subscription;\n\n\tconstructor(\n\t\t@Inject(DOCUMENT) private document: Document,\n\t\tpublic treeViewService: TreeViewService,\n\t\tprivate elementRef: ElementRef\n\t) {}\n\n\t/**\n\t * Subscribe for node selection\n\t */\n\tngOnInit(): void {\n\t\tthis.subscription = this.treeViewService.selectionObservable.subscribe((nodesMap: Map<string, Node>) => {\n\t\t\t// Get all values from the map to emit\n\t\t\tconst nodes = [...nodesMap.values()];\n\n\t\t\tthis.select.emit(this.treeViewService.isMultiSelect ? nodes : nodes[0]);\n\t\t});\n\t\tthis.subscription.add(this.treeViewService.focusNodeObservable.subscribe(node => this.onNodeFocusChange(node)));\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.subscription.unsubscribe();\n\t}\n\n\t/**\n\t * Initialize tree walker to support keyboard navigation\n\t */\n\tngAfterViewInit(): void {\n\t\tthis.treeWalker = this.document.createTreeWalker(this.root.nativeElement, NodeFilter.SHOW_ELEMENT, {\n\t\t\tacceptNode: function (node: HTMLElement) {\n\t\t\t\tif (node.classList.contains(`cds--tree-node--disabled`)) {\n\t\t\t\t\treturn NodeFilter.FILTER_REJECT;\n\t\t\t\t}\n\t\t\t\tif (node.matches(`div.cds--tree-node`)) {\n\t\t\t\t\treturn NodeFilter.FILTER_ACCEPT;\n\t\t\t\t}\n\t\t\t\treturn NodeFilter.FILTER_SKIP;\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Navigate tree using tree walker\n\t * @param event - KeyboardEvent\n\t */\n\tnavigateTree(event: KeyboardEvent) {\n\t\tif (event.key === \"ArrowUp\") {\n\t\t\t(this.treeWalker.previousNode() as HTMLElement)?.focus();\n\t\t}\n\n\t\tif (event.key === \"ArrowDown\") {\n\t\t\t(this.treeWalker.nextNode() as HTMLElement)?.focus();\n\t\t}\n\t}\n\n\t/**\n\t * Propagate node toggle event\n\t * @param eventOnNode - EventOnNode\n\t */\n\tonNodeToggle(eventOnNode: EventOnNode) {\n\t\tif (!eventOnNode) {\n\t\t\treturn;\n\t\t}\n\t\tthis.toggle.emit(eventOnNode.node)\n\t}\n\n\t/**\n\t * Node focus change\n\t * @param node - Node\n\t */\n\tonNodeFocusChange(node: Node) {\n\t\tif (!node) {\n\t\t\t// if for some reason the focused node is not defined we fallback on the root element of the treeview\n\t\t\tthis.treeWalker.currentNode = this.treeWalker.root;\n\t\t\treturn;\n\t\t}\n\t\t// Update current node based on focus change to have a better keyboard navigation experience\n\t\tthis.treeWalker.currentNode = this.elementRef.nativeElement.querySelector(`#${CSS.escape(node.id)}`);\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\tpublic isProjected() {\n\t\treturn this.treeViewService.contentProjected;\n\t}\n\n\tprivate copyNode(node: Node): Node {\n\t\t// making a recursive shallow copy to avoid performance issues when deeply cloning templateRefs if defined in the node\n\t\tconst copiedNode = Object.assign({}, node);\n\t\tif (node.children) {\n\t\t copiedNode.children = node.children.map(child => this.copyNode(child));\n\t\t}\n\t\treturn copiedNode;\n\t}\n}\n","import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\n\nimport { IconModule } from \"carbon-components-angular/icon\";\n\nimport { TreeViewComponent } from \"./treeview.component\";\nimport { TreeNodeComponent } from \"./tree-node.component\";\n\n@NgModule({\n\tdeclarations: [TreeViewComponent, TreeNodeComponent],\n\texports: [TreeViewComponent, TreeNodeComponent],\n\timports: [CommonModule, IconModule]\n})\nexport class TreeviewModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.TreeViewService","i3.TreeNodeComponent"],"mappings":";;;;;;;;MAKa,eAAe,CAAA;AAuB3B,IAAA,WAAA,GAAA;AApBA;;;;;AAKG;QACH,IAAgB,CAAA,gBAAA,GAAG,IAAI,C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Ad,cAAc,EAAA,YAAA,EAAA,CAJX,iBAAiB,EAAE,iBAAiB,CAAA,EAAA,OAAA,EAAA,CAEzC,YAAY,EAAE,UAAU,CAAA,EAAA,OAAA,EAAA,CADxB,iBAAiB,EAAE,iBAAiB,CAAA,EAAA,CAAA,CAAA;4GAGlC,cAAc,EAAA,OAAA,EAAA,CAFhB,YAAY,EAAE,UAAU,CAAA,EAAA,CAAA,CAAA;2FAEtB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAL1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,YAAY,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;AACpD,oBAAA,OAAO,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;AAC/C,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;AACnC,iBAAA,CAAA;;;ACZD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
import { EventEmitter, OnInit, OnDestroy, TemplateRef, AfterContentChecked } from "@angular/core";
|
|
22
22
|
import { TreeViewService } from "./treeview.service";
|
|
23
|
-
import { Node } from "./tree-node.types";
|
|
23
|
+
import { EventOnNode, Node } from "./tree-node.types";
|
|
24
24
|
import * as i0 from "@angular/core";
|
|
25
25
|
export declare class TreeNodeComponent implements AfterContentChecked, OnInit, OnDestroy {
|
|
26
26
|
private treeViewService;
|
|
@@ -28,6 +28,7 @@ export declare class TreeNodeComponent implements AfterContentChecked, OnInit, O
|
|
|
28
28
|
id: string;
|
|
29
29
|
active: boolean;
|
|
30
30
|
disabled: boolean;
|
|
31
|
+
selectable: boolean;
|
|
31
32
|
expanded: boolean;
|
|
32
33
|
label: string | TemplateRef<any>;
|
|
33
34
|
labelContext: any;
|
|
@@ -48,10 +49,10 @@ export declare class TreeNodeComponent implements AfterContentChecked, OnInit, O
|
|
|
48
49
|
*/
|
|
49
50
|
set node(node: Node);
|
|
50
51
|
get node(): Node;
|
|
51
|
-
nodeFocus: EventEmitter<
|
|
52
|
-
nodeBlur: EventEmitter<
|
|
53
|
-
nodeSelect: EventEmitter<
|
|
54
|
-
nodetoggle: EventEmitter<
|
|
52
|
+
nodeFocus: EventEmitter<EventOnNode>;
|
|
53
|
+
nodeBlur: EventEmitter<EventOnNode>;
|
|
54
|
+
nodeSelect: EventEmitter<Node>;
|
|
55
|
+
nodetoggle: EventEmitter<EventOnNode>;
|
|
55
56
|
offset: any;
|
|
56
57
|
private _node;
|
|
57
58
|
private subscription;
|
|
@@ -92,5 +93,5 @@ export declare class TreeNodeComponent implements AfterContentChecked, OnInit, O
|
|
|
92
93
|
isTemplate(value: any): boolean;
|
|
93
94
|
isProjected(): boolean;
|
|
94
95
|
static ɵfac: i0.ɵɵFactoryDeclaration<TreeNodeComponent, never>;
|
|
95
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TreeNodeComponent, "cds-tree-node", never, { "id": "id"; "active": "active"; "disabled": "disabled"; "expanded": "expanded"; "label": "label"; "labelContext": "labelContext"; "selected": "selected"; "value": "value"; "icon": "icon"; "iconContext": "iconContext"; "gap": "gap"; "children": "children"; "depth": "depth"; "node": "node"; }, { "nodeFocus": "nodeFocus"; "nodeBlur": "nodeBlur"; "nodeSelect": "nodeSelect"; "nodetoggle": "nodetoggle"; }, never, ["*"], false>;
|
|
96
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TreeNodeComponent, "cds-tree-node", never, { "id": "id"; "active": "active"; "disabled": "disabled"; "selectable": "selectable"; "expanded": "expanded"; "label": "label"; "labelContext": "labelContext"; "selected": "selected"; "value": "value"; "icon": "icon"; "iconContext": "iconContext"; "gap": "gap"; "children": "children"; "depth": "depth"; "node": "node"; }, { "nodeFocus": "nodeFocus"; "nodeBlur": "nodeBlur"; "nodeSelect": "nodeSelect"; "nodetoggle": "nodetoggle"; }, never, ["*"], false>;
|
|
96
97
|
}
|
|
@@ -26,6 +26,7 @@ export interface Node {
|
|
|
26
26
|
id?: string;
|
|
27
27
|
active?: boolean;
|
|
28
28
|
disabled?: boolean;
|
|
29
|
+
selectable?: boolean;
|
|
29
30
|
expanded?: boolean;
|
|
30
31
|
selected?: boolean;
|
|
31
32
|
icon?: string | TemplateRef<any>;
|
|
@@ -34,3 +35,7 @@ export interface Node {
|
|
|
34
35
|
children?: Node[];
|
|
35
36
|
[key: string]: any;
|
|
36
37
|
}
|
|
38
|
+
export interface EventOnNode {
|
|
39
|
+
node: Node;
|
|
40
|
+
event: Event;
|
|
41
|
+
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
import { TemplateRef, EventEmitter, AfterViewInit, ElementRef, OnInit, OnDestroy } from "@angular/core";
|
|
22
|
-
import { Node } from "./tree-node.types";
|
|
22
|
+
import { EventOnNode, Node } from "./tree-node.types";
|
|
23
23
|
import { TreeViewService } from "./treeview.service";
|
|
24
24
|
import * as i0 from "@angular/core";
|
|
25
25
|
/**
|
|
@@ -60,6 +60,7 @@ export declare class TreeViewComponent implements AfterViewInit, OnInit, OnDestr
|
|
|
60
60
|
*/
|
|
61
61
|
set isMultiSelect(isMulti: boolean);
|
|
62
62
|
select: EventEmitter<Node | Node[]>;
|
|
63
|
+
toggle: EventEmitter<Node>;
|
|
63
64
|
root: ElementRef;
|
|
64
65
|
private treeWalker;
|
|
65
66
|
private _tree;
|
|
@@ -79,9 +80,19 @@ export declare class TreeViewComponent implements AfterViewInit, OnInit, OnDestr
|
|
|
79
80
|
* @param event - KeyboardEvent
|
|
80
81
|
*/
|
|
81
82
|
navigateTree(event: KeyboardEvent): void;
|
|
83
|
+
/**
|
|
84
|
+
* Propagate node toggle event
|
|
85
|
+
* @param eventOnNode - EventOnNode
|
|
86
|
+
*/
|
|
87
|
+
onNodeToggle(eventOnNode: EventOnNode): void;
|
|
88
|
+
/**
|
|
89
|
+
* Node focus change
|
|
90
|
+
* @param node - Node
|
|
91
|
+
*/
|
|
92
|
+
onNodeFocusChange(node: Node): void;
|
|
82
93
|
isTemplate(value: any): boolean;
|
|
83
94
|
isProjected(): boolean;
|
|
84
95
|
private copyNode;
|
|
85
96
|
static ɵfac: i0.ɵɵFactoryDeclaration<TreeViewComponent, never>;
|
|
86
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TreeViewComponent, "cds-tree-view", never, { "tree": "tree"; "id": "id"; "label": "label"; "labelContext": "labelContext"; "size": "size"; "isMultiSelect": "isMultiSelect"; }, { "select": "select"; }, never, ["*"], false>;
|
|
97
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TreeViewComponent, "cds-tree-view", never, { "tree": "tree"; "id": "id"; "label": "label"; "labelContext": "labelContext"; "size": "size"; "isMultiSelect": "isMultiSelect"; }, { "select": "select"; "toggle": "toggle"; }, never, ["*"], false>;
|
|
87
98
|
}
|
|
@@ -23,6 +23,7 @@ import { Node } from "./tree-node.types";
|
|
|
23
23
|
import * as i0 from "@angular/core";
|
|
24
24
|
export declare class TreeViewService {
|
|
25
25
|
selectionObservable: Observable<any | any[]>;
|
|
26
|
+
focusNodeObservable: Observable<Node>;
|
|
26
27
|
/**
|
|
27
28
|
* Variable used across all nodes and wrapper to determine if we should allow content projection
|
|
28
29
|
* or generate the tree
|
|
@@ -35,11 +36,17 @@ export declare class TreeViewService {
|
|
|
35
36
|
*/
|
|
36
37
|
isMultiSelect: boolean;
|
|
37
38
|
private selectionSubject;
|
|
39
|
+
private focusNodeSubject;
|
|
38
40
|
/**
|
|
39
41
|
* Hold's list of selected nodes and preserves order
|
|
40
42
|
*/
|
|
41
43
|
private value;
|
|
42
44
|
constructor();
|
|
45
|
+
/**
|
|
46
|
+
* Emits the focused node
|
|
47
|
+
* @param node: Node
|
|
48
|
+
*/
|
|
49
|
+
focusNode(node: Node): void;
|
|
43
50
|
/**
|
|
44
51
|
* Store selected node in map
|
|
45
52
|
* @param node: Node
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcarbon_components_angular=self.webpackChunkcarbon_components_angular||[]).push([[2399],{"./src/input/textarea.stories.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Basic:()=>Basic,Skeleton:()=>Skeleton,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _storybook_angular__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@storybook/angular/dist/index.mjs"),___WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/input/index.ts");const __WEBPACK_DEFAULT_EXPORT__={title:"Components/Input/Text area",decorators:[(0,_storybook_angular__WEBPACK_IMPORTED_MODULE_0__.moduleMetadata)({imports:[___WEBPACK_IMPORTED_MODULE_1__.gP]})],component:___WEBPACK_IMPORTED_MODULE_1__.y8},Basic=(args=>({props:args,template:'\n <cds-textarea-label\n [helperText]="helperText"\n [invalid]="invalid"\n [disabled]="disabled"\n [invalidText]="invalidText"\n [warn]="warn"\n [warnText]="warnText">\n {{label}}\n <textarea\n cdsTextArea\n [placeholder]="placeholder"\n [invalid]="invalid"\n [disabled]="disabled"\n [theme]="theme"\n [rows]="rows"\n [cols]="cols"\n aria-label="textarea"></textarea>\n </cds-textarea-label>\n '})).bind({});Basic.args={disabled:!1,invalid:!1,invalidText:"Invalid entry",warn:!1,warnText:"This is a warning!",label:"Text input label",helperText:"Optional helper text",placeholder:"Placeholder",cols:50,rows:4,autocomplete:"on",theme:"dark"},Basic.argTypes={autocomplete:{options:["on","off"],control:"radio"},theme:{options:["light","dark"],control:"radio"}};const Skeleton=(args=>({props:args,template:'\n <cds-textarea-label skeleton="true">\n <div cdsTextArea skeleton="true"></div>\n </cds-textarea-label>\n '})).bind({});Basic.parameters={...Basic.parameters,docs:{...Basic.parameters?.docs,source:{originalSource:'args => ({\n props: args,\n template: `\n <cds-textarea-label\n [helperText]="helperText"\n [invalid]="invalid"\n [disabled]="disabled"\n [invalidText]="invalidText"\n [warn]="warn"\n [warnText]="warnText">\n {{label}}\n <textarea\n cdsTextArea\n [placeholder]="placeholder"\n [invalid]="invalid"\n [disabled]="disabled"\n [theme]="theme"\n [rows]="rows"\n [cols]="cols"\n aria-label="textarea"></textarea>\n </cds-textarea-label>\n `\n})',...Basic.parameters?.docs?.source}}},Skeleton.parameters={...Skeleton.parameters,docs:{...Skeleton.parameters?.docs,source:{originalSource:'args => ({\n props: args,\n template: `\n <cds-textarea-label skeleton="true">\n <div cdsTextArea skeleton="true"></div>\n </cds-textarea-label>\n `\n})',...Skeleton.parameters?.docs?.source}}};const __namedExportsOrder=["Basic","Skeleton"]}}]);
|