carbon-components-angular 5.40.1 → 5.40.3
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/classes/CheckboxExportedTests.html +4 -6
- package/docs/documentation/components/TreeNodeComponent.html +53 -51
- package/docs/documentation/dependencies.html +1 -1
- package/docs/documentation/directives/RouterLinkExtendedDirective.html +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 +74 -74
- package/docs/documentation/modules/TilesModule.html +74 -74
- package/docs/documentation/modules/TimePickerModule/dependencies.svg +38 -42
- package/docs/documentation/modules/TimePickerModule.html +38 -42
- package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TimePickerSelectModule.html +4 -4
- package/docs/documentation/modules/ToggleModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ToggleModule.html +4 -4
- package/docs/documentation/modules/ToggletipModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ToggletipModule.html +4 -4
- package/docs/documentation/modules/TooltipModule/dependencies.svg +28 -28
- package/docs/documentation/modules/TooltipModule.html +28 -28
- package/docs/documentation/modules/TreeviewModule/dependencies.svg +35 -35
- package/docs/documentation/modules/TreeviewModule.html +35 -35
- package/docs/documentation/modules/UIShellModule/dependencies.svg +4 -4
- package/docs/documentation/modules/UIShellModule.html +4 -4
- package/docs/documentation.json +53 -53
- package/docs/storybook/{6765.30850149.iframe.bundle.js → 6765.2096c92a.iframe.bundle.js} +1 -1
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/main.6ab6b957.iframe.bundle.js +1 -0
- package/docs/storybook/{modal-modal-stories.66aa5c7c.iframe.bundle.js → modal-modal-stories.eca6c3e9.iframe.bundle.js} +1 -1
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/{runtime~main.76c92ca6.iframe.bundle.js → runtime~main.9a2d87c0.iframe.bundle.js} +1 -1
- package/docs/storybook/sb-addons/essentials-controls-1/manager-bundle.js +24 -24
- package/docs/storybook/{treeview-treeview-stories.fa77fc60.iframe.bundle.js → treeview-treeview-stories.7addb70a.iframe.bundle.js} +1 -1
- package/esm2020/treeview/tree-node.component.mjs +5 -3
- package/esm2020/ui-shell/sidenav/routerlink-extended.directive.mjs +2 -2
- package/fesm2015/carbon-components-angular-treeview.mjs +4 -2
- package/fesm2015/carbon-components-angular-treeview.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-ui-shell.mjs +1 -1
- package/fesm2015/carbon-components-angular-ui-shell.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-treeview.mjs +4 -2
- package/fesm2020/carbon-components-angular-treeview.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-ui-shell.mjs +1 -1
- package/fesm2020/carbon-components-angular-ui-shell.mjs.map +1 -1
- package/package.json +2 -2
- package/docs/storybook/7331.93927803.iframe.bundle.js +0 -2
- package/docs/storybook/7331.93927803.iframe.bundle.js.LICENSE.txt +0 -8
- package/docs/storybook/main.4f9494c2.iframe.bundle.js +0 -1
package/docs/documentation.json
CHANGED
|
@@ -5282,12 +5282,12 @@
|
|
|
5282
5282
|
"classes": [
|
|
5283
5283
|
{
|
|
5284
5284
|
"name": "CheckboxExportedTests",
|
|
5285
|
-
"id": "class-CheckboxExportedTests-
|
|
5285
|
+
"id": "class-CheckboxExportedTests-6b6157797937d6676e8ab8a092bd396bf5dbead2e095c1077e1c287dc3036bc363e31c65bcfef623c6f348a4969d9d6d772bc1f8e3c18865affbd312b723cfa0",
|
|
5286
5286
|
"file": "src/checkbox/checkbox-exported-tests.ts",
|
|
5287
5287
|
"deprecated": false,
|
|
5288
5288
|
"deprecationMessage": "",
|
|
5289
5289
|
"type": "class",
|
|
5290
|
-
"sourceCode": "import { expect } from \"chai\";\
|
|
5290
|
+
"sourceCode": "import { expect } from \"chai\";\nimport merge from \"lodash/merge\";\nimport ComponentTests from \"../exported-tests/component-tests\";\n\nconst defaults = {\n\tselectors: {\n\t\troot: \"cds-checkbox\",\n\t\tinput: \"input\"\n\t}\n};\n\nclass CheckboxExportedTests extends ComponentTests {\n\tconstructor(configs) {\n\t\tsuper(merge({}, defaults, configs));\n\t\tthis.tests = this.tests.concat(this.structure());\n\t}\n\n\tstructure() {\n\t\tconst tests = [\n\t\t\t{\n\t\t\t\tname: \"initially be unchecked, be checked on click\",\n\t\t\t\tgetActual: fragment =>\n\t\t\t\t\tnew Promise(resolve => {\n\t\t\t\t\t\tconst component = this.getComponent(\n\t\t\t\t\t\t\tfragment,\n\t\t\t\t\t\t\t`${this.settings.selectors.root} ${this.settings.selectors.input}`\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst initialState = component.checked;\n\t\t\t\t\t\tcomponent.click();\n\t\t\t\t\t\tconst afterClickState = component.checked;\n\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\tinitialState,\n\t\t\t\t\t\t\tafterClickState\n\t\t\t\t\t\t});\n\t\t\t\t\t}),\n\t\t\t\t\trunComparison: results => {\n\t\t\t\t\t// tslint:disable-next-line\n\t\t\t\t\texpect(results.initialState).to.be.false;\n\t\t\t\t\t// tslint:disable-next-line\n\t\t\t\t\texpect(results.afterClickState).to.be.true;\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\t\treturn [{\n\t\t\tname: \"Basic checkbox tests\",\n\t\t\ttests: this.getTests(tests)\n\t\t}];\n\t}\n}\n\nexport default CheckboxExportedTests;\n",
|
|
5291
5291
|
"constructorObj": {
|
|
5292
5292
|
"name": "constructor",
|
|
5293
5293
|
"description": "",
|
|
@@ -5301,7 +5301,7 @@
|
|
|
5301
5301
|
"deprecationMessage": ""
|
|
5302
5302
|
}
|
|
5303
5303
|
],
|
|
5304
|
-
"line":
|
|
5304
|
+
"line": 12,
|
|
5305
5305
|
"jsdoctags": [
|
|
5306
5306
|
{
|
|
5307
5307
|
"name": "configs",
|
|
@@ -5367,7 +5367,7 @@
|
|
|
5367
5367
|
"optional": false,
|
|
5368
5368
|
"returnType": "{}",
|
|
5369
5369
|
"typeParameters": [],
|
|
5370
|
-
"line":
|
|
5370
|
+
"line": 18,
|
|
5371
5371
|
"deprecated": false,
|
|
5372
5372
|
"deprecationMessage": ""
|
|
5373
5373
|
},
|
|
@@ -15942,12 +15942,12 @@
|
|
|
15942
15942
|
},
|
|
15943
15943
|
{
|
|
15944
15944
|
"name": "RouterLinkExtendedDirective",
|
|
15945
|
-
"id": "directive-RouterLinkExtendedDirective-
|
|
15945
|
+
"id": "directive-RouterLinkExtendedDirective-ac7fa78aa335dce13bd8bffbb115daa3b12dbe24357a0e507e6715bed39fb218e7733a19f1727b2c0c850f7fd07ba85f22fd0bd5db2c925fcdd657758a31a395",
|
|
15946
15946
|
"file": "src/ui-shell/sidenav/routerlink-extended.directive.ts",
|
|
15947
15947
|
"type": "directive",
|
|
15948
15948
|
"description": "",
|
|
15949
15949
|
"rawdescription": "\n",
|
|
15950
|
-
"sourceCode": "import { Directive, Input, OnChanges, SimpleChanges } from \"@angular/core\";\nimport { NavigationExtras, RouterLinkWithHref } from \"@angular/router\";\nimport
|
|
15950
|
+
"sourceCode": "import { Directive, Input, OnChanges, SimpleChanges } from \"@angular/core\";\nimport { NavigationExtras, RouterLinkWithHref } from \"@angular/router\";\nimport keys from \"lodash/keys\";\n\n@Directive({\n\t// tslint:disable-next-line\n\tselector: \"[routerLink]\"\n})\nexport class RouterLinkExtendedDirective extends RouterLinkWithHref implements OnChanges {\n\t// TODO: Change RouterLinkWithHref with RouterLink from angular 15 since RouterLinkWithHref has been deprecated\n\t@Input() routeExtras: NavigationExtras;\n\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tif (changes.routeExtras && this.routeExtras) {\n\t\t\tkeys(this.routeExtras).forEach(routeExtraProperty => this[routeExtraProperty] = this.routeExtras[routeExtraProperty]);\n\t\t}\n\n\t\tsuper.ngOnChanges(changes);\n\t}\n}\n",
|
|
15951
15951
|
"selector": "[routerLink]",
|
|
15952
15952
|
"providers": [],
|
|
15953
15953
|
"hostDirectives": [],
|
|
@@ -66844,7 +66844,7 @@
|
|
|
66844
66844
|
},
|
|
66845
66845
|
{
|
|
66846
66846
|
"name": "TreeNodeComponent",
|
|
66847
|
-
"id": "component-TreeNodeComponent-
|
|
66847
|
+
"id": "component-TreeNodeComponent-638ba38397215c1dcb4a26f6383e09fdb8454ab897d7050e6f6bb6695e32ace672799c7d7979688922bb516b38ba39474baa39c40e120d9950c328be853f73bc",
|
|
66848
66848
|
"file": "src/treeview/tree-node.component.ts",
|
|
66849
66849
|
"encapsulation": [],
|
|
66850
66850
|
"entryComponents": [],
|
|
@@ -66854,7 +66854,7 @@
|
|
|
66854
66854
|
"selector": "cds-tree-node",
|
|
66855
66855
|
"styleUrls": [],
|
|
66856
66856
|
"styles": [],
|
|
66857
|
-
"template": "<div\n\t[id]=\"id\"\n\tclass=\"cds--tree-node\"\n\t[ngClass]=\"{\n\t\t'cds--tree-node--active': active,\n\t\t'cds--tree-node--disabled': disabled,\n\t\t'cds--tree-node--selected': selected,\n\t\t'cds--tree-leaf-node': !children.length,\n\t\t'cds--tree-parent-node': children.length,\n\t\t'cds--tree-node--with-icon': icon\n\t}\"\n\t[attr.aria-expanded]=\"expanded || null\"\n\t[attr.aria-current]=\"active || null\"\n\t[attr.aria-selected]=\"disabled ? null : selected\"\n\t[attr.aria-disabled]=\"disabled\"\n\trole=\"treeitem\"\n\t[attr.tabindex]=\"selected ? 0 : -1\"\n\t(focus)=\"emitFocusEvent($event)\"\n\t(blur)=\"emitBlurEvent($event)\"\n\t(keydown)=\"navigateTree($event)\">\n\t<div\n\t\t*ngIf=\"!children.length\"\n\t\tclass=\"cds--tree-node__label\"\n\t\t[style.padding-inline-start.rem]=\"offset\"\n\t\t[style.margin-inline-start.rem]=\"-offset\"\n\t\t(click)=\"nodeClick($event)\">\n\t\t<!-- Icon -->\n\t\t<ng-container *ngIf=\"icon && !isTemplate(icon)\">\n\t\t\t<svg\n\t\t\t\tclass=\"cds--tree-node__icon\"\n\t\t\t\t[cdsIcon]=\"icon\"\n\t\t\t\tsize=\"16\">\n\t\t\t</svg>\n\t\t</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(icon)\" [ngTemplateOutlet]=\"icon\"></ng-template>\n\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t<ng-template\n\t\t\t*ngIf=\"isTemplate(label)\"\n\t\t\t[ngTemplateOutlet]=\"label\"\n\t\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t\t</ng-template>\n\t</div>\n\t<div\n\t\t*ngIf=\"children.length\"\n\t\tclass=\"cds--tree-node__label\"\n\t\t[style.padding-inline-start.rem]=\"offset\"\n\t\t[style.margin-inline-start.rem]=\"-offset\"\n\t\trole=\"group\"\n\t\t(click)=\"nodeClick($event)\">\n\t\t<span\n\t\t\tclass=\"cds--tree-parent-node__toggle\"\n\t\t\t[attr.disabled]=\"disabled || null\"\n\t\t\t(click)=\"toggleExpanded($event)\">\n\t\t\t<svg\n\t\t\t\tclass=\"cds--tree-parent-node__toggle-icon\"\n\t\t\t\t[ngClass]=\"{'cds--tree-parent-node__toggle-icon--expanded' : expanded}\"\n\t\t\t\tibmIcon=\"caret--down\"\n\t\t\t\tsize=\"16\">\n\t\t\t</svg>\n\t\t</span>\n\t\t<span class=\"cds--tree-node__label__details\">\n\t\t\t<!-- Icon -->\n\t\t\t<ng-container *ngIf=\"icon && !isTemplate(icon)\">\n\t\t\t\t<svg\n\t\t\t\t\tclass=\"cds--tree-node__icon\"\n\t\t\t\t\t[cdsIcon]=\"icon\"\n\t\t\t\t\tsize=\"16\">\n\t\t\t\t</svg>\n\t\t\t</ng-container>\n\t\t\t<ng-template\n\t\t\t\t*ngIf=\"isTemplate(icon)\"\n\t\t\t\t[ngTemplateOutlet]=\"icon\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: iconContext }\">\n\t\t\t</ng-template>\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</span>\n\t</div>\n\t<div\n\t\t*ngIf=\"expanded\"\n\t\trole=\"group\"\n\t\tclass=\"cds--tree-node__children\">\n\t\t<ng-container *ngIf=\"isProjected(); else notProjected\">\n\t\t\t<ng-content></ng-content>\n\t\t</ng-container>\n\t\t<ng-template #notProjected>\n\t\t\t<cds-tree-node\n\t\t\t\t*ngFor=\"let childNode of children\"\n\t\t\t\t[node]=\"childNode\"\n\t\t\t\t[depth]=\"depth + 1\"\n\t\t\t\t[disabled]=\"disabled\">\n\t\t\t</cds-tree-node>\n\t\t</ng-template>\n\t</div>\n</div>\n\t",
|
|
66857
|
+
"template": "<div\n\t[id]=\"id\"\n\tclass=\"cds--tree-node\"\n\t[ngClass]=\"{\n\t\t'cds--tree-node--active': active,\n\t\t'cds--tree-node--disabled': disabled,\n\t\t'cds--tree-node--selected': selected,\n\t\t'cds--tree-leaf-node': !children.length,\n\t\t'cds--tree-parent-node': children.length,\n\t\t'cds--tree-node--with-icon': icon\n\t}\"\n\t[attr.aria-expanded]=\"expanded || null\"\n\t[attr.aria-current]=\"active || null\"\n\t[attr.aria-selected]=\"disabled ? null : selected\"\n\t[attr.aria-disabled]=\"disabled\"\n\trole=\"treeitem\"\n\t[attr.tabindex]=\"selected ? 0 : -1\"\n\t(focus)=\"emitFocusEvent($event)\"\n\t(blur)=\"emitBlurEvent($event)\"\n\t(keydown)=\"navigateTree($event)\">\n\t<div\n\t\t*ngIf=\"!children.length\"\n\t\tclass=\"cds--tree-node__label\"\n\t\t[style.padding-inline-start.rem]=\"offset\"\n\t\t[style.margin-inline-start.rem]=\"-offset\"\n\t\t(click)=\"nodeClick($event)\">\n\t\t<!-- Icon -->\n\t\t<ng-container *ngIf=\"icon && !isTemplate(icon)\">\n\t\t\t<svg\n\t\t\t\tclass=\"cds--tree-node__icon\"\n\t\t\t\t[cdsIcon]=\"icon\"\n\t\t\t\tsize=\"16\">\n\t\t\t</svg>\n\t\t</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(icon)\" [ngTemplateOutlet]=\"icon\"></ng-template>\n\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t<ng-template\n\t\t\t*ngIf=\"isTemplate(label)\"\n\t\t\t[ngTemplateOutlet]=\"label\"\n\t\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t\t</ng-template>\n\t</div>\n\t<div\n\t\t*ngIf=\"children.length\"\n\t\tclass=\"cds--tree-node__label\"\n\t\t[style.padding-inline-start.rem]=\"offset\"\n\t\t[style.margin-inline-start.rem]=\"-offset\"\n\t\trole=\"group\"\n\t\t(click)=\"nodeClick($event)\">\n\t\t<span\n\t\t\tclass=\"cds--tree-parent-node__toggle\"\n\t\t\t[attr.disabled]=\"disabled || null\"\n\t\t\t(click)=\"toggleExpanded($event)\">\n\t\t\t<svg\n\t\t\t\tclass=\"cds--tree-parent-node__toggle-icon\"\n\t\t\t\t[ngClass]=\"{'cds--tree-parent-node__toggle-icon--expanded' : expanded}\"\n\t\t\t\tibmIcon=\"caret--down\"\n\t\t\t\tsize=\"16\">\n\t\t\t</svg>\n\t\t</span>\n\t\t<span class=\"cds--tree-node__label__details\">\n\t\t\t<!-- Icon -->\n\t\t\t<ng-container *ngIf=\"icon && !isTemplate(icon)\">\n\t\t\t\t<svg\n\t\t\t\t\tclass=\"cds--tree-node__icon\"\n\t\t\t\t\t[cdsIcon]=\"icon\"\n\t\t\t\t\tsize=\"16\">\n\t\t\t\t</svg>\n\t\t\t</ng-container>\n\t\t\t<ng-template\n\t\t\t\t*ngIf=\"isTemplate(icon)\"\n\t\t\t\t[ngTemplateOutlet]=\"icon\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: iconContext }\">\n\t\t\t</ng-template>\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</span>\n\t</div>\n\t<div\n\t\t*ngIf=\"expanded\"\n\t\trole=\"group\"\n\t\tclass=\"cds--tree-node__children\">\n\t\t<ng-container *ngIf=\"isProjected(); else notProjected\">\n\t\t\t<ng-content></ng-content>\n\t\t</ng-container>\n\t\t<ng-template #notProjected>\n\t\t\t<cds-tree-node\n\t\t\t\t*ngFor=\"let childNode of children\"\n\t\t\t\t[node]=\"childNode\"\n\t\t\t\t[depth]=\"depth + 1\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t(nodetoggle)=\"nodetoggle.emit($event)\">\n\t\t\t</cds-tree-node>\n\t\t</ng-template>\n\t</div>\n</div>\n\t",
|
|
66858
66858
|
"templateUrl": [],
|
|
66859
66859
|
"viewProviders": [],
|
|
66860
66860
|
"hostDirectives": [],
|
|
@@ -66864,7 +66864,7 @@
|
|
|
66864
66864
|
"defaultValue": "false",
|
|
66865
66865
|
"deprecated": false,
|
|
66866
66866
|
"deprecationMessage": "",
|
|
66867
|
-
"line":
|
|
66867
|
+
"line": 124,
|
|
66868
66868
|
"type": "boolean",
|
|
66869
66869
|
"decorators": []
|
|
66870
66870
|
},
|
|
@@ -66873,7 +66873,7 @@
|
|
|
66873
66873
|
"defaultValue": "[]",
|
|
66874
66874
|
"deprecated": false,
|
|
66875
66875
|
"deprecationMessage": "",
|
|
66876
|
-
"line":
|
|
66876
|
+
"line": 135,
|
|
66877
66877
|
"type": "Node[]",
|
|
66878
66878
|
"decorators": []
|
|
66879
66879
|
},
|
|
@@ -66884,7 +66884,7 @@
|
|
|
66884
66884
|
"deprecationMessage": "",
|
|
66885
66885
|
"rawdescription": "\n\nDetermines the depth of the node\nCalculated by default when passing `Node` array to `TreeViewComponent`, manual entry required otherwise\n",
|
|
66886
66886
|
"description": "<p>Determines the depth of the node\nCalculated by default when passing <code>Node</code> array to <code>TreeViewComponent</code>, manual entry required otherwise</p>\n",
|
|
66887
|
-
"line":
|
|
66887
|
+
"line": 141,
|
|
66888
66888
|
"type": "number",
|
|
66889
66889
|
"decorators": []
|
|
66890
66890
|
},
|
|
@@ -66893,7 +66893,7 @@
|
|
|
66893
66893
|
"defaultValue": "false",
|
|
66894
66894
|
"deprecated": false,
|
|
66895
66895
|
"deprecationMessage": "",
|
|
66896
|
-
"line":
|
|
66896
|
+
"line": 125,
|
|
66897
66897
|
"type": "boolean",
|
|
66898
66898
|
"decorators": []
|
|
66899
66899
|
},
|
|
@@ -66902,7 +66902,7 @@
|
|
|
66902
66902
|
"defaultValue": "false",
|
|
66903
66903
|
"deprecated": false,
|
|
66904
66904
|
"deprecationMessage": "",
|
|
66905
|
-
"line":
|
|
66905
|
+
"line": 127,
|
|
66906
66906
|
"type": "boolean",
|
|
66907
66907
|
"decorators": []
|
|
66908
66908
|
},
|
|
@@ -66911,7 +66911,7 @@
|
|
|
66911
66911
|
"defaultValue": "0",
|
|
66912
66912
|
"deprecated": false,
|
|
66913
66913
|
"deprecationMessage": "",
|
|
66914
|
-
"line":
|
|
66914
|
+
"line": 134,
|
|
66915
66915
|
"type": "number",
|
|
66916
66916
|
"decorators": []
|
|
66917
66917
|
},
|
|
@@ -66919,7 +66919,7 @@
|
|
|
66919
66919
|
"name": "icon",
|
|
66920
66920
|
"deprecated": false,
|
|
66921
66921
|
"deprecationMessage": "",
|
|
66922
|
-
"line":
|
|
66922
|
+
"line": 132,
|
|
66923
66923
|
"type": "string | TemplateRef<any>",
|
|
66924
66924
|
"decorators": []
|
|
66925
66925
|
},
|
|
@@ -66927,7 +66927,7 @@
|
|
|
66927
66927
|
"name": "iconContext",
|
|
66928
66928
|
"deprecated": false,
|
|
66929
66929
|
"deprecationMessage": "",
|
|
66930
|
-
"line":
|
|
66930
|
+
"line": 133,
|
|
66931
66931
|
"type": "any",
|
|
66932
66932
|
"decorators": []
|
|
66933
66933
|
},
|
|
@@ -66936,7 +66936,7 @@
|
|
|
66936
66936
|
"defaultValue": "`tree-node-${TreeNodeComponent.treeNodeCount++}`",
|
|
66937
66937
|
"deprecated": false,
|
|
66938
66938
|
"deprecationMessage": "",
|
|
66939
|
-
"line":
|
|
66939
|
+
"line": 123,
|
|
66940
66940
|
"type": "string",
|
|
66941
66941
|
"decorators": []
|
|
66942
66942
|
},
|
|
@@ -66944,7 +66944,7 @@
|
|
|
66944
66944
|
"name": "label",
|
|
66945
66945
|
"deprecated": false,
|
|
66946
66946
|
"deprecationMessage": "",
|
|
66947
|
-
"line":
|
|
66947
|
+
"line": 128,
|
|
66948
66948
|
"type": "string | TemplateRef<any>",
|
|
66949
66949
|
"decorators": []
|
|
66950
66950
|
},
|
|
@@ -66952,7 +66952,7 @@
|
|
|
66952
66952
|
"name": "labelContext",
|
|
66953
66953
|
"deprecated": false,
|
|
66954
66954
|
"deprecationMessage": "",
|
|
66955
|
-
"line":
|
|
66955
|
+
"line": 129,
|
|
66956
66956
|
"type": "any",
|
|
66957
66957
|
"decorators": []
|
|
66958
66958
|
},
|
|
@@ -66962,7 +66962,7 @@
|
|
|
66962
66962
|
"deprecationMessage": "",
|
|
66963
66963
|
"rawdescription": "\n\nSimple way to set all attributes of Node component via node object\nWould simplify setting component attributes when dynamically rendering node.\n",
|
|
66964
66964
|
"description": "<p>Simple way to set all attributes of Node component via node object\nWould simplify setting component attributes when dynamically rendering node.</p>\n",
|
|
66965
|
-
"line":
|
|
66965
|
+
"line": 147,
|
|
66966
66966
|
"type": "Node",
|
|
66967
66967
|
"decorators": []
|
|
66968
66968
|
},
|
|
@@ -66971,7 +66971,7 @@
|
|
|
66971
66971
|
"defaultValue": "true",
|
|
66972
66972
|
"deprecated": false,
|
|
66973
66973
|
"deprecationMessage": "",
|
|
66974
|
-
"line":
|
|
66974
|
+
"line": 126,
|
|
66975
66975
|
"type": "boolean",
|
|
66976
66976
|
"decorators": []
|
|
66977
66977
|
},
|
|
@@ -66980,7 +66980,7 @@
|
|
|
66980
66980
|
"defaultValue": "false",
|
|
66981
66981
|
"deprecated": false,
|
|
66982
66982
|
"deprecationMessage": "",
|
|
66983
|
-
"line":
|
|
66983
|
+
"line": 130,
|
|
66984
66984
|
"type": "boolean",
|
|
66985
66985
|
"decorators": []
|
|
66986
66986
|
},
|
|
@@ -66988,7 +66988,7 @@
|
|
|
66988
66988
|
"name": "value",
|
|
66989
66989
|
"deprecated": false,
|
|
66990
66990
|
"deprecationMessage": "",
|
|
66991
|
-
"line":
|
|
66991
|
+
"line": 131,
|
|
66992
66992
|
"type": "any",
|
|
66993
66993
|
"decorators": []
|
|
66994
66994
|
}
|
|
@@ -66999,7 +66999,7 @@
|
|
|
66999
66999
|
"defaultValue": "new EventEmitter<EventOnNode>()",
|
|
67000
67000
|
"deprecated": false,
|
|
67001
67001
|
"deprecationMessage": "",
|
|
67002
|
-
"line":
|
|
67002
|
+
"line": 171,
|
|
67003
67003
|
"type": "EventEmitter"
|
|
67004
67004
|
},
|
|
67005
67005
|
{
|
|
@@ -67007,7 +67007,7 @@
|
|
|
67007
67007
|
"defaultValue": "new EventEmitter<EventOnNode>()",
|
|
67008
67008
|
"deprecated": false,
|
|
67009
67009
|
"deprecationMessage": "",
|
|
67010
|
-
"line":
|
|
67010
|
+
"line": 170,
|
|
67011
67011
|
"type": "EventEmitter"
|
|
67012
67012
|
},
|
|
67013
67013
|
{
|
|
@@ -67015,7 +67015,7 @@
|
|
|
67015
67015
|
"defaultValue": "new EventEmitter<Node>()",
|
|
67016
67016
|
"deprecated": false,
|
|
67017
67017
|
"deprecationMessage": "",
|
|
67018
|
-
"line":
|
|
67018
|
+
"line": 172,
|
|
67019
67019
|
"type": "EventEmitter"
|
|
67020
67020
|
},
|
|
67021
67021
|
{
|
|
@@ -67023,7 +67023,7 @@
|
|
|
67023
67023
|
"defaultValue": "new EventEmitter<EventOnNode>()",
|
|
67024
67024
|
"deprecated": false,
|
|
67025
67025
|
"deprecationMessage": "",
|
|
67026
|
-
"line":
|
|
67026
|
+
"line": 173,
|
|
67027
67027
|
"type": "EventEmitter"
|
|
67028
67028
|
}
|
|
67029
67029
|
],
|
|
@@ -67035,7 +67035,7 @@
|
|
|
67035
67035
|
"type": "",
|
|
67036
67036
|
"optional": false,
|
|
67037
67037
|
"description": "",
|
|
67038
|
-
"line":
|
|
67038
|
+
"line": 175
|
|
67039
67039
|
},
|
|
67040
67040
|
{
|
|
67041
67041
|
"name": "treeNodeCount",
|
|
@@ -67045,7 +67045,7 @@
|
|
|
67045
67045
|
"type": "number",
|
|
67046
67046
|
"optional": false,
|
|
67047
67047
|
"description": "",
|
|
67048
|
-
"line":
|
|
67048
|
+
"line": 122,
|
|
67049
67049
|
"modifierKind": [
|
|
67050
67050
|
126
|
|
67051
67051
|
]
|
|
@@ -67058,7 +67058,7 @@
|
|
|
67058
67058
|
"optional": false,
|
|
67059
67059
|
"returnType": "number",
|
|
67060
67060
|
"typeParameters": [],
|
|
67061
|
-
"line":
|
|
67061
|
+
"line": 230,
|
|
67062
67062
|
"deprecated": false,
|
|
67063
67063
|
"deprecationMessage": "",
|
|
67064
67064
|
"rawdescription": "\n\nCalculate the node offset\n",
|
|
@@ -67066,8 +67066,8 @@
|
|
|
67066
67066
|
"jsdoctags": [
|
|
67067
67067
|
{
|
|
67068
67068
|
"tagName": {
|
|
67069
|
-
"pos":
|
|
67070
|
-
"end":
|
|
67069
|
+
"pos": 6504,
|
|
67070
|
+
"end": 6511,
|
|
67071
67071
|
"flags": 16842752,
|
|
67072
67072
|
"modifierFlagsCache": 0,
|
|
67073
67073
|
"transformFlags": 0,
|
|
@@ -67091,7 +67091,7 @@
|
|
|
67091
67091
|
"optional": false,
|
|
67092
67092
|
"returnType": "void",
|
|
67093
67093
|
"typeParameters": [],
|
|
67094
|
-
"line":
|
|
67094
|
+
"line": 255,
|
|
67095
67095
|
"deprecated": false,
|
|
67096
67096
|
"deprecationMessage": "",
|
|
67097
67097
|
"jsdoctags": [
|
|
@@ -67119,7 +67119,7 @@
|
|
|
67119
67119
|
"optional": false,
|
|
67120
67120
|
"returnType": "void",
|
|
67121
67121
|
"typeParameters": [],
|
|
67122
|
-
"line":
|
|
67122
|
+
"line": 249,
|
|
67123
67123
|
"deprecated": false,
|
|
67124
67124
|
"deprecationMessage": "",
|
|
67125
67125
|
"jsdoctags": [
|
|
@@ -67140,7 +67140,7 @@
|
|
|
67140
67140
|
"optional": false,
|
|
67141
67141
|
"returnType": "any",
|
|
67142
67142
|
"typeParameters": [],
|
|
67143
|
-
"line":
|
|
67143
|
+
"line": 302,
|
|
67144
67144
|
"deprecated": false,
|
|
67145
67145
|
"deprecationMessage": "",
|
|
67146
67146
|
"modifierKind": [
|
|
@@ -67160,7 +67160,7 @@
|
|
|
67160
67160
|
"optional": false,
|
|
67161
67161
|
"returnType": "boolean",
|
|
67162
67162
|
"typeParameters": [],
|
|
67163
|
-
"line":
|
|
67163
|
+
"line": 298,
|
|
67164
67164
|
"deprecated": false,
|
|
67165
67165
|
"deprecationMessage": "",
|
|
67166
67166
|
"modifierKind": [
|
|
@@ -67191,7 +67191,7 @@
|
|
|
67191
67191
|
"optional": false,
|
|
67192
67192
|
"returnType": "void",
|
|
67193
67193
|
"typeParameters": [],
|
|
67194
|
-
"line":
|
|
67194
|
+
"line": 275,
|
|
67195
67195
|
"deprecated": false,
|
|
67196
67196
|
"deprecationMessage": "",
|
|
67197
67197
|
"rawdescription": "\n\nManages the keyboard accessibility for children expansion & selection\n",
|
|
@@ -67221,7 +67221,7 @@
|
|
|
67221
67221
|
"optional": false,
|
|
67222
67222
|
"returnType": "void",
|
|
67223
67223
|
"typeParameters": [],
|
|
67224
|
-
"line":
|
|
67224
|
+
"line": 210,
|
|
67225
67225
|
"deprecated": false,
|
|
67226
67226
|
"deprecationMessage": "",
|
|
67227
67227
|
"rawdescription": "\n\nSelects the node and emits the event from the tree view component\n",
|
|
@@ -67229,8 +67229,8 @@
|
|
|
67229
67229
|
"jsdoctags": [
|
|
67230
67230
|
{
|
|
67231
67231
|
"name": {
|
|
67232
|
-
"pos":
|
|
67233
|
-
"end":
|
|
67232
|
+
"pos": 5987,
|
|
67233
|
+
"end": 5992,
|
|
67234
67234
|
"flags": 16842752,
|
|
67235
67235
|
"modifierFlagsCache": 0,
|
|
67236
67236
|
"transformFlags": 0,
|
|
@@ -67241,8 +67241,8 @@
|
|
|
67241
67241
|
"deprecated": false,
|
|
67242
67242
|
"deprecationMessage": "",
|
|
67243
67243
|
"tagName": {
|
|
67244
|
-
"pos":
|
|
67245
|
-
"end":
|
|
67244
|
+
"pos": 5981,
|
|
67245
|
+
"end": 5986,
|
|
67246
67246
|
"flags": 16842752,
|
|
67247
67247
|
"modifierFlagsCache": 0,
|
|
67248
67248
|
"transformFlags": 0,
|
|
@@ -67266,7 +67266,7 @@
|
|
|
67266
67266
|
"optional": false,
|
|
67267
67267
|
"returnType": "void",
|
|
67268
67268
|
"typeParameters": [],
|
|
67269
|
-
"line":
|
|
67269
|
+
"line": 263,
|
|
67270
67270
|
"deprecated": false,
|
|
67271
67271
|
"deprecationMessage": "",
|
|
67272
67272
|
"rawdescription": "\n\nExpand children if not disabled\n",
|
|
@@ -67274,8 +67274,8 @@
|
|
|
67274
67274
|
"jsdoctags": [
|
|
67275
67275
|
{
|
|
67276
67276
|
"name": {
|
|
67277
|
-
"pos":
|
|
67278
|
-
"end":
|
|
67277
|
+
"pos": 7245,
|
|
67278
|
+
"end": 7250,
|
|
67279
67279
|
"flags": 16842752,
|
|
67280
67280
|
"modifierFlagsCache": 0,
|
|
67281
67281
|
"transformFlags": 0,
|
|
@@ -67286,8 +67286,8 @@
|
|
|
67286
67286
|
"deprecated": false,
|
|
67287
67287
|
"deprecationMessage": "",
|
|
67288
67288
|
"tagName": {
|
|
67289
|
-
"pos":
|
|
67290
|
-
"end":
|
|
67289
|
+
"pos": 7239,
|
|
67290
|
+
"end": 7244,
|
|
67291
67291
|
"flags": 16842752,
|
|
67292
67292
|
"modifierFlagsCache": 0,
|
|
67293
67293
|
"transformFlags": 0,
|
|
@@ -67308,7 +67308,7 @@
|
|
|
67308
67308
|
"description": "",
|
|
67309
67309
|
"rawdescription": "\n",
|
|
67310
67310
|
"type": "component",
|
|
67311
|
-
"sourceCode": "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",
|
|
67311
|
+
"sourceCode": "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\t(nodetoggle)=\"nodetoggle.emit($event)\">\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",
|
|
67312
67312
|
"assetsDirs": [],
|
|
67313
67313
|
"styleUrlsData": "",
|
|
67314
67314
|
"stylesData": "",
|
|
@@ -67325,7 +67325,7 @@
|
|
|
67325
67325
|
"deprecationMessage": ""
|
|
67326
67326
|
}
|
|
67327
67327
|
],
|
|
67328
|
-
"line":
|
|
67328
|
+
"line": 177,
|
|
67329
67329
|
"jsdoctags": [
|
|
67330
67330
|
{
|
|
67331
67331
|
"name": "treeViewService",
|
|
@@ -67361,7 +67361,7 @@
|
|
|
67361
67361
|
}
|
|
67362
67362
|
],
|
|
67363
67363
|
"returnType": "void",
|
|
67364
|
-
"line":
|
|
67364
|
+
"line": 147,
|
|
67365
67365
|
"rawdescription": "\n\nSimple way to set all attributes of Node component via node object\nWould simplify setting component attributes when dynamically rendering node.\n",
|
|
67366
67366
|
"description": "<p>Simple way to set all attributes of Node component via node object\nWould simplify setting component attributes when dynamically rendering node.</p>\n",
|
|
67367
67367
|
"jsdoctags": [
|
|
@@ -67380,7 +67380,7 @@
|
|
|
67380
67380
|
"name": "node",
|
|
67381
67381
|
"type": "",
|
|
67382
67382
|
"returnType": "",
|
|
67383
|
-
"line":
|
|
67383
|
+
"line": 166
|
|
67384
67384
|
}
|
|
67385
67385
|
}
|
|
67386
67386
|
}
|
|
@@ -73966,7 +73966,7 @@
|
|
|
73966
73966
|
"deprecated": false,
|
|
73967
73967
|
"deprecationMessage": "",
|
|
73968
73968
|
"type": "",
|
|
73969
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button #trigger cdsButton=\"primary\" (click)=\"open = true\">Open</button>\n\t\t<cds-modal [open]=\"open\" [trigger]=\"trigger\" (overlaySelected)=\"open = false\">\n\t\t\t<cds-modal-header (closeSelect)=\"open = false\" [showCloseButton]=\"showCloseButton\">\n\t\t\t\t<p class=\"cds--modal-header__label cds--type-delta\">No service required</p>\n\t\t\t\t<p class=\"cds--modal-header__heading cds--type-beta\">A very simple modal</p>\n\t\t\t</cds-modal-header>\n\t\t\t<div class=\"cds--modal-content\">\n\t\t\t\t<p>hello world</p>\n\t\t\t</div>\n\t\t\t<cds-modal-footer>\n\t\t\t\t<ng-container>\n\t\t\t\t\t<button\n\t\t\t\t\t\tcdsButton=\"primary\"\n\t\t\t\t\t\t(click)=\"open = false\"\n\t\t\t\t\t\t[attr.modal-primary-focus]=\"true\">\n\t\t\t\t\t\tOkay\n\t\t\t\t\t</button>\n\t\t\t\t</ng-container>\n\t\t\t</cds-modal-footer>\n\t\t</cds-modal>\n\t`\n})"
|
|
73969
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button #trigger cdsButton=\"primary\" (click)=\"open = true\">Open</button>\n\t\t<cds-modal [open]=\"open\" [trigger]=\"trigger\" (overlaySelected)=\"open = false\" (close)=\"open = false\">\n\t\t\t<cds-modal-header (closeSelect)=\"open = false\" [showCloseButton]=\"showCloseButton\">\n\t\t\t\t<p class=\"cds--modal-header__label cds--type-delta\">No service required</p>\n\t\t\t\t<p class=\"cds--modal-header__heading cds--type-beta\">A very simple modal</p>\n\t\t\t</cds-modal-header>\n\t\t\t<div class=\"cds--modal-content\">\n\t\t\t\t<p>hello world</p>\n\t\t\t</div>\n\t\t\t<cds-modal-footer>\n\t\t\t\t<ng-container>\n\t\t\t\t\t<button\n\t\t\t\t\t\tcdsButton=\"primary\"\n\t\t\t\t\t\t(click)=\"open = false\"\n\t\t\t\t\t\t[attr.modal-primary-focus]=\"true\">\n\t\t\t\t\t\tOkay\n\t\t\t\t\t</button>\n\t\t\t\t</ng-container>\n\t\t\t</cds-modal-footer>\n\t\t</cds-modal>\n\t`\n})"
|
|
73970
73970
|
},
|
|
73971
73971
|
{
|
|
73972
73972
|
"name": "Single",
|
|
@@ -79484,7 +79484,7 @@
|
|
|
79484
79484
|
"deprecated": false,
|
|
79485
79485
|
"deprecationMessage": "",
|
|
79486
79486
|
"type": "",
|
|
79487
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button #trigger cdsButton=\"primary\" (click)=\"open = true\">Open</button>\n\t\t<cds-modal [open]=\"open\" [trigger]=\"trigger\" (overlaySelected)=\"open = false\">\n\t\t\t<cds-modal-header (closeSelect)=\"open = false\" [showCloseButton]=\"showCloseButton\">\n\t\t\t\t<p class=\"cds--modal-header__label cds--type-delta\">No service required</p>\n\t\t\t\t<p class=\"cds--modal-header__heading cds--type-beta\">A very simple modal</p>\n\t\t\t</cds-modal-header>\n\t\t\t<div class=\"cds--modal-content\">\n\t\t\t\t<p>hello world</p>\n\t\t\t</div>\n\t\t\t<cds-modal-footer>\n\t\t\t\t<ng-container>\n\t\t\t\t\t<button\n\t\t\t\t\t\tcdsButton=\"primary\"\n\t\t\t\t\t\t(click)=\"open = false\"\n\t\t\t\t\t\t[attr.modal-primary-focus]=\"true\">\n\t\t\t\t\t\tOkay\n\t\t\t\t\t</button>\n\t\t\t\t</ng-container>\n\t\t\t</cds-modal-footer>\n\t\t</cds-modal>\n\t`\n})"
|
|
79487
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button #trigger cdsButton=\"primary\" (click)=\"open = true\">Open</button>\n\t\t<cds-modal [open]=\"open\" [trigger]=\"trigger\" (overlaySelected)=\"open = false\" (close)=\"open = false\">\n\t\t\t<cds-modal-header (closeSelect)=\"open = false\" [showCloseButton]=\"showCloseButton\">\n\t\t\t\t<p class=\"cds--modal-header__label cds--type-delta\">No service required</p>\n\t\t\t\t<p class=\"cds--modal-header__heading cds--type-beta\">A very simple modal</p>\n\t\t\t</cds-modal-header>\n\t\t\t<div class=\"cds--modal-content\">\n\t\t\t\t<p>hello world</p>\n\t\t\t</div>\n\t\t\t<cds-modal-footer>\n\t\t\t\t<ng-container>\n\t\t\t\t\t<button\n\t\t\t\t\t\tcdsButton=\"primary\"\n\t\t\t\t\t\t(click)=\"open = false\"\n\t\t\t\t\t\t[attr.modal-primary-focus]=\"true\">\n\t\t\t\t\t\tOkay\n\t\t\t\t\t</button>\n\t\t\t\t</ng-container>\n\t\t\t</cds-modal-footer>\n\t\t</cds-modal>\n\t`\n})"
|
|
79488
79488
|
},
|
|
79489
79489
|
{
|
|
79490
79490
|
"name": "Template",
|