UNPKG

2.07 kBSource Map (JSON)View Raw
1{"version":3,"file":"ReflectionCategory.js","sourceRoot":"","sources":["../../../src/lib/models/ReflectionCategory.ts"],"names":[],"mappings":";;AASA,MAAa,kBAAkB;IAwB3B,YAAY,KAAa;QAfzB,aAAQ,GAAiB,EAAE,CAAC;QAgBxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,CAAC,0BAA0B,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,6BAA6B,EAAE,CAAC,CAAC;IACnF,CAAC;IAKO,6BAA6B;QACjC,IAAI,gBAAgB,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAC5B,gBAAgB,GAAG,gBAAgB,IAAI,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;QAClE,CAAC,CAAC,CAAC;QAEH,OAAO,gBAAgB,CAAC;IAC5B,CAAC;CACJ;AAzCD,gDAyCC","sourcesContent":["import { Reflection } from './reflections/abstract';\n\n/**\n * A category of reflections.\n *\n * Reflection categories are created by the ´CategoryPlugin´ in the resolving phase\n * of the dispatcher. The main purpose of categories is to be able to more easily\n * render human readable children lists in templates.\n */\nexport class ReflectionCategory {\n /**\n * The title, a string representation of this category.\n */\n title: string;\n\n /**\n * All reflections of this category.\n */\n children: Reflection[] = [];\n\n /**\n * Do all children of this category have a separate document?\n *\n * A bound representation of the ´ReflectionCategory.getAllChildrenHaveOwnDocument´\n * that can be used within templates.\n */\n allChildrenHaveOwnDocument: Function;\n\n /**\n * Create a new ReflectionCategory instance.\n *\n * @param title The title of this category.\n */\n constructor(title: string) {\n this.title = title;\n\n this.allChildrenHaveOwnDocument = (() => this.getAllChildrenHaveOwnDocument());\n }\n\n /**\n * Do all children of this category have a separate document?\n */\n private getAllChildrenHaveOwnDocument(): boolean {\n let onlyOwnDocuments = true;\n this.children.forEach((child) => {\n onlyOwnDocuments = onlyOwnDocuments && !!child.hasOwnDocument;\n });\n\n return onlyOwnDocuments;\n }\n}\n"]}
\No newline at end of file