@covalent/markdown-navigator 4.0.0-beta.4 → 4.1.0-develop.11

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.
@@ -1,259 +1,37 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { EventEmitter, SecurityContext, Component, ChangeDetectionStrategy, Input, Output, ViewChild, HostListener, Injectable, Inject, Directive, NgModule } from '@angular/core';
3
- import * as i4 from '@angular/common';
3
+ import * as i11 from '@angular/common';
4
4
  import { DOCUMENT, CommonModule } from '@angular/common';
5
5
  import * as i1 from '@covalent/markdown';
6
- import { removeLeadingHash, isAnchorLink } from '@covalent/markdown';
6
+ import { isAnchorLink, removeLeadingHash } from '@covalent/markdown';
7
7
  import * as i2 from '@angular/platform-browser';
8
8
  import * as i3 from '@angular/common/http';
9
- import * as i5 from '@angular/material/progress-bar';
9
+ import { firstValueFrom } from 'rxjs';
10
+ import * as i4 from '@angular/material/progress-bar';
10
11
  import { MatProgressBarModule } from '@angular/material/progress-bar';
11
- import * as i6 from '@angular/material/button';
12
- import { MatButtonModule } from '@angular/material/button';
13
- import * as i7 from '@angular/material/tooltip';
14
- import { MatTooltipModule } from '@angular/material/tooltip';
15
- import * as i8 from '@angular/material/icon';
12
+ import * as i5 from '@covalent/core/breadcrumbs';
13
+ import { CovalentBreadcrumbsModule } from '@covalent/core/breadcrumbs';
14
+ import * as i6 from '@angular/material/icon';
16
15
  import { MatIconModule } from '@angular/material/icon';
17
- import * as i9 from '@angular/material/divider';
18
- import * as i10 from '@covalent/core/message';
16
+ import * as i7 from '@angular/material/divider';
17
+ import * as i8 from '@covalent/core/message';
19
18
  import { CovalentMessageModule } from '@covalent/core/message';
20
- import * as i11 from '@covalent/flavored-markdown';
19
+ import * as i9 from '@covalent/flavored-markdown';
21
20
  import { CovalentFlavoredMarkdownModule } from '@covalent/flavored-markdown';
22
- import * as i12 from '@angular/material/list';
21
+ import * as i10 from '@angular/material/list';
23
22
  import { MatListModule } from '@angular/material/list';
23
+ import * as i12 from '@angular/material/tooltip';
24
+ import { MatTooltipModule } from '@angular/material/tooltip';
24
25
  import * as i13 from '@angular/material/core';
25
26
  import * as i1$1 from '@covalent/core/dialogs';
26
27
  import { ResizableDraggableDialog, CovalentDialogsModule } from '@covalent/core/dialogs';
28
+ import { MatButtonModule } from '@angular/material/button';
27
29
 
28
- const _c0 = ["markdownWrapper"];
29
- function TdMarkdownNavigatorComponent_ng_container_0_mat_progress_bar_1_Template(rf, ctx) { if (rf & 1) {
30
- i0.ɵɵelement(0, "mat-progress-bar", 8);
31
- } }
32
- function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_2_Template(rf, ctx) { if (rf & 1) {
33
- const _r12 = i0.ɵɵgetCurrentView();
34
- i0.ɵɵelementStart(0, "button", 12);
35
- i0.ɵɵlistener("click", function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r12); const ctx_r11 = i0.ɵɵnextContext(3); return ctx_r11.reset(); });
36
- i0.ɵɵelementStart(1, "mat-icon");
37
- i0.ɵɵtext(2, "home");
38
- i0.ɵɵelementEnd();
39
- i0.ɵɵelementEnd();
40
- } if (rf & 2) {
41
- const ctx_r8 = i0.ɵɵnextContext(3);
42
- i0.ɵɵproperty("matTooltip", ctx_r8.goHomeLabel);
43
- i0.ɵɵattribute("data-test", "home-button");
44
- i0.ɵɵadvance(1);
45
- i0.ɵɵattribute("aria-label", ctx_r8.goHomeLabel);
46
- } }
47
- function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_3_Template(rf, ctx) { if (rf & 1) {
48
- const _r14 = i0.ɵɵgetCurrentView();
49
- i0.ɵɵelementStart(0, "button", 13);
50
- i0.ɵɵlistener("click", function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_3_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r14); const ctx_r13 = i0.ɵɵnextContext(3); return ctx_r13.goBack(); });
51
- i0.ɵɵelementStart(1, "mat-icon");
52
- i0.ɵɵtext(2, "arrow_back");
53
- i0.ɵɵelementEnd();
54
- i0.ɵɵelementEnd();
55
- } if (rf & 2) {
56
- const ctx_r9 = i0.ɵɵnextContext(3);
57
- i0.ɵɵproperty("matTooltip", ctx_r9.goBackLabel);
58
- i0.ɵɵattribute("data-test", "back-button");
59
- i0.ɵɵadvance(1);
60
- i0.ɵɵattribute("aria-label", ctx_r9.goBackLabel);
61
- } }
62
- function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_span_4_Template(rf, ctx) { if (rf & 1) {
63
- i0.ɵɵelementStart(0, "span", 14);
64
- i0.ɵɵtext(1);
65
- i0.ɵɵelementEnd();
66
- } if (rf & 2) {
67
- const ctx_r10 = i0.ɵɵnextContext(3);
68
- i0.ɵɵattribute("data-test", "title");
69
- i0.ɵɵadvance(1);
70
- i0.ɵɵtextInterpolate1(" ", ctx_r10.currentItemTitle, " ");
71
- } }
72
- function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_Template(rf, ctx) { if (rf & 1) {
73
- i0.ɵɵelementContainerStart(0);
74
- i0.ɵɵelementStart(1, "div");
75
- i0.ɵɵtemplate(2, TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_2_Template, 3, 3, "button", 9);
76
- i0.ɵɵtemplate(3, TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_3_Template, 3, 3, "button", 10);
77
- i0.ɵɵtemplate(4, TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_span_4_Template, 2, 2, "span", 11);
78
- i0.ɵɵelementEnd();
79
- i0.ɵɵelement(5, "mat-divider");
80
- i0.ɵɵelementContainerEnd();
81
- } if (rf & 2) {
82
- const ctx_r3 = i0.ɵɵnextContext(2);
83
- i0.ɵɵadvance(1);
84
- i0.ɵɵstyleProp("display", "flex");
85
- i0.ɵɵadvance(1);
86
- i0.ɵɵproperty("ngIf", ctx_r3.showHomeButton);
87
- i0.ɵɵadvance(1);
88
- i0.ɵɵproperty("ngIf", ctx_r3.showGoBackButton);
89
- i0.ɵɵadvance(1);
90
- i0.ɵɵproperty("ngIf", ctx_r3.currentItemTitle);
91
- i0.ɵɵadvance(1);
92
- i0.ɵɵstyleProp("position", "relative");
93
- } }
94
- function TdMarkdownNavigatorComponent_ng_container_0_div_4_td_message_2_Template(rf, ctx) { if (rf & 1) {
95
- i0.ɵɵelement(0, "td-message", 19);
96
- } if (rf & 2) {
97
- const ctx_r16 = i0.ɵɵnextContext(3);
98
- i0.ɵɵproperty("sublabel", ctx_r16.markdownLoaderError);
99
- i0.ɵɵattribute("data-test", "markdown-loader-error");
100
- } }
101
- function TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_loader_3_Template(rf, ctx) { if (rf & 1) {
102
- const _r20 = i0.ɵɵgetCurrentView();
103
- i0.ɵɵelementStart(0, "td-flavored-markdown-loader", 20);
104
- i0.ɵɵlistener("loadFailed", function TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_loader_3_Template_td_flavored_markdown_loader_loadFailed_0_listener($event) { i0.ɵɵrestoreView(_r20); const ctx_r19 = i0.ɵɵnextContext(3); return ctx_r19.handleMarkdownLoaderError($event); });
105
- i0.ɵɵelementEnd();
106
- } if (rf & 2) {
107
- const ctx_r17 = i0.ɵɵnextContext(3);
108
- i0.ɵɵproperty("url", ctx_r17.url)("httpOptions", ctx_r17.httpOptions)("anchor", ctx_r17.anchor)("copyCodeToClipboard", ctx_r17.copyCodeToClipboard)("copyCodeTooltips", ctx_r17.copyCodeTooltips);
109
- } }
110
- function TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_4_Template(rf, ctx) { if (rf & 1) {
111
- const _r22 = i0.ɵɵgetCurrentView();
112
- i0.ɵɵelementStart(0, "td-flavored-markdown", 21);
113
- i0.ɵɵlistener("buttonClicked", function TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_4_Template_td_flavored_markdown_buttonClicked_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r21 = i0.ɵɵnextContext(3); return ctx_r21.buttonClicked.emit($event); });
114
- i0.ɵɵelementEnd();
115
- } if (rf & 2) {
116
- const ctx_r18 = i0.ɵɵnextContext(3);
117
- i0.ɵɵproperty("content", ctx_r18.markdownString)("hostedUrl", ctx_r18.url)("anchor", ctx_r18.anchor)("copyCodeToClipboard", ctx_r18.copyCodeToClipboard)("copyCodeTooltips", ctx_r18.copyCodeTooltips);
118
- } }
119
- function TdMarkdownNavigatorComponent_ng_container_0_div_4_Template(rf, ctx) { if (rf & 1) {
120
- i0.ɵɵelementStart(0, "div", 15, 16);
121
- i0.ɵɵtemplate(2, TdMarkdownNavigatorComponent_ng_container_0_div_4_td_message_2_Template, 1, 2, "td-message", 5);
122
- i0.ɵɵtemplate(3, TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_loader_3_Template, 1, 5, "td-flavored-markdown-loader", 17);
123
- i0.ɵɵtemplate(4, TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_4_Template, 1, 5, "td-flavored-markdown", 18);
124
- i0.ɵɵelementEnd();
125
- } if (rf & 2) {
126
- const ctx_r4 = i0.ɵɵnextContext(2);
127
- i0.ɵɵadvance(2);
128
- i0.ɵɵproperty("ngIf", ctx_r4.markdownLoaderError);
129
- i0.ɵɵadvance(1);
130
- i0.ɵɵproperty("ngIf", ctx_r4.showTdMarkdownLoader);
131
- i0.ɵɵadvance(1);
132
- i0.ɵɵproperty("ngIf", ctx_r4.showTdMarkdown);
133
- } }
134
- function TdMarkdownNavigatorComponent_ng_container_0_td_message_5_Template(rf, ctx) { if (rf & 1) {
135
- i0.ɵɵelement(0, "td-message", 19);
136
- } if (rf & 2) {
137
- const ctx_r5 = i0.ɵɵnextContext(2);
138
- i0.ɵɵproperty("sublabel", ctx_r5.childrenUrlError);
139
- i0.ɵɵattribute("data-test", "children-url-error");
140
- } }
141
- function TdMarkdownNavigatorComponent_ng_container_0_div_6_button_2_Template(rf, ctx) { if (rf & 1) {
142
- const _r27 = i0.ɵɵgetCurrentView();
143
- i0.ɵɵelementStart(0, "button", 24);
144
- i0.ɵɵlistener("click", function TdMarkdownNavigatorComponent_ng_container_0_div_6_button_2_Template_button_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r27); const item_r24 = restoredCtx.$implicit; const ctx_r26 = i0.ɵɵnextContext(3); return ctx_r26.handleItemSelected(item_r24); });
145
- i0.ɵɵelementStart(1, "mat-icon", 25);
146
- i0.ɵɵtext(2);
147
- i0.ɵɵelementEnd();
148
- i0.ɵɵelementStart(3, "span", 26);
149
- i0.ɵɵtext(4);
150
- i0.ɵɵelementEnd();
151
- i0.ɵɵelementStart(5, "span", 26);
152
- i0.ɵɵtext(6);
153
- i0.ɵɵelementEnd();
154
- i0.ɵɵelement(7, "mat-divider");
155
- i0.ɵɵelementEnd();
156
- } if (rf & 2) {
157
- const item_r24 = ctx.$implicit;
158
- const index_r25 = ctx.index;
159
- const ctx_r23 = i0.ɵɵnextContext(3);
160
- i0.ɵɵproperty("id", "td-markdown-navigator-list-item-" + (item_r24.id ? item_r24.id : index_r25))("matTooltip", ctx_r23.getTitle(item_r24));
161
- i0.ɵɵadvance(2);
162
- i0.ɵɵtextInterpolate1(" ", ctx_r23.getIcon(item_r24), " ");
163
- i0.ɵɵadvance(2);
164
- i0.ɵɵtextInterpolate1(" ", ctx_r23.getTitle(item_r24), " ");
165
- i0.ɵɵadvance(2);
166
- i0.ɵɵtextInterpolate(item_r24.description);
167
- } }
168
- function TdMarkdownNavigatorComponent_ng_container_0_div_6_Template(rf, ctx) { if (rf & 1) {
169
- i0.ɵɵelementStart(0, "div", 22);
170
- i0.ɵɵelementStart(1, "mat-action-list");
171
- i0.ɵɵtemplate(2, TdMarkdownNavigatorComponent_ng_container_0_div_6_button_2_Template, 8, 5, "button", 23);
172
- i0.ɵɵelementEnd();
173
- i0.ɵɵelementEnd();
174
- } if (rf & 2) {
175
- const ctx_r6 = i0.ɵɵnextContext(2);
176
- i0.ɵɵadvance(2);
177
- i0.ɵɵproperty("ngForOf", ctx_r6.currentMenuItems);
178
- } }
179
- function TdMarkdownNavigatorComponent_ng_container_0_ng_container_7_Template(rf, ctx) { if (rf & 1) {
180
- i0.ɵɵelementContainer(0);
181
- } }
182
- function TdMarkdownNavigatorComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
183
- i0.ɵɵelementContainerStart(0);
184
- i0.ɵɵtemplate(1, TdMarkdownNavigatorComponent_ng_container_0_mat_progress_bar_1_Template, 1, 0, "mat-progress-bar", 2);
185
- i0.ɵɵtemplate(2, TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_Template, 6, 7, "ng-container", 0);
186
- i0.ɵɵelementStart(3, "div", 3);
187
- i0.ɵɵtemplate(4, TdMarkdownNavigatorComponent_ng_container_0_div_4_Template, 5, 3, "div", 4);
188
- i0.ɵɵtemplate(5, TdMarkdownNavigatorComponent_ng_container_0_td_message_5_Template, 1, 2, "td-message", 5);
189
- i0.ɵɵtemplate(6, TdMarkdownNavigatorComponent_ng_container_0_div_6_Template, 3, 1, "div", 6);
190
- i0.ɵɵtemplate(7, TdMarkdownNavigatorComponent_ng_container_0_ng_container_7_Template, 1, 0, "ng-container", 7);
191
- i0.ɵɵelementEnd();
192
- i0.ɵɵelementContainerEnd();
193
- } if (rf & 2) {
194
- const ctx_r0 = i0.ɵɵnextContext();
195
- i0.ɵɵadvance(1);
196
- i0.ɵɵproperty("ngIf", ctx_r0.loading);
197
- i0.ɵɵadvance(1);
198
- i0.ɵɵproperty("ngIf", ctx_r0.showHeader);
199
- i0.ɵɵadvance(2);
200
- i0.ɵɵproperty("ngIf", ctx_r0.showTdMarkdownLoader || ctx_r0.showTdMarkdown);
201
- i0.ɵɵadvance(1);
202
- i0.ɵɵproperty("ngIf", ctx_r0.childrenUrlError);
203
- i0.ɵɵadvance(1);
204
- i0.ɵɵproperty("ngIf", ctx_r0.showMenu);
205
- i0.ɵɵadvance(1);
206
- i0.ɵɵproperty("ngComponentOutlet", ctx_r0.footerComponent);
207
- } }
208
- function TdMarkdownNavigatorComponent_div_1_Template(rf, ctx) { if (rf & 1) {
209
- i0.ɵɵelementStart(0, "div", 27);
210
- i0.ɵɵelementStart(1, "mat-icon", 28);
211
- i0.ɵɵtext(2, "subject");
212
- i0.ɵɵelementEnd();
213
- i0.ɵɵelementStart(3, "h2");
214
- i0.ɵɵtext(4);
215
- i0.ɵɵelementEnd();
216
- i0.ɵɵelementEnd();
217
- } if (rf & 2) {
218
- const ctx_r1 = i0.ɵɵnextContext();
219
- i0.ɵɵadvance(4);
220
- i0.ɵɵtextInterpolate(ctx_r1.emptyStateLabel);
221
- } }
222
30
  const DEFAULT_MARKDOWN_NAVIGATOR_LABELS = {
223
31
  goHome: 'Go home',
224
32
  goBack: 'Go back',
225
33
  emptyState: 'No item(s) to display',
226
34
  };
227
- function getTitleFromUrl(url) {
228
- if (url) {
229
- const temp = new URL(url);
230
- if (temp.hash) {
231
- return removeLeadingHash(temp.hash);
232
- }
233
- else {
234
- const path = temp.pathname.split('/');
235
- const fileName = path[path.length - 1];
236
- return fileName.replace(/\.[^/.]+$/, ''); // remove .md
237
- }
238
- }
239
- return undefined;
240
- }
241
- function getTitleFromMarkdownString(markdownString) {
242
- if (markdownString) {
243
- const firstLine = markdownString.split(/[\r\n]+/).find((line) => !!line);
244
- return removeLeadingHash(firstLine).trim();
245
- }
246
- return undefined;
247
- }
248
- function isMarkdownHref(anchor) {
249
- return !isAnchorLink(anchor) && anchor.pathname.endsWith('.md');
250
- }
251
- function defaultCompareWith(o1, o2) {
252
- if (o1.id && o2.id) {
253
- return o1.id === o2.id;
254
- }
255
- return o1 === o2;
256
- }
257
35
  class TdMarkdownNavigatorComponent {
258
36
  constructor(_markdownUrlLoaderService, _changeDetectorRef, _sanitizer, _http) {
259
37
  this._markdownUrlLoaderService = _markdownUrlLoaderService;
@@ -280,27 +58,28 @@ class TdMarkdownNavigatorComponent {
280
58
  }
281
59
  clickListener(event) {
282
60
  const element = event.srcElement;
283
- if (element.matches('a[href]') && isMarkdownHref(element)) {
61
+ if (element.matches('a[href]') &&
62
+ isMarkdownHref(element)) {
284
63
  this.handleLinkClick(event);
285
64
  }
286
65
  }
287
66
  get showGoBackButton() {
288
67
  return this.historyStack.length > 0;
289
68
  }
290
- get showHomeButton() {
291
- return this.historyStack.length > 1;
292
- }
293
69
  get showHeader() {
294
- return this.showHomeButton || this.showGoBackButton || !!this.currentItemTitle;
70
+ return this.showGoBackButton || !!this.currentItemTitle;
295
71
  }
296
72
  get showMenu() {
297
- return this.currentMenuItems && this.currentMenuItems.length > 0;
73
+ const showMenu = this.currentMenuItems && this.currentMenuItems.length > 0;
74
+ return showMenu ?? false;
298
75
  }
299
76
  get showTdMarkdownLoader() {
300
- return !!this.currentMarkdownItem && !!this.currentMarkdownItem.url && !this.showTdMarkdown;
77
+ return (!!this.currentMarkdownItem &&
78
+ !!this.currentMarkdownItem.url &&
79
+ !this.showTdMarkdown);
301
80
  }
302
81
  get showTdMarkdown() {
303
- return !!this.currentMarkdownItem && !!this.currentMarkdownItem.markdownString;
82
+ return (!!this.currentMarkdownItem && !!this.currentMarkdownItem.markdownString);
304
83
  }
305
84
  get url() {
306
85
  if (this.currentMarkdownItem) {
@@ -318,28 +97,34 @@ class TdMarkdownNavigatorComponent {
318
97
  if (this.currentMarkdownItem) {
319
98
  return this.currentMarkdownItem.httpOptions;
320
99
  }
100
+ return undefined;
321
101
  }
322
102
  get markdownString() {
323
103
  if (this.currentMarkdownItem) {
324
104
  return this.currentMarkdownItem.markdownString;
325
105
  }
106
+ return undefined;
326
107
  }
327
108
  get anchor() {
328
109
  if (this.currentMarkdownItem) {
329
110
  return this.currentMarkdownItem.anchor;
330
111
  }
112
+ return undefined;
331
113
  }
332
114
  get showEmptyState() {
333
115
  return !this.items || this.items.length < 1;
334
116
  }
335
117
  get goHomeLabel() {
336
- return (this.labels && this.labels.goHome) || DEFAULT_MARKDOWN_NAVIGATOR_LABELS.goHome;
118
+ return ((this.labels && this.labels.goHome) ||
119
+ DEFAULT_MARKDOWN_NAVIGATOR_LABELS.goHome);
337
120
  }
338
121
  get goBackLabel() {
339
- return (this.labels && this.labels.goBack) || DEFAULT_MARKDOWN_NAVIGATOR_LABELS.goBack;
122
+ return ((this.labels && this.labels.goBack) ||
123
+ DEFAULT_MARKDOWN_NAVIGATOR_LABELS.goBack);
340
124
  }
341
125
  get emptyStateLabel() {
342
- return (this.labels && this.labels.emptyState) || DEFAULT_MARKDOWN_NAVIGATOR_LABELS.emptyState;
126
+ return ((this.labels && this.labels.emptyState) ||
127
+ DEFAULT_MARKDOWN_NAVIGATOR_LABELS.emptyState);
343
128
  }
344
129
  get currentItemTitle() {
345
130
  if (this.historyStack.length < 1) {
@@ -354,10 +139,10 @@ class TdMarkdownNavigatorComponent {
354
139
  return '';
355
140
  }
356
141
  async ngOnChanges(changes) {
357
- if (changes.items) {
142
+ if (changes['items']) {
358
143
  this.reset();
359
144
  }
360
- if (changes.startAt && this.items && this.startAt) {
145
+ if (changes['startAt'] && this.items && this.startAt) {
361
146
  this._jumpTo(this.startAt, undefined);
362
147
  }
363
148
  }
@@ -372,7 +157,9 @@ class TdMarkdownNavigatorComponent {
372
157
  this.loading = false;
373
158
  this.clearErrors();
374
159
  // if single item and no children
375
- if (this.items && this.items.length === 1 && !this.hasChildrenOrChildrenUrl(this.items[0])) {
160
+ if (this.items &&
161
+ this.items.length === 1 &&
162
+ !this.hasChildrenOrChildrenUrl(this.items[0])) {
376
163
  this.currentMenuItems = [];
377
164
  this.currentMarkdownItem = this.items[0];
378
165
  }
@@ -383,20 +170,20 @@ class TdMarkdownNavigatorComponent {
383
170
  this.historyStack = [];
384
171
  this._changeDetectorRef.markForCheck();
385
172
  }
386
- goBack() {
173
+ goBack(goBackLength = 1) {
387
174
  this.loading = false;
388
175
  this.clearErrors();
389
176
  if (this.historyStack.length > 1) {
390
177
  let parent = this.historyStack[this.historyStack.length - 2];
391
- if (parent.startAtLink) {
178
+ if (parent?.startAtLink) {
392
179
  parent = this.historyStack[this.historyStack.length - 3]
393
180
  ? this.historyStack[this.historyStack.length - 3]
394
181
  : undefined;
395
- this.historyStack = this.historyStack.slice(0, -1);
182
+ this.historyStack = this.historyStack.slice(0, -goBackLength);
396
183
  }
397
184
  if (parent) {
398
185
  this.currentMarkdownItem = parent;
399
- this.historyStack = this.historyStack.slice(0, -1);
186
+ this.historyStack = this.historyStack.slice(0, -goBackLength);
400
187
  this.setChildrenAsCurrentMenuItems(parent);
401
188
  }
402
189
  else {
@@ -440,9 +227,12 @@ class TdMarkdownNavigatorComponent {
440
227
  this._changeDetectorRef.markForCheck();
441
228
  }
442
229
  async loadChildrenUrl(item) {
443
- const sanitizedUrl = this._sanitizer.sanitize(SecurityContext.URL, item.childrenUrl);
230
+ const sanitizedUrl = this._sanitizer.sanitize(SecurityContext.URL, item.childrenUrl ?? null) ??
231
+ '';
444
232
  try {
445
- return await this._http.get(sanitizedUrl, { ...item.httpOptions }).toPromise();
233
+ return await firstValueFrom(this._http.get(sanitizedUrl, {
234
+ ...item.httpOptions,
235
+ }));
446
236
  }
447
237
  catch (error) {
448
238
  this.handleChildrenUrlError(error);
@@ -450,25 +240,24 @@ class TdMarkdownNavigatorComponent {
450
240
  }
451
241
  }
452
242
  getTitle(item) {
453
- if (item) {
454
- return (removeLeadingHash(item.anchor) ||
455
- item.title ||
456
- getTitleFromUrl(item.url) ||
457
- getTitleFromMarkdownString(item.markdownString) ||
458
- '').trim();
243
+ if (!item) {
244
+ return '';
459
245
  }
246
+ return (removeLeadingHash(item.anchor ?? '') ||
247
+ item.title ||
248
+ getTitleFromUrl(item.url ?? '') ||
249
+ getTitleFromMarkdownString(item.markdownString ?? '') ||
250
+ '').trim();
460
251
  }
461
252
  getIcon(item) {
462
- if (item) {
463
- return item.icon || 'subject';
464
- }
253
+ return item?.icon || 'subject';
465
254
  }
466
255
  handleChildrenUrlError(error) {
467
256
  this.childrenUrlError = error.message;
468
257
  this._changeDetectorRef.markForCheck();
469
258
  }
470
259
  handleMarkdownLoaderError(error) {
471
- this.markdownLoaderError = error.message;
260
+ this.markdownLoaderError = error ? error.message : '';
472
261
  this._changeDetectorRef.markForCheck();
473
262
  }
474
263
  async _jumpTo(itemOrPath, children) {
@@ -518,7 +307,7 @@ class TdMarkdownNavigatorComponent {
518
307
  const compareWith = this.compareWith || defaultCompareWith;
519
308
  if (items) {
520
309
  for (const child of items) {
521
- if (compareWith(child, item)) {
310
+ if (item && compareWith(child, item)) {
522
311
  return [child];
523
312
  }
524
313
  const ancestors = this.findPath(child.children, item);
@@ -543,7 +332,7 @@ class TdMarkdownNavigatorComponent {
543
332
  }
544
333
  catch (error) {
545
334
  const win = window.open(url.href, '_blank');
546
- win.focus();
335
+ win?.focus();
547
336
  }
548
337
  finally {
549
338
  this.loading = false;
@@ -551,48 +340,64 @@ class TdMarkdownNavigatorComponent {
551
340
  this._changeDetectorRef.markForCheck();
552
341
  }
553
342
  }
554
- /** @nocollapse */ /** @nocollapse */ TdMarkdownNavigatorComponent.ɵfac = function TdMarkdownNavigatorComponent_Factory(t) { return new (t || TdMarkdownNavigatorComponent)(i0.ɵɵdirectiveInject(i1.TdMarkdownLoaderService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i2.DomSanitizer), i0.ɵɵdirectiveInject(i3.HttpClient)); };
555
- /** @nocollapse */ /** @nocollapse */ TdMarkdownNavigatorComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: TdMarkdownNavigatorComponent, selectors: [["td-markdown-navigator"]], viewQuery: function TdMarkdownNavigatorComponent_Query(rf, ctx) { if (rf & 1) {
556
- i0.ɵɵviewQuery(_c0, 5);
557
- } if (rf & 2) {
558
- let _t;
559
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.markdownWrapper = _t.first);
560
- } }, hostBindings: function TdMarkdownNavigatorComponent_HostBindings(rf, ctx) { if (rf & 1) {
561
- i0.ɵɵlistener("click", function TdMarkdownNavigatorComponent_click_HostBindingHandler($event) { return ctx.clickListener($event); });
562
- } }, inputs: { items: "items", labels: "labels", startAt: "startAt", copyCodeToClipboard: "copyCodeToClipboard", copyCodeTooltips: "copyCodeTooltips", footer: "footer", compareWith: "compareWith" }, outputs: { buttonClicked: "buttonClicked" }, features: [i0.ɵɵNgOnChangesFeature], decls: 2, vars: 2, consts: [[4, "ngIf"], ["layout", "column", "layout-align", "center center", "class", "empty-state", 4, "ngIf"], ["mode", "indeterminate", "color", "accent", 4, "ngIf"], ["id", "td-markdown-navigator-content", 1, "scroll-area"], ["class", "markdown-wrapper", 4, "ngIf"], ["color", "warn", "icon", "error", 3, "sublabel", 4, "ngIf"], ["class", "td-markdown-list", 4, "ngIf"], [4, "ngComponentOutlet"], ["mode", "indeterminate", "color", "accent"], ["id", "td-markdown-navigator-home-button", "mat-icon-button", "", 3, "matTooltip", "click", 4, "ngIf"], ["id", "td-markdown-navigator-back-button", "mat-icon-button", "", 3, "matTooltip", "click", 4, "ngIf"], ["flex", "", "class", "mat-body-2 title truncate", 4, "ngIf"], ["id", "td-markdown-navigator-home-button", "mat-icon-button", "", 3, "matTooltip", "click"], ["id", "td-markdown-navigator-back-button", "mat-icon-button", "", 3, "matTooltip", "click"], ["flex", "", 1, "mat-body-2", "title", "truncate"], [1, "markdown-wrapper"], ["markdownWrapper", ""], [3, "url", "httpOptions", "anchor", "copyCodeToClipboard", "copyCodeTooltips", "loadFailed", 4, "ngIf"], [3, "content", "hostedUrl", "anchor", "copyCodeToClipboard", "copyCodeTooltips", "buttonClicked", 4, "ngIf"], ["color", "warn", "icon", "error", 3, "sublabel"], [3, "url", "httpOptions", "anchor", "copyCodeToClipboard", "copyCodeTooltips", "loadFailed"], [3, "content", "hostedUrl", "anchor", "copyCodeToClipboard", "copyCodeTooltips", "buttonClicked"], [1, "td-markdown-list"], ["mat-list-item", "", "matTooltipPosition", "before", "matTooltipShowDelay", "500", 3, "id", "matTooltip", "click", 4, "ngFor", "ngForOf"], ["mat-list-item", "", "matTooltipPosition", "before", "matTooltipShowDelay", "500", 3, "id", "matTooltip", "click"], ["matListIcon", ""], ["matLine", "", 1, "truncate"], ["layout", "column", "layout-align", "center center", 1, "empty-state"], ["matListAvatar", ""]], template: function TdMarkdownNavigatorComponent_Template(rf, ctx) { if (rf & 1) {
563
- i0.ɵɵtemplate(0, TdMarkdownNavigatorComponent_ng_container_0_Template, 8, 6, "ng-container", 0);
564
- i0.ɵɵtemplate(1, TdMarkdownNavigatorComponent_div_1_Template, 5, 1, "div", 1);
565
- } if (rf & 2) {
566
- i0.ɵɵproperty("ngIf", !ctx.showEmptyState);
567
- i0.ɵɵadvance(1);
568
- i0.ɵɵproperty("ngIf", ctx.showEmptyState);
569
- } }, directives: [i4.NgIf, i5.MatProgressBar, i6.MatButton, i7.MatTooltip, i8.MatIcon, i9.MatDivider, i10.TdMessageComponent, i11.TdFlavoredMarkdownLoaderComponent, i11.TdFlavoredMarkdownComponent, i12.MatList, i4.NgForOf, i12.MatListItem, i12.MatListIconCssMatStyler, i13.MatLine, i4.NgComponentOutlet, i12.MatListAvatarCssMatStyler], styles: ["[_nghost-%COMP%]{position:relative;height:inherit;height:100%;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}[_nghost-%COMP%] .scroll-area[_ngcontent-%COMP%]{min-height:1px;overflow-y:auto;-ms-flex:1;flex:1;box-sizing:border-box}[_nghost-%COMP%] .markdown-wrapper[_ngcontent-%COMP%]{padding:16px 16px 0}[_nghost-%COMP%] .td-markdown-list[_ngcontent-%COMP%] > .mat-list[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] td-flavored-markdown-loader[_ngcontent-%COMP%] .mat-progress-bar{top:0;left:0;right:0;position:absolute}[_nghost-%COMP%] .title[_ngcontent-%COMP%]{display:inline-block;vertical-align:middle;margin:8px 0;padding-left:16px}.truncate[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.empty-state[_ngcontent-%COMP%]{padding:32px}.empty-state[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:4em}"], changeDetection: 0 });
570
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownNavigatorComponent, [{
571
- type: Component,
572
- args: [{ selector: 'td-markdown-navigator', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"!showEmptyState\">\n <mat-progress-bar *ngIf=\"loading\" mode=\"indeterminate\" color=\"accent\"></mat-progress-bar>\n\n <ng-container *ngIf=\"showHeader\">\n <div [style.display]=\"'flex'\">\n <button\n id=\"td-markdown-navigator-home-button\"\n *ngIf=\"showHomeButton\"\n mat-icon-button\n [matTooltip]=\"goHomeLabel\"\n (click)=\"reset()\"\n [attr.data-test]=\"'home-button'\"\n >\n <mat-icon [attr.aria-label]=\"goHomeLabel\">home</mat-icon>\n </button>\n\n <button\n id=\"td-markdown-navigator-back-button\"\n *ngIf=\"showGoBackButton\"\n mat-icon-button\n [matTooltip]=\"goBackLabel\"\n (click)=\"goBack()\"\n [attr.data-test]=\"'back-button'\"\n >\n <mat-icon [attr.aria-label]=\"goBackLabel\">arrow_back</mat-icon>\n </button>\n <span flex *ngIf=\"currentItemTitle\" class=\"mat-body-2 title truncate\" [attr.data-test]=\"'title'\">\n {{ currentItemTitle }}\n </span>\n </div>\n\n <mat-divider [style.position]=\"'relative'\"></mat-divider>\n </ng-container>\n\n <div class=\"scroll-area\" id=\"td-markdown-navigator-content\">\n <div *ngIf=\"showTdMarkdownLoader || showTdMarkdown\" class=\"markdown-wrapper\" #markdownWrapper>\n <td-message\n *ngIf=\"markdownLoaderError\"\n [sublabel]=\"markdownLoaderError\"\n color=\"warn\"\n icon=\"error\"\n [attr.data-test]=\"'markdown-loader-error'\"\n ></td-message>\n <td-flavored-markdown-loader\n *ngIf=\"showTdMarkdownLoader\"\n [url]=\"url\"\n [httpOptions]=\"httpOptions\"\n [anchor]=\"anchor\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (loadFailed)=\"handleMarkdownLoaderError($event)\"\n ></td-flavored-markdown-loader>\n <td-flavored-markdown\n *ngIf=\"showTdMarkdown\"\n [content]=\"markdownString\"\n [hostedUrl]=\"url\"\n [anchor]=\"anchor\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (buttonClicked)=\"buttonClicked.emit($event)\"\n ></td-flavored-markdown>\n </div>\n\n <td-message\n *ngIf=\"childrenUrlError\"\n [sublabel]=\"childrenUrlError\"\n color=\"warn\"\n icon=\"error\"\n [attr.data-test]=\"'children-url-error'\"\n ></td-message>\n <div *ngIf=\"showMenu\" class=\"td-markdown-list\">\n <mat-action-list>\n <button\n *ngFor=\"let item of currentMenuItems; index as index\"\n [id]=\"'td-markdown-navigator-list-item-' + (item.id ? item.id : index)\"\n (click)=\"handleItemSelected(item)\"\n mat-list-item\n [matTooltip]=\"getTitle(item)\"\n matTooltipPosition=\"before\"\n matTooltipShowDelay=\"500\"\n >\n <mat-icon matListIcon>\n {{ getIcon(item) }}\n </mat-icon>\n <span matLine class=\"truncate\">\n {{ getTitle(item) }}\n </span>\n <span matLine class=\"truncate\">{{ item.description }}</span>\n <mat-divider></mat-divider>\n </button>\n </mat-action-list>\n </div>\n\n <ng-container *ngComponentOutlet=\"footerComponent\"></ng-container>\n </div>\n</ng-container>\n\n<div *ngIf=\"showEmptyState\" layout=\"column\" layout-align=\"center center\" class=\"empty-state\">\n <mat-icon matListAvatar>subject</mat-icon>\n <h2>{{ emptyStateLabel }}</h2>\n</div>\n", styles: [":host{position:relative;height:inherit;height:100%;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .scroll-area{min-height:1px;overflow-y:auto;-ms-flex:1;flex:1;box-sizing:border-box}:host .markdown-wrapper{padding:16px 16px 0}:host .td-markdown-list>.mat-list{padding-top:0}:host td-flavored-markdown-loader ::ng-deep .mat-progress-bar{top:0;left:0;right:0;position:absolute}:host .title{display:inline-block;vertical-align:middle;margin:8px 0;padding-left:16px}.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.empty-state{padding:32px}.empty-state mat-icon{font-size:4em}\n"] }]
573
- }], function () { return [{ type: i1.TdMarkdownLoaderService }, { type: i0.ChangeDetectorRef }, { type: i2.DomSanitizer }, { type: i3.HttpClient }]; }, { items: [{
574
- type: Input
575
- }], labels: [{
576
- type: Input
577
- }], startAt: [{
578
- type: Input
579
- }], copyCodeToClipboard: [{
580
- type: Input
581
- }], copyCodeTooltips: [{
582
- type: Input
583
- }], footer: [{
584
- type: Input
585
- }], compareWith: [{
586
- type: Input
587
- }], buttonClicked: [{
588
- type: Output
589
- }], markdownWrapper: [{
590
- type: ViewChild,
591
- args: ['markdownWrapper']
592
- }], clickListener: [{
593
- type: HostListener,
594
- args: ['click', ['$event']]
595
- }] }); })();
343
+ TdMarkdownNavigatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorComponent, deps: [{ token: i1.TdMarkdownLoaderService }, { token: i0.ChangeDetectorRef }, { token: i2.DomSanitizer }, { token: i3.HttpClient }], target: i0.ɵɵFactoryTarget.Component });
344
+ TdMarkdownNavigatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: TdMarkdownNavigatorComponent, selector: "td-markdown-navigator", inputs: { items: "items", labels: "labels", startAt: "startAt", copyCodeToClipboard: "copyCodeToClipboard", copyCodeTooltips: "copyCodeTooltips", footer: "footer", compareWith: "compareWith" }, outputs: { buttonClicked: "buttonClicked" }, host: { listeners: { "click": "clickListener($event)" } }, viewQueries: [{ propertyName: "markdownWrapper", first: true, predicate: ["markdownWrapper"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"!showEmptyState\">\n <mat-progress-bar\n *ngIf=\"loading\"\n mode=\"indeterminate\"\n color=\"accent\"\n ></mat-progress-bar>\n <ng-container *ngIf=\"showHeader\">\n <td-breadcrumbs>\n <a\n td-breadcrumb\n [matTooltip]=\"goHomeLabel ?? ''\"\n (click)=\"reset()\"\n [attr.data-test]=\"'home-button'\"\n >Home</a\n >\n <ng-container\n *ngFor=\"let stack of historyStack; last as isLast; index as index\"\n >\n <ng-container *ngIf=\"!isLast; else lastBreadCrumb\">\n <a\n td-breadcrumb\n (click)=\"goBack(index)\"\n [attr.data-test]=\"'back-button'\"\n >{{ stack.title }}</a\n >\n </ng-container>\n <ng-template #lastBreadCrumb>\n <mat-icon class=\"breadcrumb-end-icon\">chevron_right</mat-icon>\n </ng-template>\n </ng-container>\n </td-breadcrumbs>\n <div class=\"breadcrumb-current-title\" [attr.data-test]=\"'title'\">\n {{ currentItemTitle }}\n </div>\n\n <mat-divider [style.position]=\"'relative'\"></mat-divider>\n </ng-container>\n\n <div class=\"scroll-area\" id=\"td-markdown-navigator-content\">\n <div\n *ngIf=\"showTdMarkdownLoader || showTdMarkdown\"\n class=\"markdown-wrapper\"\n #markdownWrapper\n >\n <td-message\n *ngIf=\"markdownLoaderError\"\n [sublabel]=\"markdownLoaderError\"\n color=\"warn\"\n icon=\"error\"\n [attr.data-test]=\"'markdown-loader-error'\"\n ></td-message>\n <td-flavored-markdown-loader\n *ngIf=\"showTdMarkdownLoader\"\n [url]=\"url ?? ''\"\n [httpOptions]=\"httpOptions ?? {}\"\n [anchor]=\"anchor ?? ''\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (loadFailed)=\"handleMarkdownLoaderError($event)\"\n ></td-flavored-markdown-loader>\n <td-flavored-markdown\n *ngIf=\"showTdMarkdown\"\n [content]=\"markdownString ?? ''\"\n [hostedUrl]=\"url ?? ''\"\n [anchor]=\"anchor ?? ''\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (buttonClicked)=\"buttonClicked.emit($event)\"\n ></td-flavored-markdown>\n </div>\n\n <td-message\n *ngIf=\"childrenUrlError\"\n [sublabel]=\"childrenUrlError\"\n color=\"warn\"\n icon=\"error\"\n [attr.data-test]=\"'children-url-error'\"\n ></td-message>\n <div *ngIf=\"showMenu\" class=\"td-markdown-list\">\n <mat-action-list>\n <button\n *ngFor=\"let item of currentMenuItems; index as index\"\n [id]=\"\n 'td-markdown-navigator-list-item-' + (item.id ? item.id : index)\n \"\n (click)=\"handleItemSelected(item)\"\n mat-list-item\n [matTooltip]=\"getTitle(item)\"\n matTooltipPosition=\"before\"\n matTooltipShowDelay=\"500\"\n >\n <mat-icon matListIcon>\n {{ getIcon(item) }}\n </mat-icon>\n <span matLine class=\"truncate\">\n {{ getTitle(item) }}\n </span>\n <span matLine class=\"truncate\">{{ item.description }}</span>\n <mat-divider></mat-divider>\n </button>\n </mat-action-list>\n </div>\n\n <ng-container *ngComponentOutlet=\"footerComponent\"></ng-container>\n </div>\n</ng-container>\n\n<div\n *ngIf=\"showEmptyState\"\n layout=\"column\"\n layout-align=\"center center\"\n class=\"empty-state\"\n>\n <mat-icon matListAvatar>subject</mat-icon>\n <h2>{{ emptyStateLabel }}</h2>\n</div>\n", styles: [":host{position:relative;height:inherit;height:100%;box-sizing:border-box;display:flex;flex-direction:column}:host td-breadcrumbs::ng-deep{margin:16px 16px 8px}:host td-breadcrumbs::ng-deep mat-icon{font-size:16px;margin-left:1px;margin-right:0;margin-top:-1px}:host .breadcrumb-end-icon{line-height:16px;margin-top:1px}:host .breadcrumb-current-title{font-weight:700;margin:0 16px 16px}:host .scroll-area{min-height:1px;overflow-y:auto;flex:1;box-sizing:border-box}:host .markdown-wrapper{padding:16px 16px 0}:host .td-markdown-list>.mat-list{padding-top:0}:host td-flavored-markdown-loader ::ng-deep .mat-progress-bar{top:0;left:0;right:0;position:absolute}:host .title{display:inline-block;vertical-align:middle;margin:8px 0;padding-left:16px}.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.empty-state{padding:32px}.empty-state mat-icon{font-size:4em}\n"], components: [{ type: i4.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { type: i5.TdBreadcrumbsComponent, selector: "td-breadcrumbs", inputs: ["separatorIcon"] }, { type: i5.TdBreadcrumbComponent, selector: "td-breadcrumb, a[td-breadcrumb]" }, { type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i7.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { type: i8.TdMessageComponent, selector: "td-message", inputs: ["label", "sublabel", "icon", "color", "opened"] }, { type: i9.TdFlavoredMarkdownLoaderComponent, selector: "td-flavored-markdown-loader", inputs: ["url", "httpOptions", "anchor", "copyCodeToClipboard", "copyCodeTooltips"], outputs: ["contentReady", "loadFailed", "buttonClicked"] }, { type: i9.TdFlavoredMarkdownComponent, selector: "td-flavored-markdown", inputs: ["content", "simpleLineBreaks", "hostedUrl", "anchor", "copyCodeToClipboard", "copyCodeTooltips"], outputs: ["contentReady", "buttonClicked"] }, { type: i10.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { type: i10.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }], directives: [{ type: i11.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i12.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i11.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.MatListIconCssMatStyler, selector: "[mat-list-icon], [matListIcon]" }, { type: i13.MatLine, selector: "[mat-line], [matLine]" }, { type: i11.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModuleFactory"] }, { type: i10.MatListAvatarCssMatStyler, selector: "[mat-list-avatar], [matListAvatar]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
345
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorComponent, decorators: [{
346
+ type: Component,
347
+ args: [{ selector: 'td-markdown-navigator', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"!showEmptyState\">\n <mat-progress-bar\n *ngIf=\"loading\"\n mode=\"indeterminate\"\n color=\"accent\"\n ></mat-progress-bar>\n <ng-container *ngIf=\"showHeader\">\n <td-breadcrumbs>\n <a\n td-breadcrumb\n [matTooltip]=\"goHomeLabel ?? ''\"\n (click)=\"reset()\"\n [attr.data-test]=\"'home-button'\"\n >Home</a\n >\n <ng-container\n *ngFor=\"let stack of historyStack; last as isLast; index as index\"\n >\n <ng-container *ngIf=\"!isLast; else lastBreadCrumb\">\n <a\n td-breadcrumb\n (click)=\"goBack(index)\"\n [attr.data-test]=\"'back-button'\"\n >{{ stack.title }}</a\n >\n </ng-container>\n <ng-template #lastBreadCrumb>\n <mat-icon class=\"breadcrumb-end-icon\">chevron_right</mat-icon>\n </ng-template>\n </ng-container>\n </td-breadcrumbs>\n <div class=\"breadcrumb-current-title\" [attr.data-test]=\"'title'\">\n {{ currentItemTitle }}\n </div>\n\n <mat-divider [style.position]=\"'relative'\"></mat-divider>\n </ng-container>\n\n <div class=\"scroll-area\" id=\"td-markdown-navigator-content\">\n <div\n *ngIf=\"showTdMarkdownLoader || showTdMarkdown\"\n class=\"markdown-wrapper\"\n #markdownWrapper\n >\n <td-message\n *ngIf=\"markdownLoaderError\"\n [sublabel]=\"markdownLoaderError\"\n color=\"warn\"\n icon=\"error\"\n [attr.data-test]=\"'markdown-loader-error'\"\n ></td-message>\n <td-flavored-markdown-loader\n *ngIf=\"showTdMarkdownLoader\"\n [url]=\"url ?? ''\"\n [httpOptions]=\"httpOptions ?? {}\"\n [anchor]=\"anchor ?? ''\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (loadFailed)=\"handleMarkdownLoaderError($event)\"\n ></td-flavored-markdown-loader>\n <td-flavored-markdown\n *ngIf=\"showTdMarkdown\"\n [content]=\"markdownString ?? ''\"\n [hostedUrl]=\"url ?? ''\"\n [anchor]=\"anchor ?? ''\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (buttonClicked)=\"buttonClicked.emit($event)\"\n ></td-flavored-markdown>\n </div>\n\n <td-message\n *ngIf=\"childrenUrlError\"\n [sublabel]=\"childrenUrlError\"\n color=\"warn\"\n icon=\"error\"\n [attr.data-test]=\"'children-url-error'\"\n ></td-message>\n <div *ngIf=\"showMenu\" class=\"td-markdown-list\">\n <mat-action-list>\n <button\n *ngFor=\"let item of currentMenuItems; index as index\"\n [id]=\"\n 'td-markdown-navigator-list-item-' + (item.id ? item.id : index)\n \"\n (click)=\"handleItemSelected(item)\"\n mat-list-item\n [matTooltip]=\"getTitle(item)\"\n matTooltipPosition=\"before\"\n matTooltipShowDelay=\"500\"\n >\n <mat-icon matListIcon>\n {{ getIcon(item) }}\n </mat-icon>\n <span matLine class=\"truncate\">\n {{ getTitle(item) }}\n </span>\n <span matLine class=\"truncate\">{{ item.description }}</span>\n <mat-divider></mat-divider>\n </button>\n </mat-action-list>\n </div>\n\n <ng-container *ngComponentOutlet=\"footerComponent\"></ng-container>\n </div>\n</ng-container>\n\n<div\n *ngIf=\"showEmptyState\"\n layout=\"column\"\n layout-align=\"center center\"\n class=\"empty-state\"\n>\n <mat-icon matListAvatar>subject</mat-icon>\n <h2>{{ emptyStateLabel }}</h2>\n</div>\n", styles: [":host{position:relative;height:inherit;height:100%;box-sizing:border-box;display:flex;flex-direction:column}:host td-breadcrumbs::ng-deep{margin:16px 16px 8px}:host td-breadcrumbs::ng-deep mat-icon{font-size:16px;margin-left:1px;margin-right:0;margin-top:-1px}:host .breadcrumb-end-icon{line-height:16px;margin-top:1px}:host .breadcrumb-current-title{font-weight:700;margin:0 16px 16px}:host .scroll-area{min-height:1px;overflow-y:auto;flex:1;box-sizing:border-box}:host .markdown-wrapper{padding:16px 16px 0}:host .td-markdown-list>.mat-list{padding-top:0}:host td-flavored-markdown-loader ::ng-deep .mat-progress-bar{top:0;left:0;right:0;position:absolute}:host .title{display:inline-block;vertical-align:middle;margin:8px 0;padding-left:16px}.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.empty-state{padding:32px}.empty-state mat-icon{font-size:4em}\n"] }]
348
+ }], ctorParameters: function () { return [{ type: i1.TdMarkdownLoaderService }, { type: i0.ChangeDetectorRef }, { type: i2.DomSanitizer }, { type: i3.HttpClient }]; }, propDecorators: { items: [{
349
+ type: Input
350
+ }], labels: [{
351
+ type: Input
352
+ }], startAt: [{
353
+ type: Input
354
+ }], copyCodeToClipboard: [{
355
+ type: Input
356
+ }], copyCodeTooltips: [{
357
+ type: Input
358
+ }], footer: [{
359
+ type: Input
360
+ }], compareWith: [{
361
+ type: Input
362
+ }], buttonClicked: [{
363
+ type: Output
364
+ }], markdownWrapper: [{
365
+ type: ViewChild,
366
+ args: ['markdownWrapper']
367
+ }], clickListener: [{
368
+ type: HostListener,
369
+ args: ['click', ['$event']]
370
+ }] } });
371
+ function getTitleFromUrl(url) {
372
+ if (url) {
373
+ const temp = new URL(url);
374
+ if (temp.hash) {
375
+ return removeLeadingHash(temp.hash);
376
+ }
377
+ else {
378
+ const path = temp.pathname.split('/');
379
+ const fileName = path[path.length - 1];
380
+ return fileName.replace(/\.[^/.]+$/, ''); // remove .md
381
+ }
382
+ }
383
+ return '';
384
+ }
385
+ function getTitleFromMarkdownString(markdownString) {
386
+ if (markdownString) {
387
+ const firstLine = markdownString.split(/[\r\n]+/).find((line) => !!line) ?? '';
388
+ return removeLeadingHash(firstLine).trim();
389
+ }
390
+ return '';
391
+ }
392
+ function isMarkdownHref(anchor) {
393
+ return !isAnchorLink(anchor) && anchor.pathname.endsWith('.md');
394
+ }
395
+ function defaultCompareWith(o1, o2) {
396
+ if (o1.id && o2.id) {
397
+ return o1.id === o2.id;
398
+ }
399
+ return o1 === o2;
400
+ }
596
401
 
597
402
  const DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS = {
598
403
  title: 'Help',
@@ -611,75 +416,68 @@ class TdMarkdownNavigatorWindowComponent {
611
416
  this.buttonClicked = new EventEmitter();
612
417
  }
613
418
  get markdownNavigatorLabels() {
614
- if (this.labels) {
615
- const { goHome, goBack, emptyState } = this.labels;
616
- return {
617
- goHome,
618
- goBack,
619
- emptyState,
620
- };
419
+ if (!this.labels) {
420
+ return undefined;
621
421
  }
422
+ const { goHome, goBack, emptyState } = this.labels;
423
+ return {
424
+ goHome,
425
+ goBack,
426
+ emptyState,
427
+ };
622
428
  }
623
429
  get titleLabel() {
624
- return (this.labels && this.labels.title) || DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.title;
430
+ return ((this.labels && this.labels.title) ||
431
+ DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.title);
625
432
  }
626
433
  get closeLabel() {
627
- return (this.labels && this.labels.close) || DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.close;
434
+ return ((this.labels && this.labels.close) ||
435
+ DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.close);
628
436
  }
629
437
  get toggleDockedStateLabel() {
630
438
  if (this.docked) {
631
- return (this.labels && this.labels.unDock) || DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.unDock;
439
+ return ((this.labels && this.labels.unDock) ||
440
+ DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.unDock);
632
441
  }
633
442
  else {
634
- return (this.labels && this.labels.dock) || DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.dock;
443
+ return ((this.labels && this.labels.dock) ||
444
+ DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.dock);
635
445
  }
636
446
  }
637
447
  toggleDockedState() {
638
448
  this.dockToggled.emit(this.docked);
639
449
  }
640
450
  }
641
- /** @nocollapse */ /** @nocollapse */ TdMarkdownNavigatorWindowComponent.ɵfac = function TdMarkdownNavigatorWindowComponent_Factory(t) { return new (t || TdMarkdownNavigatorWindowComponent)(); };
642
- /** @nocollapse */ /** @nocollapse */ TdMarkdownNavigatorWindowComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: TdMarkdownNavigatorWindowComponent, selectors: [["td-markdown-navigator-window"]], inputs: { items: "items", labels: "labels", toolbarColor: "toolbarColor", startAt: "startAt", compareWith: "compareWith", docked: "docked", copyCodeToClipboard: "copyCodeToClipboard", copyCodeTooltips: "copyCodeTooltips", footer: "footer" }, outputs: { closed: "closed", dockToggled: "dockToggled", buttonClicked: "buttonClicked" }, decls: 2, vars: 14, consts: [[3, "toolbarColor", "docked", "title", "toggleDockedStateLabel", "closeLabel", "dockToggled", "closed"], [3, "items", "labels", "startAt", "compareWith", "footer", "copyCodeToClipboard", "copyCodeTooltips", "buttonClicked"]], template: function TdMarkdownNavigatorWindowComponent_Template(rf, ctx) { if (rf & 1) {
643
- i0.ɵɵelementStart(0, "td-window-dialog", 0);
644
- i0.ɵɵlistener("dockToggled", function TdMarkdownNavigatorWindowComponent_Template_td_window_dialog_dockToggled_0_listener() { return ctx.toggleDockedState(); })("closed", function TdMarkdownNavigatorWindowComponent_Template_td_window_dialog_closed_0_listener() { return ctx.closed.emit(); });
645
- i0.ɵɵelementStart(1, "td-markdown-navigator", 1);
646
- i0.ɵɵlistener("buttonClicked", function TdMarkdownNavigatorWindowComponent_Template_td_markdown_navigator_buttonClicked_1_listener($event) { return ctx.buttonClicked.emit($event); });
647
- i0.ɵɵelementEnd();
648
- i0.ɵɵelementEnd();
649
- } if (rf & 2) {
650
- i0.ɵɵproperty("toolbarColor", ctx.toolbarColor)("docked", ctx.docked)("title", ctx.titleLabel)("toggleDockedStateLabel", ctx.toggleDockedStateLabel)("closeLabel", ctx.closeLabel);
651
- i0.ɵɵadvance(1);
652
- i0.ɵɵstyleProp("display", ctx.docked ? "none" : "inherit");
653
- i0.ɵɵproperty("items", ctx.items)("labels", ctx.markdownNavigatorLabels)("startAt", ctx.startAt)("compareWith", ctx.compareWith)("footer", ctx.footer)("copyCodeToClipboard", ctx.copyCodeToClipboard)("copyCodeTooltips", ctx.copyCodeTooltips);
654
- } }, directives: [i1$1.TdWindowDialogComponent, TdMarkdownNavigatorComponent], styles: ["[_nghost-%COMP%]{height:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}td-markdown-navigator[_ngcontent-%COMP%]{height:calc(100% - 56px)}"], changeDetection: 0 });
655
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownNavigatorWindowComponent, [{
656
- type: Component,
657
- args: [{ selector: 'td-markdown-navigator-window', changeDetection: ChangeDetectionStrategy.OnPush, template: "<td-window-dialog\n [toolbarColor]=\"toolbarColor\"\n [docked]=\"docked\"\n [title]=\"titleLabel\"\n [toggleDockedStateLabel]=\"toggleDockedStateLabel\"\n [closeLabel]=\"closeLabel\"\n (dockToggled)=\"toggleDockedState()\"\n (closed)=\"closed.emit()\"\n>\n <td-markdown-navigator\n [items]=\"items\"\n [labels]=\"markdownNavigatorLabels\"\n [style.display]=\"docked ? 'none' : 'inherit'\"\n [startAt]=\"startAt\"\n [compareWith]=\"compareWith\"\n [footer]=\"footer\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (buttonClicked)=\"buttonClicked.emit($event)\"\n ></td-markdown-navigator>\n</td-window-dialog>\n", styles: [":host{height:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}td-markdown-navigator{height:calc(100% - 56px)}\n"] }]
658
- }], null, { items: [{
659
- type: Input
660
- }], labels: [{
661
- type: Input
662
- }], toolbarColor: [{
663
- type: Input
664
- }], startAt: [{
665
- type: Input
666
- }], compareWith: [{
667
- type: Input
668
- }], docked: [{
669
- type: Input
670
- }], copyCodeToClipboard: [{
671
- type: Input
672
- }], copyCodeTooltips: [{
673
- type: Input
674
- }], footer: [{
675
- type: Input
676
- }], closed: [{
677
- type: Output
678
- }], dockToggled: [{
679
- type: Output
680
- }], buttonClicked: [{
681
- type: Output
682
- }] }); })();
451
+ TdMarkdownNavigatorWindowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
452
+ TdMarkdownNavigatorWindowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: TdMarkdownNavigatorWindowComponent, selector: "td-markdown-navigator-window", inputs: { items: "items", labels: "labels", toolbarColor: "toolbarColor", startAt: "startAt", compareWith: "compareWith", docked: "docked", copyCodeToClipboard: "copyCodeToClipboard", copyCodeTooltips: "copyCodeTooltips", footer: "footer" }, outputs: { closed: "closed", dockToggled: "dockToggled", buttonClicked: "buttonClicked" }, ngImport: i0, template: "<td-window-dialog\n [toolbarColor]=\"toolbarColor\"\n [docked]=\"docked\"\n [title]=\"titleLabel\"\n [toggleDockedStateLabel]=\"toggleDockedStateLabel\"\n [closeLabel]=\"closeLabel\"\n (dockToggled)=\"toggleDockedState()\"\n (closed)=\"closed.emit()\"\n>\n <td-markdown-navigator\n [items]=\"items\"\n [labels]=\"markdownNavigatorLabels\"\n [style.display]=\"docked ? 'none' : 'inherit'\"\n [startAt]=\"startAt\"\n [compareWith]=\"compareWith\"\n [footer]=\"footer\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (buttonClicked)=\"buttonClicked.emit($event)\"\n ></td-markdown-navigator>\n</td-window-dialog>\n", styles: [":host{height:100%;display:flex;flex-direction:column}td-markdown-navigator{height:calc(100% - 56px)}\n"], components: [{ type: i1$1.TdWindowDialogComponent, selector: "td-window-dialog", inputs: ["toolbarColor", "docked", "title", "toggleDockedStateLabel", "closeLabel"], outputs: ["dockToggled", "closed"] }, { type: TdMarkdownNavigatorComponent, selector: "td-markdown-navigator", inputs: ["items", "labels", "startAt", "copyCodeToClipboard", "copyCodeTooltips", "footer", "compareWith"], outputs: ["buttonClicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
453
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowComponent, decorators: [{
454
+ type: Component,
455
+ args: [{ selector: 'td-markdown-navigator-window', changeDetection: ChangeDetectionStrategy.OnPush, template: "<td-window-dialog\n [toolbarColor]=\"toolbarColor\"\n [docked]=\"docked\"\n [title]=\"titleLabel\"\n [toggleDockedStateLabel]=\"toggleDockedStateLabel\"\n [closeLabel]=\"closeLabel\"\n (dockToggled)=\"toggleDockedState()\"\n (closed)=\"closed.emit()\"\n>\n <td-markdown-navigator\n [items]=\"items\"\n [labels]=\"markdownNavigatorLabels\"\n [style.display]=\"docked ? 'none' : 'inherit'\"\n [startAt]=\"startAt\"\n [compareWith]=\"compareWith\"\n [footer]=\"footer\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (buttonClicked)=\"buttonClicked.emit($event)\"\n ></td-markdown-navigator>\n</td-window-dialog>\n", styles: [":host{height:100%;display:flex;flex-direction:column}td-markdown-navigator{height:calc(100% - 56px)}\n"] }]
456
+ }], propDecorators: { items: [{
457
+ type: Input
458
+ }], labels: [{
459
+ type: Input
460
+ }], toolbarColor: [{
461
+ type: Input
462
+ }], startAt: [{
463
+ type: Input
464
+ }], compareWith: [{
465
+ type: Input
466
+ }], docked: [{
467
+ type: Input
468
+ }], copyCodeToClipboard: [{
469
+ type: Input
470
+ }], copyCodeTooltips: [{
471
+ type: Input
472
+ }], footer: [{
473
+ type: Input
474
+ }], closed: [{
475
+ type: Output
476
+ }], dockToggled: [{
477
+ type: Output
478
+ }], buttonClicked: [{
479
+ type: Output
480
+ }] } });
683
481
 
684
482
  const CDK_OVERLAY_CUSTOM_CLASS = 'td-window-dialog';
685
483
  const DEFAULT_POSITION = { bottom: '0px', right: '0px' };
@@ -701,27 +499,19 @@ class TdMarkdownNavigatorWindowService {
701
499
  this._tdDialogService = _tdDialogService;
702
500
  this._document = _document;
703
501
  this.rendererFactory = rendererFactory;
704
- this.markdownNavigatorWindowDialog = undefined;
705
502
  this.markdownNavigatorWindowDialogsOpen = 0;
706
- this._renderer2 = rendererFactory.createRenderer(undefined, undefined);
503
+ this._renderer2 = rendererFactory.createRenderer(undefined, null);
707
504
  }
708
505
  open(config) {
709
506
  this.close();
710
- let panelClass = [...DEFAULT_DRAGGABLE_DIALOG_CONFIG.panelClass];
711
- if (config.dialogConfig && config.dialogConfig.panelClass) {
712
- if (Array.isArray(config.dialogConfig.panelClass)) {
713
- panelClass = [...config.dialogConfig.panelClass];
714
- }
715
- else {
716
- panelClass = [config.dialogConfig.panelClass];
717
- }
718
- }
507
+ const configClass = config?.dialogConfig?.panelClass;
508
+ const panelClass = configClass && !Array.isArray(configClass) ? [configClass] : [];
719
509
  const draggableConfig = {
720
510
  ...DEFAULT_DRAGGABLE_DIALOG_CONFIG,
721
511
  ...config.dialogConfig,
722
- panelClass,
512
+ ...panelClass,
723
513
  };
724
- const { matDialogRef, dragRefSubject } = this._tdDialogService.openDraggable({
514
+ const { matDialogRef, dragRefSubject, } = this._tdDialogService.openDraggable({
725
515
  component: TdMarkdownNavigatorWindowComponent,
726
516
  config: draggableConfig,
727
517
  dragHandleSelectors: ['.td-window-dialog-toolbar'],
@@ -730,10 +520,14 @@ class TdMarkdownNavigatorWindowService {
730
520
  this.markdownNavigatorWindowDialog = matDialogRef;
731
521
  this.markdownNavigatorWindowDialog.componentInstance.items = config.items;
732
522
  this.markdownNavigatorWindowDialog.componentInstance.labels = config.labels;
733
- this.markdownNavigatorWindowDialog.componentInstance.startAt = config.startAt;
734
- this.markdownNavigatorWindowDialog.componentInstance.copyCodeToClipboard = config.copyCodeToClipboard;
735
- this.markdownNavigatorWindowDialog.componentInstance.copyCodeTooltips = config.copyCodeTooltips;
736
- this.markdownNavigatorWindowDialog.componentInstance.compareWith = config.compareWith;
523
+ this.markdownNavigatorWindowDialog.componentInstance.startAt =
524
+ config.startAt;
525
+ this.markdownNavigatorWindowDialog.componentInstance.copyCodeToClipboard =
526
+ config.copyCodeToClipboard;
527
+ this.markdownNavigatorWindowDialog.componentInstance.copyCodeTooltips =
528
+ config.copyCodeTooltips;
529
+ this.markdownNavigatorWindowDialog.componentInstance.compareWith =
530
+ config.compareWith;
737
531
  this.markdownNavigatorWindowDialog.componentInstance.toolbarColor =
738
532
  'toolbarColor' in config ? config.toolbarColor : 'primary';
739
533
  this.markdownNavigatorWindowDialogsOpen++;
@@ -764,7 +558,12 @@ class TdMarkdownNavigatorWindowService {
764
558
  if (docked) {
765
559
  this.markdownNavigatorWindowDialog.componentInstance.docked = false;
766
560
  this.markdownNavigatorWindowDialog.updateSize(dimensions.width, dimensions.height);
767
- this.markdownNavigatorWindowDialog.updatePosition({ top: '0px', right: '0px', bottom: '0px', left: '0px' });
561
+ this.markdownNavigatorWindowDialog.updatePosition({
562
+ top: '0px',
563
+ right: '0px',
564
+ bottom: '0px',
565
+ left: '0px',
566
+ });
768
567
  this.dragRef.setFreeDragPosition(position);
769
568
  this.dragRef.disabled = false;
770
569
  this.resizableDraggableDialog.attach();
@@ -795,14 +594,14 @@ class TdMarkdownNavigatorWindowService {
795
594
  };
796
595
  }
797
596
  }
798
- /** @nocollapse */ /** @nocollapse */ TdMarkdownNavigatorWindowService.ɵfac = function TdMarkdownNavigatorWindowService_Factory(t) { return new (t || TdMarkdownNavigatorWindowService)(i0.ɵɵinject(i1$1.TdDialogService), i0.ɵɵinject(DOCUMENT), i0.ɵɵinject(i0.RendererFactory2)); };
799
- /** @nocollapse */ /** @nocollapse */ TdMarkdownNavigatorWindowService.ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TdMarkdownNavigatorWindowService, factory: TdMarkdownNavigatorWindowService.ɵfac });
800
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownNavigatorWindowService, [{
801
- type: Injectable
802
- }], function () { return [{ type: i1$1.TdDialogService }, { type: undefined, decorators: [{
803
- type: Inject,
804
- args: [DOCUMENT]
805
- }] }, { type: i0.RendererFactory2 }]; }, null); })();
597
+ TdMarkdownNavigatorWindowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowService, deps: [{ token: i1$1.TdDialogService }, { token: DOCUMENT }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
598
+ TdMarkdownNavigatorWindowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowService });
599
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowService, decorators: [{
600
+ type: Injectable
601
+ }], ctorParameters: function () { return [{ type: i1$1.TdDialogService }, { type: undefined, decorators: [{
602
+ type: Inject,
603
+ args: [DOCUMENT]
604
+ }] }, { type: i0.RendererFactory2 }]; } });
806
605
 
807
606
  class TdMarkdownNavigatorWindowDirective {
808
607
  constructor(_markdownNavigatorWindowService) {
@@ -810,35 +609,47 @@ class TdMarkdownNavigatorWindowDirective {
810
609
  this.disabled = false;
811
610
  }
812
611
  click() {
813
- if (!this.disabled) {
612
+ if (!this.disabled && this.config) {
814
613
  this._markdownNavigatorWindowService.open(this.config);
815
614
  }
816
615
  }
817
616
  }
818
- /** @nocollapse */ /** @nocollapse */ TdMarkdownNavigatorWindowDirective.ɵfac = function TdMarkdownNavigatorWindowDirective_Factory(t) { return new (t || TdMarkdownNavigatorWindowDirective)(i0.ɵɵdirectiveInject(TdMarkdownNavigatorWindowService)); };
819
- /** @nocollapse */ /** @nocollapse */ TdMarkdownNavigatorWindowDirective.ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: TdMarkdownNavigatorWindowDirective, selectors: [["", "tdMarkdownNavigatorWindow", ""]], hostBindings: function TdMarkdownNavigatorWindowDirective_HostBindings(rf, ctx) { if (rf & 1) {
820
- i0.ɵɵlistener("click", function TdMarkdownNavigatorWindowDirective_click_HostBindingHandler() { return ctx.click(); });
821
- } }, inputs: { config: ["tdMarkdownNavigatorWindow", "config"], disabled: "disabled" } });
822
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownNavigatorWindowDirective, [{
823
- type: Directive,
824
- args: [{
825
- selector: '[tdMarkdownNavigatorWindow]',
826
- }]
827
- }], function () { return [{ type: TdMarkdownNavigatorWindowService }]; }, { config: [{
828
- type: Input,
829
- args: ['tdMarkdownNavigatorWindow']
830
- }], disabled: [{
831
- type: Input
832
- }], click: [{
833
- type: HostListener,
834
- args: ['click']
835
- }] }); })();
617
+ TdMarkdownNavigatorWindowDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowDirective, deps: [{ token: TdMarkdownNavigatorWindowService }], target: i0.ɵɵFactoryTarget.Directive });
618
+ TdMarkdownNavigatorWindowDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.2", type: TdMarkdownNavigatorWindowDirective, selector: "[tdMarkdownNavigatorWindow]", inputs: { config: ["tdMarkdownNavigatorWindow", "config"], disabled: "disabled" }, host: { listeners: { "click": "click()" } }, ngImport: i0 });
619
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowDirective, decorators: [{
620
+ type: Directive,
621
+ args: [{
622
+ selector: '[tdMarkdownNavigatorWindow]',
623
+ }]
624
+ }], ctorParameters: function () { return [{ type: TdMarkdownNavigatorWindowService }]; }, propDecorators: { config: [{
625
+ type: Input,
626
+ args: ['tdMarkdownNavigatorWindow']
627
+ }], disabled: [{
628
+ type: Input
629
+ }], click: [{
630
+ type: HostListener,
631
+ args: ['click']
632
+ }] } });
836
633
 
837
634
  class CovalentMarkdownNavigatorModule {
838
635
  }
839
- /** @nocollapse */ /** @nocollapse */ CovalentMarkdownNavigatorModule.ɵfac = function CovalentMarkdownNavigatorModule_Factory(t) { return new (t || CovalentMarkdownNavigatorModule)(); };
840
- /** @nocollapse */ /** @nocollapse */ CovalentMarkdownNavigatorModule.ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: CovalentMarkdownNavigatorModule });
841
- /** @nocollapse */ /** @nocollapse */ CovalentMarkdownNavigatorModule.ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ providers: [TdMarkdownNavigatorWindowService], imports: [[
636
+ CovalentMarkdownNavigatorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownNavigatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
637
+ CovalentMarkdownNavigatorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownNavigatorModule, declarations: [TdMarkdownNavigatorComponent,
638
+ TdMarkdownNavigatorWindowComponent,
639
+ TdMarkdownNavigatorWindowDirective], imports: [CommonModule,
640
+ // material
641
+ MatButtonModule,
642
+ MatTooltipModule,
643
+ MatListModule,
644
+ MatIconModule,
645
+ MatProgressBarModule,
646
+ CovalentBreadcrumbsModule,
647
+ CovalentDialogsModule,
648
+ CovalentFlavoredMarkdownModule,
649
+ CovalentMessageModule], exports: [TdMarkdownNavigatorComponent,
650
+ TdMarkdownNavigatorWindowComponent,
651
+ TdMarkdownNavigatorWindowDirective] });
652
+ CovalentMarkdownNavigatorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownNavigatorModule, providers: [TdMarkdownNavigatorWindowService], imports: [[
842
653
  CommonModule,
843
654
  // material
844
655
  MatButtonModule,
@@ -846,40 +657,40 @@ class CovalentMarkdownNavigatorModule {
846
657
  MatListModule,
847
658
  MatIconModule,
848
659
  MatProgressBarModule,
849
- CovalentMessageModule,
850
- CovalentFlavoredMarkdownModule,
660
+ CovalentBreadcrumbsModule,
851
661
  CovalentDialogsModule,
662
+ CovalentFlavoredMarkdownModule,
663
+ CovalentMessageModule,
852
664
  ]] });
853
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CovalentMarkdownNavigatorModule, [{
854
- type: NgModule,
855
- args: [{
856
- imports: [
857
- CommonModule,
858
- // material
859
- MatButtonModule,
860
- MatTooltipModule,
861
- MatListModule,
862
- MatIconModule,
863
- MatProgressBarModule,
864
- CovalentMessageModule,
865
- CovalentFlavoredMarkdownModule,
866
- CovalentDialogsModule,
867
- ],
868
- declarations: [TdMarkdownNavigatorComponent, TdMarkdownNavigatorWindowComponent, TdMarkdownNavigatorWindowDirective],
869
- exports: [TdMarkdownNavigatorComponent, TdMarkdownNavigatorWindowComponent, TdMarkdownNavigatorWindowDirective],
870
- providers: [TdMarkdownNavigatorWindowService],
871
- }]
872
- }], null, null); })();
873
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CovalentMarkdownNavigatorModule, { declarations: [TdMarkdownNavigatorComponent, TdMarkdownNavigatorWindowComponent, TdMarkdownNavigatorWindowDirective], imports: [CommonModule,
874
- // material
875
- MatButtonModule,
876
- MatTooltipModule,
877
- MatListModule,
878
- MatIconModule,
879
- MatProgressBarModule,
880
- CovalentMessageModule,
881
- CovalentFlavoredMarkdownModule,
882
- CovalentDialogsModule], exports: [TdMarkdownNavigatorComponent, TdMarkdownNavigatorWindowComponent, TdMarkdownNavigatorWindowDirective] }); })();
665
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownNavigatorModule, decorators: [{
666
+ type: NgModule,
667
+ args: [{
668
+ imports: [
669
+ CommonModule,
670
+ // material
671
+ MatButtonModule,
672
+ MatTooltipModule,
673
+ MatListModule,
674
+ MatIconModule,
675
+ MatProgressBarModule,
676
+ CovalentBreadcrumbsModule,
677
+ CovalentDialogsModule,
678
+ CovalentFlavoredMarkdownModule,
679
+ CovalentMessageModule,
680
+ ],
681
+ declarations: [
682
+ TdMarkdownNavigatorComponent,
683
+ TdMarkdownNavigatorWindowComponent,
684
+ TdMarkdownNavigatorWindowDirective,
685
+ ],
686
+ exports: [
687
+ TdMarkdownNavigatorComponent,
688
+ TdMarkdownNavigatorWindowComponent,
689
+ TdMarkdownNavigatorWindowDirective,
690
+ ],
691
+ providers: [TdMarkdownNavigatorWindowService],
692
+ }]
693
+ }] });
883
694
 
884
695
  /**
885
696
  * Generated bundle index. Do not edit.