carbon-components-angular 5.27.1 → 5.27.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/components/SideNavItem.html +42 -28
- package/docs/documentation/components/TreeNodeComponent.html +81 -47
- package/docs/documentation/components/TreeViewComponent.html +145 -28
- package/docs/documentation/coverage.html +7 -7
- package/docs/documentation/interfaces/Node.html +47 -1
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/documentation.json +151 -93
- package/docs/storybook/{3348.03939d46.iframe.bundle.js → 3348.542f8c47.iframe.bundle.js} +1 -1
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/main.8aa17fcd.iframe.bundle.js +1 -0
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/{runtime~main.719f5f81.iframe.bundle.js → runtime~main.f8a93a5f.iframe.bundle.js} +1 -1
- package/docs/storybook/{treeview-treeview-stories.325fff71.iframe.bundle.js → treeview-treeview-stories.0b6b2e75.iframe.bundle.js} +1 -1
- package/esm2020/treeview/tree-node.component.mjs +16 -5
- package/esm2020/treeview/tree-node.types.mjs +1 -1
- package/esm2020/treeview/treeview.component.mjs +21 -6
- package/esm2020/ui-shell/sidenav/sidenav-item.component.mjs +19 -5
- package/fesm2015/carbon-components-angular-treeview.mjs +35 -9
- package/fesm2015/carbon-components-angular-treeview.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-ui-shell.mjs +18 -4
- package/fesm2015/carbon-components-angular-ui-shell.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-treeview.mjs +34 -8
- package/fesm2020/carbon-components-angular-treeview.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-ui-shell.mjs +18 -4
- package/fesm2020/carbon-components-angular-ui-shell.mjs.map +1 -1
- package/package.json +1 -1
- package/treeview/tree-node.component.d.ts +2 -1
- package/treeview/tree-node.types.d.ts +1 -0
- package/treeview/treeview.component.d.ts +6 -1
- package/docs/storybook/main.830d907f.iframe.bundle.js +0 -1
package/docs/documentation.json
CHANGED
|
@@ -1077,12 +1077,12 @@
|
|
|
1077
1077
|
},
|
|
1078
1078
|
{
|
|
1079
1079
|
"name": "Node",
|
|
1080
|
-
"id": "interface-Node-
|
|
1080
|
+
"id": "interface-Node-f154b580d651666245c94b5a699d661a10636f6b5c829c3bd10c0d22bc6ddf306f8c98b872b88f046ba3bc37e3ebfaf31b9437fb5a5ab3bb366bb8bfb90451e0",
|
|
1081
1081
|
"file": "src/treeview/tree-node.types.ts",
|
|
1082
1082
|
"deprecated": false,
|
|
1083
1083
|
"deprecationMessage": "",
|
|
1084
1084
|
"type": "interface",
|
|
1085
|
-
"sourceCode": "import { TemplateRef } from \"@angular/core\";\n\nexport interface Node {\n\tlabel: string | TemplateRef<any>;\n\tvalue?: any;\n\tid?: string;\n\tactive?: boolean;\n\tdisabled?: boolean;\n\texpanded?: boolean;\n\tselected?: boolean;\n\ticon?: string | TemplateRef<any>;\n\tchildren?: Node[];\n\t[key: string]: any;\n}\n",
|
|
1085
|
+
"sourceCode": "import { TemplateRef } from \"@angular/core\";\n\nexport interface Node {\n\tlabel: string | TemplateRef<any>;\n\tvalue?: any;\n\tid?: string;\n\tactive?: boolean;\n\tdisabled?: boolean;\n\texpanded?: boolean;\n\tselected?: boolean;\n\ticon?: string | TemplateRef<any>;\n\ticonContext?: any;\n\tchildren?: Node[];\n\t[key: string]: any;\n}\n",
|
|
1086
1086
|
"properties": [
|
|
1087
1087
|
{
|
|
1088
1088
|
"name": "active",
|
|
@@ -1100,7 +1100,7 @@
|
|
|
1100
1100
|
"type": "Node[]",
|
|
1101
1101
|
"optional": true,
|
|
1102
1102
|
"description": "",
|
|
1103
|
-
"line":
|
|
1103
|
+
"line": 13
|
|
1104
1104
|
},
|
|
1105
1105
|
{
|
|
1106
1106
|
"name": "disabled",
|
|
@@ -1129,6 +1129,15 @@
|
|
|
1129
1129
|
"description": "",
|
|
1130
1130
|
"line": 11
|
|
1131
1131
|
},
|
|
1132
|
+
{
|
|
1133
|
+
"name": "iconContext",
|
|
1134
|
+
"deprecated": false,
|
|
1135
|
+
"deprecationMessage": "",
|
|
1136
|
+
"type": "any",
|
|
1137
|
+
"optional": true,
|
|
1138
|
+
"description": "",
|
|
1139
|
+
"line": 12
|
|
1140
|
+
},
|
|
1132
1141
|
{
|
|
1133
1142
|
"name": "id",
|
|
1134
1143
|
"deprecated": false,
|
|
@@ -1168,7 +1177,7 @@
|
|
|
1168
1177
|
],
|
|
1169
1178
|
"indexSignatures": [
|
|
1170
1179
|
{
|
|
1171
|
-
"id": "index-declaration-
|
|
1180
|
+
"id": "index-declaration-f154b580d651666245c94b5a699d661a10636f6b5c829c3bd10c0d22bc6ddf306f8c98b872b88f046ba3bc37e3ebfaf31b9437fb5a5ab3bb366bb8bfb90451e0",
|
|
1172
1181
|
"args": [
|
|
1173
1182
|
{
|
|
1174
1183
|
"name": "key",
|
|
@@ -1178,7 +1187,7 @@
|
|
|
1178
1187
|
}
|
|
1179
1188
|
],
|
|
1180
1189
|
"returnType": "any",
|
|
1181
|
-
"line":
|
|
1190
|
+
"line": 13,
|
|
1182
1191
|
"deprecated": false,
|
|
1183
1192
|
"deprecationMessage": ""
|
|
1184
1193
|
}
|
|
@@ -48783,7 +48792,7 @@
|
|
|
48783
48792
|
},
|
|
48784
48793
|
{
|
|
48785
48794
|
"name": "SideNavItem",
|
|
48786
|
-
"id": "component-SideNavItem-
|
|
48795
|
+
"id": "component-SideNavItem-4ee73859c5cb9524fc3b4aa56cccdc688c59ba72c7a1f463dd3735971000f5c0e12635a8336943a8f922bd7b49e9effffb0e7db1b82f92cf830d1c7ea5b076fc",
|
|
48787
48796
|
"file": "src/ui-shell/sidenav/sidenav-item.component.ts",
|
|
48788
48797
|
"encapsulation": [],
|
|
48789
48798
|
"entryComponents": [],
|
|
@@ -48795,7 +48804,7 @@
|
|
|
48795
48804
|
"styles": [
|
|
48796
48805
|
"\n\t\t:host {\n\t\t\tdisplay: list-item;\n\t\t}\n\t"
|
|
48797
48806
|
],
|
|
48798
|
-
"template": "<a *ngIf=\"!useRouter; else sidenavItemRouterTpl\"\n\tclass=\"cds--side-nav__link\"\n\t[ngClass]=\"{\n\t\t'cds--side-nav__item--active': active\n\t}\"\n\t[href]=\"href\"\n\t[attr.aria-current]=\"(active ? 'page' : null)\"\n\t[attr.title]=\"title ? title : null\"\n\t(click)=\"navigate($event)\">\n\t<ng-template [ngTemplateOutlet]=\"sidenavItemContentTpl\"></ng-template>\n</a>\n\n<ng-template #sidenavItemRouterTpl>\n\t<a\n\t\t[routerLink]=\"route\"\n\t\
|
|
48807
|
+
"template": "<a *ngIf=\"!useRouter; else sidenavItemRouterTpl\"\n\tclass=\"cds--side-nav__link\"\n\t[ngClass]=\"{\n\t\t'cds--side-nav__item--active': active\n\t}\"\n\t[href]=\"href\"\n\t[attr.aria-current]=\"(active ? 'page' : null)\"\n\t[attr.title]=\"title ? title : null\"\n\t(click)=\"navigate($event)\">\n\t<ng-template [ngTemplateOutlet]=\"sidenavItemContentTpl\"></ng-template>\n</a>\n\n<ng-template #sidenavItemRouterTpl>\n\t<a\n\t\t[attr.title]=\"title ? title : null\"\n\t\t[routerLink]=\"route\"\n\t\t\t[relativeTo]=\"routeExtras?.relativeTo\"\n\t\t[queryParams]=\"routeExtras?.queryParams\"\n\t\t[fragment]=\"routeExtras?.fragment\"\n\t\t[queryParamsHandling]=\"routeExtras?.queryParamsHandling\"\n\t\t[preserveFragment]=\"routeExtras?.preserveFragment\"\n\t\t[skipLocationChange]=\"routeExtras?.skipLocationChange\"\n\t\t[replaceUrl]=\"routeExtras?.replaceUrl\"\n\t\t[state]=\"routeExtras?.state\"\n\t\trouterLinkActive=\"cds--side-nav__item--active\"\n\t\tariaCurrentWhenActive=\"page\"\n\t\tclass=\"cds--side-nav__link\">\n\t\t<ng-template [ngTemplateOutlet]=\"sidenavItemContentTpl\"></ng-template>\n\t</a>\n</ng-template>\n\n<ng-template #sidenavItemContentTpl>\n\t<div *ngIf=\"!isSubMenu\" class=\"cds--side-nav__icon\">\n\t\t<ng-content select=\"svg, [icon]\"></ng-content>\n\t</div>\n\t<span class=\"cds--side-nav__link-text\">\n\t\t<ng-content></ng-content>\n\t</span>\n</ng-template>\n\t",
|
|
48799
48808
|
"templateUrl": [],
|
|
48800
48809
|
"viewProviders": [],
|
|
48801
48810
|
"hostDirectives": [],
|
|
@@ -48807,7 +48816,7 @@
|
|
|
48807
48816
|
"deprecationMessage": "",
|
|
48808
48817
|
"rawdescription": "\n\nToggles the active (current page) state for the link.\n",
|
|
48809
48818
|
"description": "<p>Toggles the active (current page) state for the link.</p>\n",
|
|
48810
|
-
"line":
|
|
48819
|
+
"line": 98,
|
|
48811
48820
|
"type": "boolean",
|
|
48812
48821
|
"decorators": []
|
|
48813
48822
|
},
|
|
@@ -48817,7 +48826,7 @@
|
|
|
48817
48826
|
"deprecationMessage": "",
|
|
48818
48827
|
"rawdescription": "\n\nLink for the item. NOTE: *do not* pass unsafe or untrusted values, this has the potential to open you up to XSS attacks\n",
|
|
48819
48828
|
"description": "<p>Link for the item. NOTE: <em>do not</em> pass unsafe or untrusted values, this has the potential to open you up to XSS attacks</p>\n",
|
|
48820
|
-
"line":
|
|
48829
|
+
"line": 70,
|
|
48821
48830
|
"type": "string",
|
|
48822
48831
|
"decorators": []
|
|
48823
48832
|
},
|
|
@@ -48826,7 +48835,7 @@
|
|
|
48826
48835
|
"defaultValue": "false",
|
|
48827
48836
|
"deprecated": false,
|
|
48828
48837
|
"deprecationMessage": "",
|
|
48829
|
-
"line":
|
|
48838
|
+
"line": 106,
|
|
48830
48839
|
"type": "boolean",
|
|
48831
48840
|
"decorators": []
|
|
48832
48841
|
},
|
|
@@ -48836,7 +48845,7 @@
|
|
|
48836
48845
|
"deprecationMessage": "",
|
|
48837
48846
|
"rawdescription": "\n\nArray of commands to send to the router when the link is activated\nSee: https://angular.io/api/router/Router#navigate\n",
|
|
48838
48847
|
"description": "<p>Array of commands to send to the router when the link is activated\nSee: <a href=\"https://angular.io/api/router/Router#navigate\">https://angular.io/api/router/Router#navigate</a></p>\n",
|
|
48839
|
-
"line":
|
|
48848
|
+
"line": 104,
|
|
48840
48849
|
"type": "any[]",
|
|
48841
48850
|
"decorators": []
|
|
48842
48851
|
},
|
|
@@ -48846,7 +48855,7 @@
|
|
|
48846
48855
|
"deprecationMessage": "",
|
|
48847
48856
|
"rawdescription": "\n\nRouter options. Used in conjunction with `route`\nSee: https://angular.io/api/router/Router#navigate\n",
|
|
48848
48857
|
"description": "<p>Router options. Used in conjunction with <code>route</code>\nSee: <a href=\"https://angular.io/api/router/Router#navigate\">https://angular.io/api/router/Router#navigate</a></p>\n",
|
|
48849
|
-
"line":
|
|
48858
|
+
"line": 112,
|
|
48850
48859
|
"type": "any",
|
|
48851
48860
|
"decorators": []
|
|
48852
48861
|
},
|
|
@@ -48856,7 +48865,7 @@
|
|
|
48856
48865
|
"deprecationMessage": "",
|
|
48857
48866
|
"rawdescription": "\n\nTitle attribute of the anchor element.\n",
|
|
48858
48867
|
"description": "<p>Title attribute of the anchor element.</p>\n",
|
|
48859
|
-
"line":
|
|
48868
|
+
"line": 117,
|
|
48860
48869
|
"type": "string",
|
|
48861
48870
|
"decorators": []
|
|
48862
48871
|
},
|
|
@@ -48867,7 +48876,7 @@
|
|
|
48867
48876
|
"deprecationMessage": "",
|
|
48868
48877
|
"rawdescription": "\n\nUse the routerLink attribute on <a> tag for navigation instead of using event handlers\n",
|
|
48869
48878
|
"description": "<p>Use the routerLink attribute on <a> tag for navigation instead of using event handlers</p>\n",
|
|
48870
|
-
"line":
|
|
48879
|
+
"line": 85,
|
|
48871
48880
|
"type": "boolean",
|
|
48872
48881
|
"decorators": []
|
|
48873
48882
|
}
|
|
@@ -48880,7 +48889,7 @@
|
|
|
48880
48889
|
"deprecationMessage": "",
|
|
48881
48890
|
"rawdescription": "\n\nEmits the navigation status promise when the link is activated\n",
|
|
48882
48891
|
"description": "<p>Emits the navigation status promise when the link is activated</p>\n",
|
|
48883
|
-
"line":
|
|
48892
|
+
"line": 122,
|
|
48884
48893
|
"type": "EventEmitter"
|
|
48885
48894
|
},
|
|
48886
48895
|
{
|
|
@@ -48890,7 +48899,7 @@
|
|
|
48890
48899
|
"deprecationMessage": "",
|
|
48891
48900
|
"rawdescription": "\n\nEmits when `active` input is changed. This is mainly used to indicate to any parent menu items that a\nchild sidenav item is active or not active.\n",
|
|
48892
48901
|
"description": "<p>Emits when <code>active</code> input is changed. This is mainly used to indicate to any parent menu items that a\nchild sidenav item is active or not active.</p>\n",
|
|
48893
|
-
"line":
|
|
48902
|
+
"line": 128,
|
|
48894
48903
|
"type": "EventEmitter"
|
|
48895
48904
|
}
|
|
48896
48905
|
],
|
|
@@ -48903,7 +48912,7 @@
|
|
|
48903
48912
|
"type": "string",
|
|
48904
48913
|
"optional": false,
|
|
48905
48914
|
"description": "",
|
|
48906
|
-
"line":
|
|
48915
|
+
"line": 130,
|
|
48907
48916
|
"decorators": [
|
|
48908
48917
|
{
|
|
48909
48918
|
"name": "HostBinding",
|
|
@@ -48929,7 +48938,7 @@
|
|
|
48929
48938
|
"optional": false,
|
|
48930
48939
|
"returnType": "void",
|
|
48931
48940
|
"typeParameters": [],
|
|
48932
|
-
"line":
|
|
48941
|
+
"line": 142,
|
|
48933
48942
|
"deprecated": false,
|
|
48934
48943
|
"deprecationMessage": "",
|
|
48935
48944
|
"jsdoctags": [
|
|
@@ -48953,7 +48962,7 @@
|
|
|
48953
48962
|
"defaultValue": "\"listitem\"",
|
|
48954
48963
|
"deprecated": false,
|
|
48955
48964
|
"deprecationMessage": "",
|
|
48956
|
-
"line":
|
|
48965
|
+
"line": 130,
|
|
48957
48966
|
"type": "string",
|
|
48958
48967
|
"decorators": []
|
|
48959
48968
|
},
|
|
@@ -48961,7 +48970,7 @@
|
|
|
48961
48970
|
"name": "class.cds--side-nav__item",
|
|
48962
48971
|
"deprecated": false,
|
|
48963
48972
|
"deprecationMessage": "",
|
|
48964
|
-
"line":
|
|
48973
|
+
"line": 87,
|
|
48965
48974
|
"type": "boolean",
|
|
48966
48975
|
"decorators": []
|
|
48967
48976
|
},
|
|
@@ -48969,7 +48978,7 @@
|
|
|
48969
48978
|
"name": "class.cds--side-nav__menu-item",
|
|
48970
48979
|
"deprecated": false,
|
|
48971
48980
|
"deprecationMessage": "",
|
|
48972
|
-
"line":
|
|
48981
|
+
"line": 91,
|
|
48973
48982
|
"type": "boolean",
|
|
48974
48983
|
"decorators": []
|
|
48975
48984
|
}
|
|
@@ -48980,7 +48989,7 @@
|
|
|
48980
48989
|
"description": "<p><code>SideNavItem</code> can either be a child of <code>SideNav</code> or <code>SideNavMenu</code></p>\n",
|
|
48981
48990
|
"rawdescription": "\n\n`SideNavItem` can either be a child of `SideNav` or `SideNavMenu`\n",
|
|
48982
48991
|
"type": "component",
|
|
48983
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOptional,\n\tOutput,\n\tEventEmitter,\n\tOnChanges,\n\tHostBinding,\n\tSimpleChanges\n} from \"@angular/core\";\nimport { DomSanitizer } from \"@angular/platform-browser\";\nimport { Router } from \"@angular/router\";\n\n/**\n * `SideNavItem` can either be a child of `SideNav` or `SideNavMenu`\n */\n@Component({\n\tselector: \"cds-sidenav-item, ibm-sidenav-item\",\n\ttemplate: `\n\t\t<a *ngIf=\"!useRouter; else sidenavItemRouterTpl\"\n\t\t\tclass=\"cds--side-nav__link\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--side-nav__item--active': active\n\t\t\t}\"\n\t\t\t[href]=\"href\"\n\t\t\t[attr.aria-current]=\"(active ? 'page' : null)\"\n\t\t\t[attr.title]=\"title ? title : null\"\n\t\t\t(click)=\"navigate($event)\">\n\t\t\t<ng-template [ngTemplateOutlet]=\"sidenavItemContentTpl\"></ng-template>\n\t\t</a>\n\n\t\t<ng-template #sidenavItemRouterTpl>\n\t\t\t<a\n\t\t\t\t[routerLink]=\"route\"\n\t\t\t\
|
|
48992
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOptional,\n\tOutput,\n\tEventEmitter,\n\tOnChanges,\n\tHostBinding,\n\tSimpleChanges\n} from \"@angular/core\";\nimport { DomSanitizer } from \"@angular/platform-browser\";\nimport { Router } from \"@angular/router\";\n\n/**\n * `SideNavItem` can either be a child of `SideNav` or `SideNavMenu`\n */\n@Component({\n\tselector: \"cds-sidenav-item, ibm-sidenav-item\",\n\ttemplate: `\n\t\t<a *ngIf=\"!useRouter; else sidenavItemRouterTpl\"\n\t\t\tclass=\"cds--side-nav__link\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--side-nav__item--active': active\n\t\t\t}\"\n\t\t\t[href]=\"href\"\n\t\t\t[attr.aria-current]=\"(active ? 'page' : null)\"\n\t\t\t[attr.title]=\"title ? title : null\"\n\t\t\t(click)=\"navigate($event)\">\n\t\t\t<ng-template [ngTemplateOutlet]=\"sidenavItemContentTpl\"></ng-template>\n\t\t</a>\n\n\t\t<ng-template #sidenavItemRouterTpl>\n\t\t\t<a\n\t\t\t\t[attr.title]=\"title ? title : null\"\n\t\t\t\t[routerLink]=\"route\"\n \t\t\t\t[relativeTo]=\"routeExtras?.relativeTo\"\n\t\t\t\t[queryParams]=\"routeExtras?.queryParams\"\n\t\t\t\t[fragment]=\"routeExtras?.fragment\"\n\t\t\t\t[queryParamsHandling]=\"routeExtras?.queryParamsHandling\"\n\t\t\t\t[preserveFragment]=\"routeExtras?.preserveFragment\"\n\t\t\t\t[skipLocationChange]=\"routeExtras?.skipLocationChange\"\n\t\t\t\t[replaceUrl]=\"routeExtras?.replaceUrl\"\n\t\t\t\t[state]=\"routeExtras?.state\"\n\t\t\t\trouterLinkActive=\"cds--side-nav__item--active\"\n\t\t\t\tariaCurrentWhenActive=\"page\"\n\t\t\t\tclass=\"cds--side-nav__link\">\n\t\t\t\t<ng-template [ngTemplateOutlet]=\"sidenavItemContentTpl\"></ng-template>\n\t\t\t</a>\n\t\t</ng-template>\n\n\t\t<ng-template #sidenavItemContentTpl>\n\t\t\t<div *ngIf=\"!isSubMenu\" class=\"cds--side-nav__icon\">\n\t\t\t\t<ng-content select=\"svg, [icon]\"></ng-content>\n\t\t\t</div>\n\t\t\t<span class=\"cds--side-nav__link-text\">\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</span>\n\t\t</ng-template>\n\t`,\n\tstyles: [`\n\t\t:host {\n\t\t\tdisplay: list-item;\n\t\t}\n\t`]\n})\nexport class SideNavItem implements OnChanges {\n\t/**\n\t * Link for the item. NOTE: *do not* pass unsafe or untrusted values, this has the potential to open you up to XSS attacks\n\t */\n\t@Input() set href(v: string) {\n\t\t// Needed when component is created dynamically with a model.\n\t\tif (v === undefined) {\n\t\t\treturn;\n\t\t}\n\t\tthis._href = v;\n\t}\n\n\tget href() {\n\t\treturn this.domSanitizer.bypassSecurityTrustUrl(this._href) as string;\n\t}\n\n\t/**\n\t * Use the routerLink attribute on <a> tag for navigation instead of using event handlers\n\t */\n\t@Input() useRouter = false;\n\n\t@HostBinding(\"class.cds--side-nav__item\") get sideNav() {\n\t\treturn !this.isSubMenu;\n\t}\n\n\t@HostBinding(\"class.cds--side-nav__menu-item\") get menuItem() {\n\t\treturn this.isSubMenu;\n\t}\n\n\t/**\n\t * Toggles the active (current page) state for the link.\n\t */\n\t@Input() active = false;\n\n\t/**\n\t * Array of commands to send to the router when the link is activated\n\t * See: https://angular.io/api/router/Router#navigate\n\t */\n\t@Input() route: any[];\n\n\t@Input() isSubMenu = false;\n\n\t/**\n\t * Router options. Used in conjunction with `route`\n\t * See: https://angular.io/api/router/Router#navigate\n\t */\n\t@Input() routeExtras: any;\n\n\t/**\n\t * Title attribute of the anchor element.\n\t */\n\t@Input() title: string;\n\n\t/**\n\t * Emits the navigation status promise when the link is activated\n\t */\n\t@Output() navigation = new EventEmitter<Promise<boolean>>();\n\n\t/**\n\t * Emits when `active` input is changed. This is mainly used to indicate to any parent menu items that a\n\t * child sidenav item is active or not active.\n\t */\n\t@Output() selected = new EventEmitter<boolean>();\n\n\t@HostBinding(\"attr.role\") role = \"listitem\";\n\n\tprotected _href = \"#\";\n\n\tconstructor(protected domSanitizer: DomSanitizer, @Optional() protected router: Router) {}\n\n\tngOnChanges(changes: SimpleChanges) {\n\t\tif (changes.active) {\n\t\t\tthis.selected.emit(this.active);\n\t\t}\n\t}\n\n\tnavigate(event: MouseEvent) {\n\t\tif (this.router && this.route) {\n\t\t\tevent.preventDefault();\n\t\t\tconst status = this.router.navigate(this.route, this.routeExtras);\n\t\t\tthis.navigation.emit(status);\n\t\t} else if (this._href === \"#\") {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n}\n",
|
|
48984
48993
|
"assetsDirs": [],
|
|
48985
48994
|
"styleUrlsData": "",
|
|
48986
48995
|
"stylesData": "\n\t\t:host {\n\t\t\tdisplay: list-item;\n\t\t}\n\t\n",
|
|
@@ -49003,7 +49012,7 @@
|
|
|
49003
49012
|
"deprecationMessage": ""
|
|
49004
49013
|
}
|
|
49005
49014
|
],
|
|
49006
|
-
"line":
|
|
49015
|
+
"line": 132,
|
|
49007
49016
|
"jsdoctags": [
|
|
49008
49017
|
{
|
|
49009
49018
|
"name": "domSanitizer",
|
|
@@ -49046,7 +49055,7 @@
|
|
|
49046
49055
|
}
|
|
49047
49056
|
],
|
|
49048
49057
|
"returnType": "void",
|
|
49049
|
-
"line":
|
|
49058
|
+
"line": 70,
|
|
49050
49059
|
"rawdescription": "\n\nLink for the item. NOTE: *do not* pass unsafe or untrusted values, this has the potential to open you up to XSS attacks\n",
|
|
49051
49060
|
"description": "<p>Link for the item. NOTE: <em>do not</em> pass unsafe or untrusted values, this has the potential to open you up to XSS attacks</p>\n",
|
|
49052
49061
|
"jsdoctags": [
|
|
@@ -49065,7 +49074,7 @@
|
|
|
49065
49074
|
"name": "href",
|
|
49066
49075
|
"type": "",
|
|
49067
49076
|
"returnType": "",
|
|
49068
|
-
"line":
|
|
49077
|
+
"line": 78
|
|
49069
49078
|
}
|
|
49070
49079
|
},
|
|
49071
49080
|
"sideNav": {
|
|
@@ -49074,7 +49083,7 @@
|
|
|
49074
49083
|
"name": "sideNav",
|
|
49075
49084
|
"type": "",
|
|
49076
49085
|
"returnType": "",
|
|
49077
|
-
"line":
|
|
49086
|
+
"line": 87
|
|
49078
49087
|
}
|
|
49079
49088
|
},
|
|
49080
49089
|
"menuItem": {
|
|
@@ -49083,7 +49092,7 @@
|
|
|
49083
49092
|
"name": "menuItem",
|
|
49084
49093
|
"type": "",
|
|
49085
49094
|
"returnType": "",
|
|
49086
|
-
"line":
|
|
49095
|
+
"line": 91
|
|
49087
49096
|
}
|
|
49088
49097
|
}
|
|
49089
49098
|
}
|
|
@@ -66328,7 +66337,7 @@
|
|
|
66328
66337
|
},
|
|
66329
66338
|
{
|
|
66330
66339
|
"name": "TreeNodeComponent",
|
|
66331
|
-
"id": "component-TreeNodeComponent-
|
|
66340
|
+
"id": "component-TreeNodeComponent-9d63a1728fca50659f4d28ba6b47f934363b54a663cac55c2ed8ffdfc7d6c68d4dac6dba040b1cd4b8c1abfd7142a39c2cbc0e8baebbc905324e09f12bf6f462",
|
|
66332
66341
|
"file": "src/treeview/tree-node.component.ts",
|
|
66333
66342
|
"encapsulation": [],
|
|
66334
66343
|
"entryComponents": [],
|
|
@@ -66338,7 +66347,7 @@
|
|
|
66338
66347
|
"selector": "cds-tree-node",
|
|
66339
66348
|
"styleUrls": [],
|
|
66340
66349
|
"styles": [],
|
|
66341
|
-
"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{{label}}\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
|
|
66350
|
+
"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{{label}}\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{{label}}\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",
|
|
66342
66351
|
"templateUrl": [],
|
|
66343
66352
|
"viewProviders": [],
|
|
66344
66353
|
"hostDirectives": [],
|
|
@@ -66348,7 +66357,7 @@
|
|
|
66348
66357
|
"defaultValue": "false",
|
|
66349
66358
|
"deprecated": false,
|
|
66350
66359
|
"deprecationMessage": "",
|
|
66351
|
-
"line":
|
|
66360
|
+
"line": 113,
|
|
66352
66361
|
"type": "boolean",
|
|
66353
66362
|
"decorators": []
|
|
66354
66363
|
},
|
|
@@ -66357,7 +66366,7 @@
|
|
|
66357
66366
|
"defaultValue": "[]",
|
|
66358
66367
|
"deprecated": false,
|
|
66359
66368
|
"deprecationMessage": "",
|
|
66360
|
-
"line":
|
|
66369
|
+
"line": 121,
|
|
66361
66370
|
"type": "Node[]",
|
|
66362
66371
|
"decorators": []
|
|
66363
66372
|
},
|
|
@@ -66368,7 +66377,7 @@
|
|
|
66368
66377
|
"deprecationMessage": "",
|
|
66369
66378
|
"rawdescription": "\n\nDetermines the depth of the node\nCalculated by default when passing `Node` array to `TreeViewComponent`, manual entry required otherwise\n",
|
|
66370
66379
|
"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",
|
|
66371
|
-
"line":
|
|
66380
|
+
"line": 127,
|
|
66372
66381
|
"type": "number",
|
|
66373
66382
|
"decorators": []
|
|
66374
66383
|
},
|
|
@@ -66377,7 +66386,7 @@
|
|
|
66377
66386
|
"defaultValue": "false",
|
|
66378
66387
|
"deprecated": false,
|
|
66379
66388
|
"deprecationMessage": "",
|
|
66380
|
-
"line":
|
|
66389
|
+
"line": 114,
|
|
66381
66390
|
"type": "boolean",
|
|
66382
66391
|
"decorators": []
|
|
66383
66392
|
},
|
|
@@ -66386,7 +66395,7 @@
|
|
|
66386
66395
|
"defaultValue": "false",
|
|
66387
66396
|
"deprecated": false,
|
|
66388
66397
|
"deprecationMessage": "",
|
|
66389
|
-
"line":
|
|
66398
|
+
"line": 115,
|
|
66390
66399
|
"type": "boolean",
|
|
66391
66400
|
"decorators": []
|
|
66392
66401
|
},
|
|
@@ -66394,16 +66403,24 @@
|
|
|
66394
66403
|
"name": "icon",
|
|
66395
66404
|
"deprecated": false,
|
|
66396
66405
|
"deprecationMessage": "",
|
|
66397
|
-
"line":
|
|
66406
|
+
"line": 119,
|
|
66398
66407
|
"type": "string | TemplateRef<any>",
|
|
66399
66408
|
"decorators": []
|
|
66400
66409
|
},
|
|
66410
|
+
{
|
|
66411
|
+
"name": "iconContext",
|
|
66412
|
+
"deprecated": false,
|
|
66413
|
+
"deprecationMessage": "",
|
|
66414
|
+
"line": 120,
|
|
66415
|
+
"type": "any",
|
|
66416
|
+
"decorators": []
|
|
66417
|
+
},
|
|
66401
66418
|
{
|
|
66402
66419
|
"name": "id",
|
|
66403
66420
|
"defaultValue": "`tree-node-${TreeNodeComponent.treeNodeCount++}`",
|
|
66404
66421
|
"deprecated": false,
|
|
66405
66422
|
"deprecationMessage": "",
|
|
66406
|
-
"line":
|
|
66423
|
+
"line": 112,
|
|
66407
66424
|
"type": "string",
|
|
66408
66425
|
"decorators": []
|
|
66409
66426
|
},
|
|
@@ -66411,7 +66428,7 @@
|
|
|
66411
66428
|
"name": "label",
|
|
66412
66429
|
"deprecated": false,
|
|
66413
66430
|
"deprecationMessage": "",
|
|
66414
|
-
"line":
|
|
66431
|
+
"line": 116,
|
|
66415
66432
|
"type": "string | TemplateRef<any>",
|
|
66416
66433
|
"decorators": []
|
|
66417
66434
|
},
|
|
@@ -66421,7 +66438,7 @@
|
|
|
66421
66438
|
"deprecationMessage": "",
|
|
66422
66439
|
"rawdescription": "\n\nSimple way to set all attributes of Node component via node object\nWould simplify setting component attributes when dynamically rendering node.\n",
|
|
66423
66440
|
"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",
|
|
66424
|
-
"line":
|
|
66441
|
+
"line": 133,
|
|
66425
66442
|
"type": "Node",
|
|
66426
66443
|
"decorators": []
|
|
66427
66444
|
},
|
|
@@ -66430,7 +66447,7 @@
|
|
|
66430
66447
|
"defaultValue": "false",
|
|
66431
66448
|
"deprecated": false,
|
|
66432
66449
|
"deprecationMessage": "",
|
|
66433
|
-
"line":
|
|
66450
|
+
"line": 117,
|
|
66434
66451
|
"type": "boolean",
|
|
66435
66452
|
"decorators": []
|
|
66436
66453
|
},
|
|
@@ -66438,7 +66455,7 @@
|
|
|
66438
66455
|
"name": "value",
|
|
66439
66456
|
"deprecated": false,
|
|
66440
66457
|
"deprecationMessage": "",
|
|
66441
|
-
"line":
|
|
66458
|
+
"line": 118,
|
|
66442
66459
|
"type": "any",
|
|
66443
66460
|
"decorators": []
|
|
66444
66461
|
}
|
|
@@ -66449,7 +66466,7 @@
|
|
|
66449
66466
|
"defaultValue": "new EventEmitter()",
|
|
66450
66467
|
"deprecated": false,
|
|
66451
66468
|
"deprecationMessage": "",
|
|
66452
|
-
"line":
|
|
66469
|
+
"line": 154,
|
|
66453
66470
|
"type": "EventEmitter"
|
|
66454
66471
|
},
|
|
66455
66472
|
{
|
|
@@ -66457,7 +66474,7 @@
|
|
|
66457
66474
|
"defaultValue": "new EventEmitter()",
|
|
66458
66475
|
"deprecated": false,
|
|
66459
66476
|
"deprecationMessage": "",
|
|
66460
|
-
"line":
|
|
66477
|
+
"line": 153,
|
|
66461
66478
|
"type": "EventEmitter"
|
|
66462
66479
|
},
|
|
66463
66480
|
{
|
|
@@ -66465,7 +66482,7 @@
|
|
|
66465
66482
|
"defaultValue": "new EventEmitter()",
|
|
66466
66483
|
"deprecated": false,
|
|
66467
66484
|
"deprecationMessage": "",
|
|
66468
|
-
"line":
|
|
66485
|
+
"line": 155,
|
|
66469
66486
|
"type": "EventEmitter"
|
|
66470
66487
|
},
|
|
66471
66488
|
{
|
|
@@ -66473,7 +66490,7 @@
|
|
|
66473
66490
|
"defaultValue": "new EventEmitter()",
|
|
66474
66491
|
"deprecated": false,
|
|
66475
66492
|
"deprecationMessage": "",
|
|
66476
|
-
"line":
|
|
66493
|
+
"line": 156,
|
|
66477
66494
|
"type": "EventEmitter"
|
|
66478
66495
|
}
|
|
66479
66496
|
],
|
|
@@ -66485,7 +66502,7 @@
|
|
|
66485
66502
|
"type": "",
|
|
66486
66503
|
"optional": false,
|
|
66487
66504
|
"description": "",
|
|
66488
|
-
"line":
|
|
66505
|
+
"line": 158
|
|
66489
66506
|
},
|
|
66490
66507
|
{
|
|
66491
66508
|
"name": "treeNodeCount",
|
|
@@ -66495,7 +66512,7 @@
|
|
|
66495
66512
|
"type": "number",
|
|
66496
66513
|
"optional": false,
|
|
66497
66514
|
"description": "",
|
|
66498
|
-
"line":
|
|
66515
|
+
"line": 111,
|
|
66499
66516
|
"modifierKind": [
|
|
66500
66517
|
126
|
|
66501
66518
|
]
|
|
@@ -66508,7 +66525,7 @@
|
|
|
66508
66525
|
"optional": false,
|
|
66509
66526
|
"returnType": "number",
|
|
66510
66527
|
"typeParameters": [],
|
|
66511
|
-
"line":
|
|
66528
|
+
"line": 207,
|
|
66512
66529
|
"deprecated": false,
|
|
66513
66530
|
"deprecationMessage": "",
|
|
66514
66531
|
"rawdescription": "\n\nCalculate the node offset\n",
|
|
@@ -66516,8 +66533,8 @@
|
|
|
66516
66533
|
"jsdoctags": [
|
|
66517
66534
|
{
|
|
66518
66535
|
"tagName": {
|
|
66519
|
-
"pos":
|
|
66520
|
-
"end":
|
|
66536
|
+
"pos": 5530,
|
|
66537
|
+
"end": 5537,
|
|
66521
66538
|
"flags": 16842752,
|
|
66522
66539
|
"modifierFlagsCache": 0,
|
|
66523
66540
|
"transformFlags": 0,
|
|
@@ -66541,7 +66558,7 @@
|
|
|
66541
66558
|
"optional": false,
|
|
66542
66559
|
"returnType": "void",
|
|
66543
66560
|
"typeParameters": [],
|
|
66544
|
-
"line":
|
|
66561
|
+
"line": 230,
|
|
66545
66562
|
"deprecated": false,
|
|
66546
66563
|
"deprecationMessage": "",
|
|
66547
66564
|
"jsdoctags": [
|
|
@@ -66569,7 +66586,7 @@
|
|
|
66569
66586
|
"optional": false,
|
|
66570
66587
|
"returnType": "void",
|
|
66571
66588
|
"typeParameters": [],
|
|
66572
|
-
"line":
|
|
66589
|
+
"line": 226,
|
|
66573
66590
|
"deprecated": false,
|
|
66574
66591
|
"deprecationMessage": "",
|
|
66575
66592
|
"jsdoctags": [
|
|
@@ -66590,7 +66607,7 @@
|
|
|
66590
66607
|
"optional": false,
|
|
66591
66608
|
"returnType": "any",
|
|
66592
66609
|
"typeParameters": [],
|
|
66593
|
-
"line":
|
|
66610
|
+
"line": 277,
|
|
66594
66611
|
"deprecated": false,
|
|
66595
66612
|
"deprecationMessage": "",
|
|
66596
66613
|
"modifierKind": [
|
|
@@ -66610,7 +66627,7 @@
|
|
|
66610
66627
|
"optional": false,
|
|
66611
66628
|
"returnType": "boolean",
|
|
66612
66629
|
"typeParameters": [],
|
|
66613
|
-
"line":
|
|
66630
|
+
"line": 273,
|
|
66614
66631
|
"deprecated": false,
|
|
66615
66632
|
"deprecationMessage": "",
|
|
66616
66633
|
"modifierKind": [
|
|
@@ -66641,7 +66658,7 @@
|
|
|
66641
66658
|
"optional": false,
|
|
66642
66659
|
"returnType": "void",
|
|
66643
66660
|
"typeParameters": [],
|
|
66644
|
-
"line":
|
|
66661
|
+
"line": 250,
|
|
66645
66662
|
"deprecated": false,
|
|
66646
66663
|
"deprecationMessage": "",
|
|
66647
66664
|
"rawdescription": "\n\nManages the keyboard accessibility for children expansion & selection\n",
|
|
@@ -66671,7 +66688,7 @@
|
|
|
66671
66688
|
"optional": false,
|
|
66672
66689
|
"returnType": "void",
|
|
66673
66690
|
"typeParameters": [],
|
|
66674
|
-
"line":
|
|
66691
|
+
"line": 193,
|
|
66675
66692
|
"deprecated": false,
|
|
66676
66693
|
"deprecationMessage": "",
|
|
66677
66694
|
"rawdescription": "\n\nSelects the node and emits the event from the tree view component\n",
|
|
@@ -66679,8 +66696,8 @@
|
|
|
66679
66696
|
"jsdoctags": [
|
|
66680
66697
|
{
|
|
66681
66698
|
"name": {
|
|
66682
|
-
"pos":
|
|
66683
|
-
"end":
|
|
66699
|
+
"pos": 5177,
|
|
66700
|
+
"end": 5182,
|
|
66684
66701
|
"flags": 16842752,
|
|
66685
66702
|
"modifierFlagsCache": 0,
|
|
66686
66703
|
"transformFlags": 0,
|
|
@@ -66691,8 +66708,8 @@
|
|
|
66691
66708
|
"deprecated": false,
|
|
66692
66709
|
"deprecationMessage": "",
|
|
66693
66710
|
"tagName": {
|
|
66694
|
-
"pos":
|
|
66695
|
-
"end":
|
|
66711
|
+
"pos": 5171,
|
|
66712
|
+
"end": 5176,
|
|
66696
66713
|
"flags": 16842752,
|
|
66697
66714
|
"modifierFlagsCache": 0,
|
|
66698
66715
|
"transformFlags": 0,
|
|
@@ -66716,7 +66733,7 @@
|
|
|
66716
66733
|
"optional": false,
|
|
66717
66734
|
"returnType": "void",
|
|
66718
66735
|
"typeParameters": [],
|
|
66719
|
-
"line":
|
|
66736
|
+
"line": 238,
|
|
66720
66737
|
"deprecated": false,
|
|
66721
66738
|
"deprecationMessage": "",
|
|
66722
66739
|
"rawdescription": "\n\nExpand children if not disabled\n",
|
|
@@ -66724,8 +66741,8 @@
|
|
|
66724
66741
|
"jsdoctags": [
|
|
66725
66742
|
{
|
|
66726
66743
|
"name": {
|
|
66727
|
-
"pos":
|
|
66728
|
-
"end":
|
|
66744
|
+
"pos": 6205,
|
|
66745
|
+
"end": 6210,
|
|
66729
66746
|
"flags": 16842752,
|
|
66730
66747
|
"modifierFlagsCache": 0,
|
|
66731
66748
|
"transformFlags": 0,
|
|
@@ -66736,8 +66753,8 @@
|
|
|
66736
66753
|
"deprecated": false,
|
|
66737
66754
|
"deprecationMessage": "",
|
|
66738
66755
|
"tagName": {
|
|
66739
|
-
"pos":
|
|
66740
|
-
"end":
|
|
66756
|
+
"pos": 6199,
|
|
66757
|
+
"end": 6204,
|
|
66741
66758
|
"flags": 16842752,
|
|
66742
66759
|
"modifierFlagsCache": 0,
|
|
66743
66760
|
"transformFlags": 0,
|
|
@@ -66758,7 +66775,7 @@
|
|
|
66758
66775
|
"description": "",
|
|
66759
66776
|
"rawdescription": "\n",
|
|
66760
66777
|
"type": "component",
|
|
66761
|
-
"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 { 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{{label}}\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
|
|
66778
|
+
"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 { 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{{label}}\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{{label}}\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() selected = false;\n\t@Input() value;\n\t@Input() icon: string | TemplateRef<any>;\n\t@Input() iconContext: any;\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.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.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 + 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",
|
|
66762
66779
|
"assetsDirs": [],
|
|
66763
66780
|
"styleUrlsData": "",
|
|
66764
66781
|
"stylesData": "",
|
|
@@ -66775,7 +66792,7 @@
|
|
|
66775
66792
|
"deprecationMessage": ""
|
|
66776
66793
|
}
|
|
66777
66794
|
],
|
|
66778
|
-
"line":
|
|
66795
|
+
"line": 160,
|
|
66779
66796
|
"jsdoctags": [
|
|
66780
66797
|
{
|
|
66781
66798
|
"name": "treeViewService",
|
|
@@ -66811,7 +66828,7 @@
|
|
|
66811
66828
|
}
|
|
66812
66829
|
],
|
|
66813
66830
|
"returnType": "void",
|
|
66814
|
-
"line":
|
|
66831
|
+
"line": 133,
|
|
66815
66832
|
"rawdescription": "\n\nSimple way to set all attributes of Node component via node object\nWould simplify setting component attributes when dynamically rendering node.\n",
|
|
66816
66833
|
"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",
|
|
66817
66834
|
"jsdoctags": [
|
|
@@ -66830,14 +66847,14 @@
|
|
|
66830
66847
|
"name": "node",
|
|
66831
66848
|
"type": "",
|
|
66832
66849
|
"returnType": "",
|
|
66833
|
-
"line":
|
|
66850
|
+
"line": 149
|
|
66834
66851
|
}
|
|
66835
66852
|
}
|
|
66836
66853
|
}
|
|
66837
66854
|
},
|
|
66838
66855
|
{
|
|
66839
66856
|
"name": "TreeViewComponent",
|
|
66840
|
-
"id": "component-TreeViewComponent-
|
|
66857
|
+
"id": "component-TreeViewComponent-70cc6386996a3d6c8b808d643f0a0f2b7a6c2cf15c42b972eabc637879f0bec0d1a80324b2f46d623a9c182bb0eba6d0dbd788e8e32b16649b8056dad9ee9e4b",
|
|
66841
66858
|
"file": "src/treeview/treeview.component.ts",
|
|
66842
66859
|
"encapsulation": [],
|
|
66843
66860
|
"entryComponents": [],
|
|
@@ -66852,7 +66869,7 @@
|
|
|
66852
66869
|
"selector": "cds-tree-view",
|
|
66853
66870
|
"styleUrls": [],
|
|
66854
66871
|
"styles": [],
|
|
66855
|
-
"template": "<label\n\t*ngIf=\"label\"\n\t[id]=\"id\"\n\tclass=\"cds--label\">\n\t{{label}}\n</label>\n<div\n\tclass=\"cds--tree\"\n\t[ngClass]=\"{\n\t\t'cds--tree--sm': size === 'sm',\n\t\t'cds--tree--xs': size === 'xs'\n\t}\"\n\t[attr.aria-label]=\"label ? label : null\"\n\t[attr.aria-labelledby]=\"!label ? id : null\"\n\t[attr.aria-multiselectable]=\"isMultiSelect || null\"\n\trole=\"tree\"\n\t(keydown)=\"navigateTree($event)\"\n\t#treeWrapper>\n\t<ng-container *ngIf=\"isProjected(); else notProjected\">\n\t\t<ng-content></ng-content>\n\t</ng-container>\n\t<ng-template #notProjected>\n\t\t<cds-tree-node\n\t\t\t*ngFor=\"let node of tree\"\n\t\t\t[node]=\"node\">\n\t\t</cds-tree-node>\n\t</ng-template>\n</div>\n\t",
|
|
66872
|
+
"template": "<label\n\t*ngIf=\"label\"\n\t[id]=\"id\"\n\tclass=\"cds--label\">\n\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t<ng-template\n\t\t*ngIf=\"isTemplate(label)\"\n\t\t[ngTemplateOutlet]=\"label\"\n\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t</ng-template>\n</label>\n<div\n\tclass=\"cds--tree\"\n\t[ngClass]=\"{\n\t\t'cds--tree--sm': size === 'sm',\n\t\t'cds--tree--xs': size === 'xs'\n\t}\"\n\t[attr.aria-label]=\"label ? label : null\"\n\t[attr.aria-labelledby]=\"!label ? id : null\"\n\t[attr.aria-multiselectable]=\"isMultiSelect || null\"\n\trole=\"tree\"\n\t(keydown)=\"navigateTree($event)\"\n\t#treeWrapper>\n\t<ng-container *ngIf=\"isProjected(); else notProjected\">\n\t\t<ng-content></ng-content>\n\t</ng-container>\n\t<ng-template #notProjected>\n\t\t<cds-tree-node\n\t\t\t*ngFor=\"let node of tree\"\n\t\t\t[node]=\"node\">\n\t\t</cds-tree-node>\n\t</ng-template>\n</div>\n\t",
|
|
66856
66873
|
"templateUrl": [],
|
|
66857
66874
|
"viewProviders": [],
|
|
66858
66875
|
"hostDirectives": [],
|
|
@@ -66862,7 +66879,7 @@
|
|
|
66862
66879
|
"defaultValue": "`tree-view-${TreeViewComponent.treeViewCount++}`",
|
|
66863
66880
|
"deprecated": false,
|
|
66864
66881
|
"deprecationMessage": "",
|
|
66865
|
-
"line":
|
|
66882
|
+
"line": 83,
|
|
66866
66883
|
"type": "string",
|
|
66867
66884
|
"decorators": []
|
|
66868
66885
|
},
|
|
@@ -66872,7 +66889,7 @@
|
|
|
66872
66889
|
"deprecationMessage": "",
|
|
66873
66890
|
"rawdescription": "\n\n**Experimental** - Enable to select multiple nodes\n",
|
|
66874
66891
|
"description": "<p><strong>Experimental</strong> - Enable to select multiple nodes</p>\n",
|
|
66875
|
-
"line":
|
|
66892
|
+
"line": 99,
|
|
66876
66893
|
"type": "boolean",
|
|
66877
66894
|
"decorators": []
|
|
66878
66895
|
},
|
|
@@ -66882,10 +66899,20 @@
|
|
|
66882
66899
|
"deprecationMessage": "",
|
|
66883
66900
|
"rawdescription": "\n\nTree view label\n",
|
|
66884
66901
|
"description": "<p>Tree view label</p>\n",
|
|
66885
|
-
"line":
|
|
66902
|
+
"line": 87,
|
|
66886
66903
|
"type": "string | TemplateRef<any>",
|
|
66887
66904
|
"decorators": []
|
|
66888
66905
|
},
|
|
66906
|
+
{
|
|
66907
|
+
"name": "labelContext",
|
|
66908
|
+
"deprecated": false,
|
|
66909
|
+
"deprecationMessage": "",
|
|
66910
|
+
"rawdescription": "\n\nOptional context for label if it's a template\n",
|
|
66911
|
+
"description": "<p>Optional context for label if it's a template</p>\n",
|
|
66912
|
+
"line": 91,
|
|
66913
|
+
"type": "any",
|
|
66914
|
+
"decorators": []
|
|
66915
|
+
},
|
|
66889
66916
|
{
|
|
66890
66917
|
"name": "size",
|
|
66891
66918
|
"defaultValue": "\"sm\"",
|
|
@@ -66893,7 +66920,7 @@
|
|
|
66893
66920
|
"deprecationMessage": "",
|
|
66894
66921
|
"rawdescription": "\n\nSpecify the size of the list items in the tree\n",
|
|
66895
66922
|
"description": "<p>Specify the size of the list items in the tree</p>\n",
|
|
66896
|
-
"line":
|
|
66923
|
+
"line": 95,
|
|
66897
66924
|
"type": "\"xs\" | \"sm\"",
|
|
66898
66925
|
"decorators": []
|
|
66899
66926
|
},
|
|
@@ -66903,7 +66930,7 @@
|
|
|
66903
66930
|
"deprecationMessage": "",
|
|
66904
66931
|
"rawdescription": "\n\nPass `Node[]` array to have tree view render the nodes\nPassing value will disregard projected content\n",
|
|
66905
66932
|
"description": "<p>Pass <code>Node[]</code> array to have tree view render the nodes\nPassing value will disregard projected content</p>\n",
|
|
66906
|
-
"line":
|
|
66933
|
+
"line": 72,
|
|
66907
66934
|
"type": "Node[]",
|
|
66908
66935
|
"decorators": []
|
|
66909
66936
|
}
|
|
@@ -66914,7 +66941,7 @@
|
|
|
66914
66941
|
"defaultValue": "new EventEmitter<Node | Node[]>()",
|
|
66915
66942
|
"deprecated": false,
|
|
66916
66943
|
"deprecationMessage": "",
|
|
66917
|
-
"line":
|
|
66944
|
+
"line": 103,
|
|
66918
66945
|
"type": "EventEmitter"
|
|
66919
66946
|
}
|
|
66920
66947
|
],
|
|
@@ -66926,7 +66953,7 @@
|
|
|
66926
66953
|
"type": "ElementRef",
|
|
66927
66954
|
"optional": false,
|
|
66928
66955
|
"description": "",
|
|
66929
|
-
"line":
|
|
66956
|
+
"line": 104,
|
|
66930
66957
|
"decorators": [
|
|
66931
66958
|
{
|
|
66932
66959
|
"name": "ViewChild",
|
|
@@ -66945,7 +66972,7 @@
|
|
|
66945
66972
|
"type": "number",
|
|
66946
66973
|
"optional": false,
|
|
66947
66974
|
"description": "",
|
|
66948
|
-
"line":
|
|
66975
|
+
"line": 81,
|
|
66949
66976
|
"modifierKind": [
|
|
66950
66977
|
126
|
|
66951
66978
|
]
|
|
@@ -66958,13 +66985,44 @@
|
|
|
66958
66985
|
"optional": false,
|
|
66959
66986
|
"returnType": "any",
|
|
66960
66987
|
"typeParameters": [],
|
|
66961
|
-
"line":
|
|
66988
|
+
"line": 170,
|
|
66962
66989
|
"deprecated": false,
|
|
66963
66990
|
"deprecationMessage": "",
|
|
66964
66991
|
"modifierKind": [
|
|
66965
66992
|
125
|
|
66966
66993
|
]
|
|
66967
66994
|
},
|
|
66995
|
+
{
|
|
66996
|
+
"name": "isTemplate",
|
|
66997
|
+
"args": [
|
|
66998
|
+
{
|
|
66999
|
+
"name": "value",
|
|
67000
|
+
"type": "",
|
|
67001
|
+
"deprecated": false,
|
|
67002
|
+
"deprecationMessage": ""
|
|
67003
|
+
}
|
|
67004
|
+
],
|
|
67005
|
+
"optional": false,
|
|
67006
|
+
"returnType": "boolean",
|
|
67007
|
+
"typeParameters": [],
|
|
67008
|
+
"line": 166,
|
|
67009
|
+
"deprecated": false,
|
|
67010
|
+
"deprecationMessage": "",
|
|
67011
|
+
"modifierKind": [
|
|
67012
|
+
125
|
|
67013
|
+
],
|
|
67014
|
+
"jsdoctags": [
|
|
67015
|
+
{
|
|
67016
|
+
"name": "value",
|
|
67017
|
+
"type": "",
|
|
67018
|
+
"deprecated": false,
|
|
67019
|
+
"deprecationMessage": "",
|
|
67020
|
+
"tagName": {
|
|
67021
|
+
"text": "param"
|
|
67022
|
+
}
|
|
67023
|
+
}
|
|
67024
|
+
]
|
|
67025
|
+
},
|
|
66968
67026
|
{
|
|
66969
67027
|
"name": "navigateTree",
|
|
66970
67028
|
"args": [
|
|
@@ -66978,7 +67036,7 @@
|
|
|
66978
67036
|
"optional": false,
|
|
66979
67037
|
"returnType": "void",
|
|
66980
67038
|
"typeParameters": [],
|
|
66981
|
-
"line":
|
|
67039
|
+
"line": 156,
|
|
66982
67040
|
"deprecated": false,
|
|
66983
67041
|
"deprecationMessage": "",
|
|
66984
67042
|
"rawdescription": "\n\nNavigate tree using tree walker\n",
|
|
@@ -66986,8 +67044,8 @@
|
|
|
66986
67044
|
"jsdoctags": [
|
|
66987
67045
|
{
|
|
66988
67046
|
"name": {
|
|
66989
|
-
"pos":
|
|
66990
|
-
"end":
|
|
67047
|
+
"pos": 3993,
|
|
67048
|
+
"end": 3998,
|
|
66991
67049
|
"flags": 16842752,
|
|
66992
67050
|
"modifierFlagsCache": 0,
|
|
66993
67051
|
"transformFlags": 0,
|
|
@@ -66998,8 +67056,8 @@
|
|
|
66998
67056
|
"deprecated": false,
|
|
66999
67057
|
"deprecationMessage": "",
|
|
67000
67058
|
"tagName": {
|
|
67001
|
-
"pos":
|
|
67002
|
-
"end":
|
|
67059
|
+
"pos": 3987,
|
|
67060
|
+
"end": 3992,
|
|
67003
67061
|
"flags": 16842752,
|
|
67004
67062
|
"modifierFlagsCache": 0,
|
|
67005
67063
|
"transformFlags": 0,
|
|
@@ -67020,7 +67078,7 @@
|
|
|
67020
67078
|
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { TreeviewModule } from 'carbon-components-angular';</code></pre></div><p><a href=\"../../?path=/story/components-tree-view--basic\">See demo</a></p>\n",
|
|
67021
67079
|
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport { TreeviewModule } from 'carbon-components-angular';\n```\n\n[See demo](../../?path=/story/components-tree-view--basic)\n",
|
|
67022
67080
|
"type": "component",
|
|
67023
|
-
"sourceCode": "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{{label}}\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) => Object.assign({}, 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 * 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\tprotected 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 isProjected() {\n\t\treturn this.treeViewService.contentProjected;\n\t}\n}\n",
|
|
67081
|
+
"sourceCode": "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) => Object.assign({}, 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\tprotected 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",
|
|
67024
67082
|
"assetsDirs": [],
|
|
67025
67083
|
"styleUrlsData": "",
|
|
67026
67084
|
"stylesData": "",
|
|
@@ -67049,7 +67107,7 @@
|
|
|
67049
67107
|
"deprecationMessage": ""
|
|
67050
67108
|
}
|
|
67051
67109
|
],
|
|
67052
|
-
"line":
|
|
67110
|
+
"line": 108,
|
|
67053
67111
|
"jsdoctags": [
|
|
67054
67112
|
{
|
|
67055
67113
|
"name": "document",
|
|
@@ -67103,7 +67161,7 @@
|
|
|
67103
67161
|
}
|
|
67104
67162
|
],
|
|
67105
67163
|
"returnType": "void",
|
|
67106
|
-
"line":
|
|
67164
|
+
"line": 72,
|
|
67107
67165
|
"rawdescription": "\n\nPass `Node[]` array to have tree view render the nodes\nPassing value will disregard projected content\n",
|
|
67108
67166
|
"description": "<p>Pass <code>Node[]</code> array to have tree view render the nodes\nPassing value will disregard projected content</p>\n",
|
|
67109
67167
|
"jsdoctags": [
|
|
@@ -67122,7 +67180,7 @@
|
|
|
67122
67180
|
"name": "tree",
|
|
67123
67181
|
"type": "",
|
|
67124
67182
|
"returnType": "",
|
|
67125
|
-
"line":
|
|
67183
|
+
"line": 77
|
|
67126
67184
|
}
|
|
67127
67185
|
},
|
|
67128
67186
|
"isMultiSelect": {
|
|
@@ -67141,7 +67199,7 @@
|
|
|
67141
67199
|
}
|
|
67142
67200
|
],
|
|
67143
67201
|
"returnType": "void",
|
|
67144
|
-
"line":
|
|
67202
|
+
"line": 99,
|
|
67145
67203
|
"rawdescription": "\n\n**Experimental** - Enable to select multiple nodes\n",
|
|
67146
67204
|
"description": "<p><strong>Experimental</strong> - Enable to select multiple nodes</p>\n",
|
|
67147
67205
|
"jsdoctags": [
|
|
@@ -88477,8 +88535,8 @@
|
|
|
88477
88535
|
"type": "component",
|
|
88478
88536
|
"linktype": "component",
|
|
88479
88537
|
"name": "TreeNodeComponent",
|
|
88480
|
-
"coveragePercent":
|
|
88481
|
-
"coverageCount": "6/
|
|
88538
|
+
"coveragePercent": 21,
|
|
88539
|
+
"coverageCount": "6/28",
|
|
88482
88540
|
"status": "low"
|
|
88483
88541
|
},
|
|
88484
88542
|
{
|
|
@@ -88487,7 +88545,7 @@
|
|
|
88487
88545
|
"linktype": "interface",
|
|
88488
88546
|
"name": "Node",
|
|
88489
88547
|
"coveragePercent": 0,
|
|
88490
|
-
"coverageCount": "0/
|
|
88548
|
+
"coverageCount": "0/11",
|
|
88491
88549
|
"status": "low"
|
|
88492
88550
|
},
|
|
88493
88551
|
{
|
|
@@ -88496,7 +88554,7 @@
|
|
|
88496
88554
|
"linktype": "component",
|
|
88497
88555
|
"name": "TreeViewComponent",
|
|
88498
88556
|
"coveragePercent": 50,
|
|
88499
|
-
"coverageCount": "
|
|
88557
|
+
"coverageCount": "7/14",
|
|
88500
88558
|
"status": "medium"
|
|
88501
88559
|
},
|
|
88502
88560
|
{
|