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,KAAK,EAAE,CAAC,CAAC,CAAC;YACd,IAAI,GAAG,SAAO,UAAU,CAAC,UAAU,UAAO,CAAC;QAC/C,CAAC;QAED,MAAM,CAAC,IAAI,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC/F,CAAC;IACL,qBAAC;AAAD,CAAC,AA/GD,IA+GC;AA/GY,wCAAc","sourcesContent":["import { Reflection } from '../../models/reflections/abstract';\n\n/**\n * A hierarchical model holding the data of single node within the navigation.\n *\n * This structure is used by the [[NavigationPlugin]] and [[TocPlugin]] to expose the current\n * navigation state to the template engine. Themes should generate the primary navigation structure\n * through the [[BaseTheme.getNavigation]] method.\n */\nexport class NavigationItem {\n /**\n * The visible title of the navigation node.\n */\n title: string;\n\n /**\n * The url this navigation node points to.\n */\n url: string;\n\n /**\n * A list of urls that should be seen as sub-pages of this node.\n */\n dedicatedUrls: string[];\n\n /**\n * The parent navigation node.\n */\n parent: NavigationItem;\n\n /**\n * An array containing all child navigation nodes.\n */\n children: NavigationItem[];\n\n /**\n * A string containing the css classes of this node.\n */\n cssClasses: string;\n\n /**\n * Is this item a simple label without a link?\n */\n isLabel: boolean;\n\n /**\n * Is this item visible?\n */\n isVisible: boolean;\n\n /**\n * Does this navigation node represent the current page?\n */\n isCurrent: boolean;\n\n /**\n * Is this the navigation node for the globals page?\n */\n isGlobals: boolean;\n\n /**\n * Is this navigation node one of the parents of the current page?\n */\n isInPath: boolean;\n\n /**\n * The source [Reflection] this item is built from\n */\n reflection: Reflection;\n\n /**\n * Create a new NavigationItem instance.\n *\n * @param title The visible title of the navigation node.\n * @param url The url this navigation node points to.\n * @param parent The parent navigation node.\n * @param cssClasses A string containing the css classes of this node.\n * @param reflection The source [Reflection] for this [NavigationItem]\n */\n constructor(title?: string, url?: string, parent?: NavigationItem, cssClasses?: string, reflection?: Reflection) {\n this.title = title || '';\n this.url = url || '';\n this.parent = parent || null;\n this.cssClasses = cssClasses || '';\n this.reflection = reflection;\n\n if (!url) {\n this.isLabel = true;\n }\n\n if (this.parent) {\n if (!this.parent.children) {\n this.parent.children = [];\n }\n this.parent.children.push(this);\n }\n }\n\n /**\n * Create a navigation node for the given reflection.\n *\n * @param reflection The reflection whose navigation node should be created.\n * @param parent The parent navigation node.\n * @param useShortNames Force this function to always use short names.\n */\n static create(reflection: Reflection, parent?: NavigationItem, useShortNames?: boolean) {\n let name: string;\n if (useShortNames || (parent && parent.parent)) {\n name = reflection.name;\n } else {\n name = reflection.getFullName();\n }\n\n name = name.trim();\n if (name === '') {\n name = `<em>${reflection.kindString}</em>`;\n }\n\n return new NavigationItem(name, reflection.url, parent, reflection.cssClasses, reflection);\n }\n}\n"]}
|