';
+
+ // If the option has a `depth` property, indent its label
+ if (typeof data.depth === 'number' && data.depth > 0) {
+ html = `${html}${'─'.repeat(data.depth)} `;
}
- return `
${escape(data[LABEL_FIELD])}
`;
+ html = `${html}${escape(data[LABEL_FIELD])}`;
+ if (data['parent']) {
+ html = `${html}
${escape(data['parent'])}`;
+ }
+ if (data['count']) {
+ html = `${html}
${escape(data['count'])}`;
+ }
+ if (data['description']) {
+ html = `${html}
${escape(data['description'])}`;
+ }
+ html = `${html}
`;
+
+ return html;
+}
+
+// Render the HTML for a selected item
+function renderItem(data: TomOption, escape: typeof escape_html) {
+ if (data['parent']) {
+ return `