1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | class NavigationItem {
|
4 | constructor(title, url, parent, cssClasses, reflection) {
|
5 | this.title = title || '';
|
6 | this.url = url || '';
|
7 | this.parent = parent;
|
8 | this.cssClasses = cssClasses || '';
|
9 | this.reflection = reflection;
|
10 | if (!url) {
|
11 | this.isLabel = true;
|
12 | }
|
13 | if (this.parent) {
|
14 | if (!this.parent.children) {
|
15 | this.parent.children = [];
|
16 | }
|
17 | this.parent.children.push(this);
|
18 | }
|
19 | }
|
20 | static create(reflection, parent, useShortNames) {
|
21 | let name;
|
22 | if (useShortNames || (parent && parent.parent)) {
|
23 | name = reflection.name;
|
24 | }
|
25 | else {
|
26 | name = reflection.getFullName();
|
27 | }
|
28 | name = name.trim();
|
29 | if (name === '') {
|
30 | name = `<em>${reflection.kindString}</em>`;
|
31 | }
|
32 | return new NavigationItem(name, reflection.url, parent, reflection.cssClasses, reflection);
|
33 | }
|
34 | }
|
35 | exports.NavigationItem = NavigationItem;
|
36 |
|
\ | No newline at end of file |