@covalent/markdown-navigator 4.0.0-beta.2 → 4.1.0-develop.10
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.
- package/README.md +70 -58
- package/_markdon-navigator-theme.scss +22 -0
- package/covalent-markdown-navigator.d.ts +1 -1
- package/esm2020/covalent-markdown-navigator.mjs +2 -2
- package/esm2020/markdown-navigator-window/markdown-navigator-window.component.mjs +48 -55
- package/esm2020/markdown-navigator-window-directive/markdown-navigator-window.directive.mjs +18 -20
- package/esm2020/markdown-navigator-window-service/markdown-navigator-window.service.mjs +30 -29
- package/esm2020/markdown-navigator.component.mjs +114 -310
- package/esm2020/markdown-navigator.module.mjs +51 -36
- package/esm2020/public_api.mjs +6 -0
- package/fesm2015/covalent-markdown-navigator.mjs +181 -437
- package/fesm2015/covalent-markdown-navigator.mjs.map +1 -1
- package/fesm2020/covalent-markdown-navigator.mjs +254 -443
- package/fesm2020/covalent-markdown-navigator.mjs.map +1 -1
- package/markdown-navigator-window/markdown-navigator-window.component.d.ts +12 -12
- package/markdown-navigator-window-directive/markdown-navigator-window.directive.d.ts +1 -1
- package/markdown-navigator.component.d.ts +19 -20
- package/markdown-navigator.module.d.ts +5 -4
- package/package.json +22 -18
- package/{public-api.d.ts → public_api.d.ts} +0 -0
- package/esm2020/index.mjs +0 -2
- package/esm2020/public-api.mjs +0 -6
- package/index.d.ts +0 -1
- package/markdown-navigator-window/markdown-navigator-window.component.scss +0 -9
- package/markdown-navigator.component.scss +0 -55
|
@@ -1,303 +1,38 @@
|
|
|
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
|
|
3
|
+
import * as i11 from '@angular/common';
|
|
4
4
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
5
5
|
import { __awaiter } from 'tslib';
|
|
6
6
|
import * as i1 from '@covalent/markdown';
|
|
7
|
-
import {
|
|
7
|
+
import { isAnchorLink, removeLeadingHash } from '@covalent/markdown';
|
|
8
|
+
import { firstValueFrom } from 'rxjs';
|
|
8
9
|
import * as i2 from '@angular/platform-browser';
|
|
9
10
|
import * as i3 from '@angular/common/http';
|
|
10
|
-
import * as
|
|
11
|
+
import * as i4 from '@angular/material/progress-bar';
|
|
11
12
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
12
|
-
import * as
|
|
13
|
-
import {
|
|
14
|
-
import * as
|
|
15
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
16
|
-
import * as i8 from '@angular/material/icon';
|
|
13
|
+
import * as i5 from '@covalent/core/breadcrumbs';
|
|
14
|
+
import { CovalentBreadcrumbsModule } from '@covalent/core/breadcrumbs';
|
|
15
|
+
import * as i6 from '@angular/material/icon';
|
|
17
16
|
import { MatIconModule } from '@angular/material/icon';
|
|
18
|
-
import * as
|
|
19
|
-
import * as
|
|
17
|
+
import * as i7 from '@angular/material/divider';
|
|
18
|
+
import * as i8 from '@covalent/core/message';
|
|
20
19
|
import { CovalentMessageModule } from '@covalent/core/message';
|
|
21
|
-
import * as
|
|
20
|
+
import * as i9 from '@covalent/flavored-markdown';
|
|
22
21
|
import { CovalentFlavoredMarkdownModule } from '@covalent/flavored-markdown';
|
|
23
|
-
import * as
|
|
22
|
+
import * as i10 from '@angular/material/list';
|
|
24
23
|
import { MatListModule } from '@angular/material/list';
|
|
24
|
+
import * as i12 from '@angular/material/tooltip';
|
|
25
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
25
26
|
import * as i13 from '@angular/material/core';
|
|
26
27
|
import * as i1$1 from '@covalent/core/dialogs';
|
|
27
28
|
import { ResizableDraggableDialog, CovalentDialogsModule } from '@covalent/core/dialogs';
|
|
29
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
28
30
|
|
|
29
|
-
const _c0 = ["markdownWrapper"];
|
|
30
|
-
function TdMarkdownNavigatorComponent_ng_container_0_mat_progress_bar_1_Template(rf, ctx) {
|
|
31
|
-
if (rf & 1) {
|
|
32
|
-
i0.ɵɵelement(0, "mat-progress-bar", 8);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_2_Template(rf, ctx) {
|
|
36
|
-
if (rf & 1) {
|
|
37
|
-
const _r12 = i0.ɵɵgetCurrentView();
|
|
38
|
-
i0.ɵɵelementStart(0, "button", 12);
|
|
39
|
-
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(); });
|
|
40
|
-
i0.ɵɵelementStart(1, "mat-icon");
|
|
41
|
-
i0.ɵɵtext(2, "home");
|
|
42
|
-
i0.ɵɵelementEnd();
|
|
43
|
-
i0.ɵɵelementEnd();
|
|
44
|
-
}
|
|
45
|
-
if (rf & 2) {
|
|
46
|
-
const ctx_r8 = i0.ɵɵnextContext(3);
|
|
47
|
-
i0.ɵɵproperty("matTooltip", ctx_r8.goHomeLabel);
|
|
48
|
-
i0.ɵɵattribute("data-test", "home-button");
|
|
49
|
-
i0.ɵɵadvance(1);
|
|
50
|
-
i0.ɵɵattribute("aria-label", ctx_r8.goHomeLabel);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_3_Template(rf, ctx) {
|
|
54
|
-
if (rf & 1) {
|
|
55
|
-
const _r14 = i0.ɵɵgetCurrentView();
|
|
56
|
-
i0.ɵɵelementStart(0, "button", 13);
|
|
57
|
-
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(); });
|
|
58
|
-
i0.ɵɵelementStart(1, "mat-icon");
|
|
59
|
-
i0.ɵɵtext(2, "arrow_back");
|
|
60
|
-
i0.ɵɵelementEnd();
|
|
61
|
-
i0.ɵɵelementEnd();
|
|
62
|
-
}
|
|
63
|
-
if (rf & 2) {
|
|
64
|
-
const ctx_r9 = i0.ɵɵnextContext(3);
|
|
65
|
-
i0.ɵɵproperty("matTooltip", ctx_r9.goBackLabel);
|
|
66
|
-
i0.ɵɵattribute("data-test", "back-button");
|
|
67
|
-
i0.ɵɵadvance(1);
|
|
68
|
-
i0.ɵɵattribute("aria-label", ctx_r9.goBackLabel);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_span_4_Template(rf, ctx) {
|
|
72
|
-
if (rf & 1) {
|
|
73
|
-
i0.ɵɵelementStart(0, "span", 14);
|
|
74
|
-
i0.ɵɵtext(1);
|
|
75
|
-
i0.ɵɵelementEnd();
|
|
76
|
-
}
|
|
77
|
-
if (rf & 2) {
|
|
78
|
-
const ctx_r10 = i0.ɵɵnextContext(3);
|
|
79
|
-
i0.ɵɵattribute("data-test", "title");
|
|
80
|
-
i0.ɵɵadvance(1);
|
|
81
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r10.currentItemTitle, " ");
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_Template(rf, ctx) {
|
|
85
|
-
if (rf & 1) {
|
|
86
|
-
i0.ɵɵelementContainerStart(0);
|
|
87
|
-
i0.ɵɵelementStart(1, "div");
|
|
88
|
-
i0.ɵɵtemplate(2, TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_2_Template, 3, 3, "button", 9);
|
|
89
|
-
i0.ɵɵtemplate(3, TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_3_Template, 3, 3, "button", 10);
|
|
90
|
-
i0.ɵɵtemplate(4, TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_span_4_Template, 2, 2, "span", 11);
|
|
91
|
-
i0.ɵɵelementEnd();
|
|
92
|
-
i0.ɵɵelement(5, "mat-divider");
|
|
93
|
-
i0.ɵɵelementContainerEnd();
|
|
94
|
-
}
|
|
95
|
-
if (rf & 2) {
|
|
96
|
-
const ctx_r3 = i0.ɵɵnextContext(2);
|
|
97
|
-
i0.ɵɵadvance(1);
|
|
98
|
-
i0.ɵɵstyleProp("display", "flex");
|
|
99
|
-
i0.ɵɵadvance(1);
|
|
100
|
-
i0.ɵɵproperty("ngIf", ctx_r3.showHomeButton);
|
|
101
|
-
i0.ɵɵadvance(1);
|
|
102
|
-
i0.ɵɵproperty("ngIf", ctx_r3.showGoBackButton);
|
|
103
|
-
i0.ɵɵadvance(1);
|
|
104
|
-
i0.ɵɵproperty("ngIf", ctx_r3.currentItemTitle);
|
|
105
|
-
i0.ɵɵadvance(1);
|
|
106
|
-
i0.ɵɵstyleProp("position", "relative");
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
function TdMarkdownNavigatorComponent_ng_container_0_div_4_td_message_2_Template(rf, ctx) {
|
|
110
|
-
if (rf & 1) {
|
|
111
|
-
i0.ɵɵelement(0, "td-message", 19);
|
|
112
|
-
}
|
|
113
|
-
if (rf & 2) {
|
|
114
|
-
const ctx_r16 = i0.ɵɵnextContext(3);
|
|
115
|
-
i0.ɵɵproperty("sublabel", ctx_r16.markdownLoaderError);
|
|
116
|
-
i0.ɵɵattribute("data-test", "markdown-loader-error");
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
function TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_loader_3_Template(rf, ctx) {
|
|
120
|
-
if (rf & 1) {
|
|
121
|
-
const _r20 = i0.ɵɵgetCurrentView();
|
|
122
|
-
i0.ɵɵelementStart(0, "td-flavored-markdown-loader", 20);
|
|
123
|
-
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); });
|
|
124
|
-
i0.ɵɵelementEnd();
|
|
125
|
-
}
|
|
126
|
-
if (rf & 2) {
|
|
127
|
-
const ctx_r17 = i0.ɵɵnextContext(3);
|
|
128
|
-
i0.ɵɵproperty("url", ctx_r17.url)("httpOptions", ctx_r17.httpOptions)("anchor", ctx_r17.anchor)("copyCodeToClipboard", ctx_r17.copyCodeToClipboard)("copyCodeTooltips", ctx_r17.copyCodeTooltips);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
function TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_4_Template(rf, ctx) {
|
|
132
|
-
if (rf & 1) {
|
|
133
|
-
const _r22 = i0.ɵɵgetCurrentView();
|
|
134
|
-
i0.ɵɵelementStart(0, "td-flavored-markdown", 21);
|
|
135
|
-
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); });
|
|
136
|
-
i0.ɵɵelementEnd();
|
|
137
|
-
}
|
|
138
|
-
if (rf & 2) {
|
|
139
|
-
const ctx_r18 = i0.ɵɵnextContext(3);
|
|
140
|
-
i0.ɵɵproperty("content", ctx_r18.markdownString)("hostedUrl", ctx_r18.url)("anchor", ctx_r18.anchor)("copyCodeToClipboard", ctx_r18.copyCodeToClipboard)("copyCodeTooltips", ctx_r18.copyCodeTooltips);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
function TdMarkdownNavigatorComponent_ng_container_0_div_4_Template(rf, ctx) {
|
|
144
|
-
if (rf & 1) {
|
|
145
|
-
i0.ɵɵelementStart(0, "div", 15, 16);
|
|
146
|
-
i0.ɵɵtemplate(2, TdMarkdownNavigatorComponent_ng_container_0_div_4_td_message_2_Template, 1, 2, "td-message", 5);
|
|
147
|
-
i0.ɵɵtemplate(3, TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_loader_3_Template, 1, 5, "td-flavored-markdown-loader", 17);
|
|
148
|
-
i0.ɵɵtemplate(4, TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_4_Template, 1, 5, "td-flavored-markdown", 18);
|
|
149
|
-
i0.ɵɵelementEnd();
|
|
150
|
-
}
|
|
151
|
-
if (rf & 2) {
|
|
152
|
-
const ctx_r4 = i0.ɵɵnextContext(2);
|
|
153
|
-
i0.ɵɵadvance(2);
|
|
154
|
-
i0.ɵɵproperty("ngIf", ctx_r4.markdownLoaderError);
|
|
155
|
-
i0.ɵɵadvance(1);
|
|
156
|
-
i0.ɵɵproperty("ngIf", ctx_r4.showTdMarkdownLoader);
|
|
157
|
-
i0.ɵɵadvance(1);
|
|
158
|
-
i0.ɵɵproperty("ngIf", ctx_r4.showTdMarkdown);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
function TdMarkdownNavigatorComponent_ng_container_0_td_message_5_Template(rf, ctx) {
|
|
162
|
-
if (rf & 1) {
|
|
163
|
-
i0.ɵɵelement(0, "td-message", 19);
|
|
164
|
-
}
|
|
165
|
-
if (rf & 2) {
|
|
166
|
-
const ctx_r5 = i0.ɵɵnextContext(2);
|
|
167
|
-
i0.ɵɵproperty("sublabel", ctx_r5.childrenUrlError);
|
|
168
|
-
i0.ɵɵattribute("data-test", "children-url-error");
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
function TdMarkdownNavigatorComponent_ng_container_0_div_6_button_2_Template(rf, ctx) {
|
|
172
|
-
if (rf & 1) {
|
|
173
|
-
const _r27 = i0.ɵɵgetCurrentView();
|
|
174
|
-
i0.ɵɵelementStart(0, "button", 24);
|
|
175
|
-
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); });
|
|
176
|
-
i0.ɵɵelementStart(1, "mat-icon", 25);
|
|
177
|
-
i0.ɵɵtext(2);
|
|
178
|
-
i0.ɵɵelementEnd();
|
|
179
|
-
i0.ɵɵelementStart(3, "span", 26);
|
|
180
|
-
i0.ɵɵtext(4);
|
|
181
|
-
i0.ɵɵelementEnd();
|
|
182
|
-
i0.ɵɵelementStart(5, "span", 26);
|
|
183
|
-
i0.ɵɵtext(6);
|
|
184
|
-
i0.ɵɵelementEnd();
|
|
185
|
-
i0.ɵɵelement(7, "mat-divider");
|
|
186
|
-
i0.ɵɵelementEnd();
|
|
187
|
-
}
|
|
188
|
-
if (rf & 2) {
|
|
189
|
-
const item_r24 = ctx.$implicit;
|
|
190
|
-
const index_r25 = ctx.index;
|
|
191
|
-
const ctx_r23 = i0.ɵɵnextContext(3);
|
|
192
|
-
i0.ɵɵproperty("id", "td-markdown-navigator-list-item-" + (item_r24.id ? item_r24.id : index_r25))("matTooltip", ctx_r23.getTitle(item_r24));
|
|
193
|
-
i0.ɵɵadvance(2);
|
|
194
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r23.getIcon(item_r24), " ");
|
|
195
|
-
i0.ɵɵadvance(2);
|
|
196
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r23.getTitle(item_r24), " ");
|
|
197
|
-
i0.ɵɵadvance(2);
|
|
198
|
-
i0.ɵɵtextInterpolate(item_r24.description);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
function TdMarkdownNavigatorComponent_ng_container_0_div_6_Template(rf, ctx) {
|
|
202
|
-
if (rf & 1) {
|
|
203
|
-
i0.ɵɵelementStart(0, "div", 22);
|
|
204
|
-
i0.ɵɵelementStart(1, "mat-action-list");
|
|
205
|
-
i0.ɵɵtemplate(2, TdMarkdownNavigatorComponent_ng_container_0_div_6_button_2_Template, 8, 5, "button", 23);
|
|
206
|
-
i0.ɵɵelementEnd();
|
|
207
|
-
i0.ɵɵelementEnd();
|
|
208
|
-
}
|
|
209
|
-
if (rf & 2) {
|
|
210
|
-
const ctx_r6 = i0.ɵɵnextContext(2);
|
|
211
|
-
i0.ɵɵadvance(2);
|
|
212
|
-
i0.ɵɵproperty("ngForOf", ctx_r6.currentMenuItems);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
function TdMarkdownNavigatorComponent_ng_container_0_ng_container_7_Template(rf, ctx) {
|
|
216
|
-
if (rf & 1) {
|
|
217
|
-
i0.ɵɵelementContainer(0);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
function TdMarkdownNavigatorComponent_ng_container_0_Template(rf, ctx) {
|
|
221
|
-
if (rf & 1) {
|
|
222
|
-
i0.ɵɵelementContainerStart(0);
|
|
223
|
-
i0.ɵɵtemplate(1, TdMarkdownNavigatorComponent_ng_container_0_mat_progress_bar_1_Template, 1, 0, "mat-progress-bar", 2);
|
|
224
|
-
i0.ɵɵtemplate(2, TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_Template, 6, 7, "ng-container", 0);
|
|
225
|
-
i0.ɵɵelementStart(3, "div", 3);
|
|
226
|
-
i0.ɵɵtemplate(4, TdMarkdownNavigatorComponent_ng_container_0_div_4_Template, 5, 3, "div", 4);
|
|
227
|
-
i0.ɵɵtemplate(5, TdMarkdownNavigatorComponent_ng_container_0_td_message_5_Template, 1, 2, "td-message", 5);
|
|
228
|
-
i0.ɵɵtemplate(6, TdMarkdownNavigatorComponent_ng_container_0_div_6_Template, 3, 1, "div", 6);
|
|
229
|
-
i0.ɵɵtemplate(7, TdMarkdownNavigatorComponent_ng_container_0_ng_container_7_Template, 1, 0, "ng-container", 7);
|
|
230
|
-
i0.ɵɵelementEnd();
|
|
231
|
-
i0.ɵɵelementContainerEnd();
|
|
232
|
-
}
|
|
233
|
-
if (rf & 2) {
|
|
234
|
-
const ctx_r0 = i0.ɵɵnextContext();
|
|
235
|
-
i0.ɵɵadvance(1);
|
|
236
|
-
i0.ɵɵproperty("ngIf", ctx_r0.loading);
|
|
237
|
-
i0.ɵɵadvance(1);
|
|
238
|
-
i0.ɵɵproperty("ngIf", ctx_r0.showHeader);
|
|
239
|
-
i0.ɵɵadvance(2);
|
|
240
|
-
i0.ɵɵproperty("ngIf", ctx_r0.showTdMarkdownLoader || ctx_r0.showTdMarkdown);
|
|
241
|
-
i0.ɵɵadvance(1);
|
|
242
|
-
i0.ɵɵproperty("ngIf", ctx_r0.childrenUrlError);
|
|
243
|
-
i0.ɵɵadvance(1);
|
|
244
|
-
i0.ɵɵproperty("ngIf", ctx_r0.showMenu);
|
|
245
|
-
i0.ɵɵadvance(1);
|
|
246
|
-
i0.ɵɵproperty("ngComponentOutlet", ctx_r0.footerComponent);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
function TdMarkdownNavigatorComponent_div_1_Template(rf, ctx) {
|
|
250
|
-
if (rf & 1) {
|
|
251
|
-
i0.ɵɵelementStart(0, "div", 27);
|
|
252
|
-
i0.ɵɵelementStart(1, "mat-icon", 28);
|
|
253
|
-
i0.ɵɵtext(2, "subject");
|
|
254
|
-
i0.ɵɵelementEnd();
|
|
255
|
-
i0.ɵɵelementStart(3, "h2");
|
|
256
|
-
i0.ɵɵtext(4);
|
|
257
|
-
i0.ɵɵelementEnd();
|
|
258
|
-
i0.ɵɵelementEnd();
|
|
259
|
-
}
|
|
260
|
-
if (rf & 2) {
|
|
261
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
262
|
-
i0.ɵɵadvance(4);
|
|
263
|
-
i0.ɵɵtextInterpolate(ctx_r1.emptyStateLabel);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
31
|
const DEFAULT_MARKDOWN_NAVIGATOR_LABELS = {
|
|
267
32
|
goHome: 'Go home',
|
|
268
33
|
goBack: 'Go back',
|
|
269
34
|
emptyState: 'No item(s) to display',
|
|
270
35
|
};
|
|
271
|
-
function getTitleFromUrl(url) {
|
|
272
|
-
if (url) {
|
|
273
|
-
const temp = new URL(url);
|
|
274
|
-
if (temp.hash) {
|
|
275
|
-
return removeLeadingHash(temp.hash);
|
|
276
|
-
}
|
|
277
|
-
else {
|
|
278
|
-
const path = temp.pathname.split('/');
|
|
279
|
-
const fileName = path[path.length - 1];
|
|
280
|
-
return fileName.replace(/\.[^/.]+$/, ''); // remove .md
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return undefined;
|
|
284
|
-
}
|
|
285
|
-
function getTitleFromMarkdownString(markdownString) {
|
|
286
|
-
if (markdownString) {
|
|
287
|
-
const firstLine = markdownString.split(/[\r\n]+/).find((line) => !!line);
|
|
288
|
-
return removeLeadingHash(firstLine).trim();
|
|
289
|
-
}
|
|
290
|
-
return undefined;
|
|
291
|
-
}
|
|
292
|
-
function isMarkdownHref(anchor) {
|
|
293
|
-
return !isAnchorLink(anchor) && anchor.pathname.endsWith('.md');
|
|
294
|
-
}
|
|
295
|
-
function defaultCompareWith(o1, o2) {
|
|
296
|
-
if (o1.id && o2.id) {
|
|
297
|
-
return o1.id === o2.id;
|
|
298
|
-
}
|
|
299
|
-
return o1 === o2;
|
|
300
|
-
}
|
|
301
36
|
class TdMarkdownNavigatorComponent {
|
|
302
37
|
constructor(_markdownUrlLoaderService, _changeDetectorRef, _sanitizer, _http) {
|
|
303
38
|
this._markdownUrlLoaderService = _markdownUrlLoaderService;
|
|
@@ -324,27 +59,28 @@ class TdMarkdownNavigatorComponent {
|
|
|
324
59
|
}
|
|
325
60
|
clickListener(event) {
|
|
326
61
|
const element = event.srcElement;
|
|
327
|
-
if (element.matches('a[href]') &&
|
|
62
|
+
if (element.matches('a[href]') &&
|
|
63
|
+
isMarkdownHref(element)) {
|
|
328
64
|
this.handleLinkClick(event);
|
|
329
65
|
}
|
|
330
66
|
}
|
|
331
67
|
get showGoBackButton() {
|
|
332
68
|
return this.historyStack.length > 0;
|
|
333
69
|
}
|
|
334
|
-
get showHomeButton() {
|
|
335
|
-
return this.historyStack.length > 1;
|
|
336
|
-
}
|
|
337
70
|
get showHeader() {
|
|
338
|
-
return this.
|
|
71
|
+
return this.showGoBackButton || !!this.currentItemTitle;
|
|
339
72
|
}
|
|
340
73
|
get showMenu() {
|
|
341
|
-
|
|
74
|
+
const showMenu = this.currentMenuItems && this.currentMenuItems.length > 0;
|
|
75
|
+
return showMenu !== null && showMenu !== void 0 ? showMenu : false;
|
|
342
76
|
}
|
|
343
77
|
get showTdMarkdownLoader() {
|
|
344
|
-
return !!this.currentMarkdownItem &&
|
|
78
|
+
return (!!this.currentMarkdownItem &&
|
|
79
|
+
!!this.currentMarkdownItem.url &&
|
|
80
|
+
!this.showTdMarkdown);
|
|
345
81
|
}
|
|
346
82
|
get showTdMarkdown() {
|
|
347
|
-
return !!this.currentMarkdownItem && !!this.currentMarkdownItem.markdownString;
|
|
83
|
+
return (!!this.currentMarkdownItem && !!this.currentMarkdownItem.markdownString);
|
|
348
84
|
}
|
|
349
85
|
get url() {
|
|
350
86
|
if (this.currentMarkdownItem) {
|
|
@@ -362,28 +98,34 @@ class TdMarkdownNavigatorComponent {
|
|
|
362
98
|
if (this.currentMarkdownItem) {
|
|
363
99
|
return this.currentMarkdownItem.httpOptions;
|
|
364
100
|
}
|
|
101
|
+
return undefined;
|
|
365
102
|
}
|
|
366
103
|
get markdownString() {
|
|
367
104
|
if (this.currentMarkdownItem) {
|
|
368
105
|
return this.currentMarkdownItem.markdownString;
|
|
369
106
|
}
|
|
107
|
+
return undefined;
|
|
370
108
|
}
|
|
371
109
|
get anchor() {
|
|
372
110
|
if (this.currentMarkdownItem) {
|
|
373
111
|
return this.currentMarkdownItem.anchor;
|
|
374
112
|
}
|
|
113
|
+
return undefined;
|
|
375
114
|
}
|
|
376
115
|
get showEmptyState() {
|
|
377
116
|
return !this.items || this.items.length < 1;
|
|
378
117
|
}
|
|
379
118
|
get goHomeLabel() {
|
|
380
|
-
return (this.labels && this.labels.goHome) ||
|
|
119
|
+
return ((this.labels && this.labels.goHome) ||
|
|
120
|
+
DEFAULT_MARKDOWN_NAVIGATOR_LABELS.goHome);
|
|
381
121
|
}
|
|
382
122
|
get goBackLabel() {
|
|
383
|
-
return (this.labels && this.labels.goBack) ||
|
|
123
|
+
return ((this.labels && this.labels.goBack) ||
|
|
124
|
+
DEFAULT_MARKDOWN_NAVIGATOR_LABELS.goBack);
|
|
384
125
|
}
|
|
385
126
|
get emptyStateLabel() {
|
|
386
|
-
return (this.labels && this.labels.emptyState) ||
|
|
127
|
+
return ((this.labels && this.labels.emptyState) ||
|
|
128
|
+
DEFAULT_MARKDOWN_NAVIGATOR_LABELS.emptyState);
|
|
387
129
|
}
|
|
388
130
|
get currentItemTitle() {
|
|
389
131
|
if (this.historyStack.length < 1) {
|
|
@@ -399,10 +141,10 @@ class TdMarkdownNavigatorComponent {
|
|
|
399
141
|
}
|
|
400
142
|
ngOnChanges(changes) {
|
|
401
143
|
return __awaiter(this, void 0, void 0, function* () {
|
|
402
|
-
if (changes
|
|
144
|
+
if (changes['items']) {
|
|
403
145
|
this.reset();
|
|
404
146
|
}
|
|
405
|
-
if (changes
|
|
147
|
+
if (changes['startAt'] && this.items && this.startAt) {
|
|
406
148
|
this._jumpTo(this.startAt, undefined);
|
|
407
149
|
}
|
|
408
150
|
});
|
|
@@ -418,7 +160,9 @@ class TdMarkdownNavigatorComponent {
|
|
|
418
160
|
this.loading = false;
|
|
419
161
|
this.clearErrors();
|
|
420
162
|
// if single item and no children
|
|
421
|
-
if (this.items &&
|
|
163
|
+
if (this.items &&
|
|
164
|
+
this.items.length === 1 &&
|
|
165
|
+
!this.hasChildrenOrChildrenUrl(this.items[0])) {
|
|
422
166
|
this.currentMenuItems = [];
|
|
423
167
|
this.currentMarkdownItem = this.items[0];
|
|
424
168
|
}
|
|
@@ -429,20 +173,20 @@ class TdMarkdownNavigatorComponent {
|
|
|
429
173
|
this.historyStack = [];
|
|
430
174
|
this._changeDetectorRef.markForCheck();
|
|
431
175
|
}
|
|
432
|
-
goBack() {
|
|
176
|
+
goBack(goBackLength = 1) {
|
|
433
177
|
this.loading = false;
|
|
434
178
|
this.clearErrors();
|
|
435
179
|
if (this.historyStack.length > 1) {
|
|
436
180
|
let parent = this.historyStack[this.historyStack.length - 2];
|
|
437
|
-
if (parent.startAtLink) {
|
|
181
|
+
if (parent === null || parent === void 0 ? void 0 : parent.startAtLink) {
|
|
438
182
|
parent = this.historyStack[this.historyStack.length - 3]
|
|
439
183
|
? this.historyStack[this.historyStack.length - 3]
|
|
440
184
|
: undefined;
|
|
441
|
-
this.historyStack = this.historyStack.slice(0, -
|
|
185
|
+
this.historyStack = this.historyStack.slice(0, -goBackLength);
|
|
442
186
|
}
|
|
443
187
|
if (parent) {
|
|
444
188
|
this.currentMarkdownItem = parent;
|
|
445
|
-
this.historyStack = this.historyStack.slice(0, -
|
|
189
|
+
this.historyStack = this.historyStack.slice(0, -goBackLength);
|
|
446
190
|
this.setChildrenAsCurrentMenuItems(parent);
|
|
447
191
|
}
|
|
448
192
|
else {
|
|
@@ -488,10 +232,11 @@ class TdMarkdownNavigatorComponent {
|
|
|
488
232
|
});
|
|
489
233
|
}
|
|
490
234
|
loadChildrenUrl(item) {
|
|
235
|
+
var _a, _b;
|
|
491
236
|
return __awaiter(this, void 0, void 0, function* () {
|
|
492
|
-
const sanitizedUrl = this._sanitizer.sanitize(SecurityContext.URL, item.childrenUrl);
|
|
237
|
+
const sanitizedUrl = (_b = this._sanitizer.sanitize(SecurityContext.URL, (_a = item.childrenUrl) !== null && _a !== void 0 ? _a : null)) !== null && _b !== void 0 ? _b : '';
|
|
493
238
|
try {
|
|
494
|
-
return yield this._http.get(sanitizedUrl, Object.assign({}, item.httpOptions))
|
|
239
|
+
return yield firstValueFrom(this._http.get(sanitizedUrl, Object.assign({}, item.httpOptions)));
|
|
495
240
|
}
|
|
496
241
|
catch (error) {
|
|
497
242
|
this.handleChildrenUrlError(error);
|
|
@@ -500,25 +245,25 @@ class TdMarkdownNavigatorComponent {
|
|
|
500
245
|
});
|
|
501
246
|
}
|
|
502
247
|
getTitle(item) {
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
getTitleFromUrl(item.url) ||
|
|
507
|
-
getTitleFromMarkdownString(item.markdownString) ||
|
|
508
|
-
'').trim();
|
|
248
|
+
var _a, _b, _c;
|
|
249
|
+
if (!item) {
|
|
250
|
+
return '';
|
|
509
251
|
}
|
|
252
|
+
return (removeLeadingHash((_a = item.anchor) !== null && _a !== void 0 ? _a : '') ||
|
|
253
|
+
item.title ||
|
|
254
|
+
getTitleFromUrl((_b = item.url) !== null && _b !== void 0 ? _b : '') ||
|
|
255
|
+
getTitleFromMarkdownString((_c = item.markdownString) !== null && _c !== void 0 ? _c : '') ||
|
|
256
|
+
'').trim();
|
|
510
257
|
}
|
|
511
258
|
getIcon(item) {
|
|
512
|
-
|
|
513
|
-
return item.icon || 'subject';
|
|
514
|
-
}
|
|
259
|
+
return (item === null || item === void 0 ? void 0 : item.icon) || 'subject';
|
|
515
260
|
}
|
|
516
261
|
handleChildrenUrlError(error) {
|
|
517
262
|
this.childrenUrlError = error.message;
|
|
518
263
|
this._changeDetectorRef.markForCheck();
|
|
519
264
|
}
|
|
520
265
|
handleMarkdownLoaderError(error) {
|
|
521
|
-
this.markdownLoaderError = error.message;
|
|
266
|
+
this.markdownLoaderError = error ? error.message : '';
|
|
522
267
|
this._changeDetectorRef.markForCheck();
|
|
523
268
|
}
|
|
524
269
|
_jumpTo(itemOrPath, children) {
|
|
@@ -572,7 +317,7 @@ class TdMarkdownNavigatorComponent {
|
|
|
572
317
|
const compareWith = this.compareWith || defaultCompareWith;
|
|
573
318
|
if (items) {
|
|
574
319
|
for (const child of items) {
|
|
575
|
-
if (compareWith(child, item)) {
|
|
320
|
+
if (item && compareWith(child, item)) {
|
|
576
321
|
return [child];
|
|
577
322
|
}
|
|
578
323
|
const ancestors = this.findPath(child.children, item);
|
|
@@ -598,7 +343,7 @@ class TdMarkdownNavigatorComponent {
|
|
|
598
343
|
}
|
|
599
344
|
catch (error) {
|
|
600
345
|
const win = window.open(url.href, '_blank');
|
|
601
|
-
win.focus();
|
|
346
|
+
win === null || win === void 0 ? void 0 : win.focus();
|
|
602
347
|
}
|
|
603
348
|
finally {
|
|
604
349
|
this.loading = false;
|
|
@@ -607,35 +352,12 @@ class TdMarkdownNavigatorComponent {
|
|
|
607
352
|
});
|
|
608
353
|
}
|
|
609
354
|
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
i0.ɵɵviewQuery(_c0, 5);
|
|
614
|
-
}
|
|
615
|
-
if (rf & 2) {
|
|
616
|
-
let _t;
|
|
617
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.markdownWrapper = _t.first);
|
|
618
|
-
}
|
|
619
|
-
}, hostBindings: function TdMarkdownNavigatorComponent_HostBindings(rf, ctx) {
|
|
620
|
-
if (rf & 1) {
|
|
621
|
-
i0.ɵɵlistener("click", function TdMarkdownNavigatorComponent_click_HostBindingHandler($event) { return ctx.clickListener($event); });
|
|
622
|
-
}
|
|
623
|
-
}, 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) {
|
|
624
|
-
if (rf & 1) {
|
|
625
|
-
i0.ɵɵtemplate(0, TdMarkdownNavigatorComponent_ng_container_0_Template, 8, 6, "ng-container", 0);
|
|
626
|
-
i0.ɵɵtemplate(1, TdMarkdownNavigatorComponent_div_1_Template, 5, 1, "div", 1);
|
|
627
|
-
}
|
|
628
|
-
if (rf & 2) {
|
|
629
|
-
i0.ɵɵproperty("ngIf", !ctx.showEmptyState);
|
|
630
|
-
i0.ɵɵadvance(1);
|
|
631
|
-
i0.ɵɵproperty("ngIf", ctx.showEmptyState);
|
|
632
|
-
}
|
|
633
|
-
}, 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 });
|
|
634
|
-
(function () {
|
|
635
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownNavigatorComponent, [{
|
|
355
|
+
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 });
|
|
356
|
+
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 });
|
|
357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorComponent, decorators: [{
|
|
636
358
|
type: Component,
|
|
637
|
-
args: [{ selector: 'td-markdown-navigator', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"!showEmptyState\">\n <mat-progress-bar
|
|
638
|
-
}], function () { return [{ type: i1.TdMarkdownLoaderService }, { type: i0.ChangeDetectorRef }, { type: i2.DomSanitizer }, { type: i3.HttpClient }]; }, { items: [{
|
|
359
|
+
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"] }]
|
|
360
|
+
}], ctorParameters: function () { return [{ type: i1.TdMarkdownLoaderService }, { type: i0.ChangeDetectorRef }, { type: i2.DomSanitizer }, { type: i3.HttpClient }]; }, propDecorators: { items: [{
|
|
639
361
|
type: Input
|
|
640
362
|
}], labels: [{
|
|
641
363
|
type: Input
|
|
@@ -657,8 +379,38 @@ class TdMarkdownNavigatorComponent {
|
|
|
657
379
|
}], clickListener: [{
|
|
658
380
|
type: HostListener,
|
|
659
381
|
args: ['click', ['$event']]
|
|
660
|
-
}] });
|
|
661
|
-
|
|
382
|
+
}] } });
|
|
383
|
+
function getTitleFromUrl(url) {
|
|
384
|
+
if (url) {
|
|
385
|
+
const temp = new URL(url);
|
|
386
|
+
if (temp.hash) {
|
|
387
|
+
return removeLeadingHash(temp.hash);
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
const path = temp.pathname.split('/');
|
|
391
|
+
const fileName = path[path.length - 1];
|
|
392
|
+
return fileName.replace(/\.[^/.]+$/, ''); // remove .md
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
return '';
|
|
396
|
+
}
|
|
397
|
+
function getTitleFromMarkdownString(markdownString) {
|
|
398
|
+
var _a;
|
|
399
|
+
if (markdownString) {
|
|
400
|
+
const firstLine = (_a = markdownString.split(/[\r\n]+/).find((line) => !!line)) !== null && _a !== void 0 ? _a : '';
|
|
401
|
+
return removeLeadingHash(firstLine).trim();
|
|
402
|
+
}
|
|
403
|
+
return '';
|
|
404
|
+
}
|
|
405
|
+
function isMarkdownHref(anchor) {
|
|
406
|
+
return !isAnchorLink(anchor) && anchor.pathname.endsWith('.md');
|
|
407
|
+
}
|
|
408
|
+
function defaultCompareWith(o1, o2) {
|
|
409
|
+
if (o1.id && o2.id) {
|
|
410
|
+
return o1.id === o2.id;
|
|
411
|
+
}
|
|
412
|
+
return o1 === o2;
|
|
413
|
+
}
|
|
662
414
|
|
|
663
415
|
const DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS = {
|
|
664
416
|
title: 'Help',
|
|
@@ -677,55 +429,44 @@ class TdMarkdownNavigatorWindowComponent {
|
|
|
677
429
|
this.buttonClicked = new EventEmitter();
|
|
678
430
|
}
|
|
679
431
|
get markdownNavigatorLabels() {
|
|
680
|
-
if (this.labels) {
|
|
681
|
-
|
|
682
|
-
return {
|
|
683
|
-
goHome,
|
|
684
|
-
goBack,
|
|
685
|
-
emptyState,
|
|
686
|
-
};
|
|
432
|
+
if (!this.labels) {
|
|
433
|
+
return undefined;
|
|
687
434
|
}
|
|
435
|
+
const { goHome, goBack, emptyState } = this.labels;
|
|
436
|
+
return {
|
|
437
|
+
goHome,
|
|
438
|
+
goBack,
|
|
439
|
+
emptyState,
|
|
440
|
+
};
|
|
688
441
|
}
|
|
689
442
|
get titleLabel() {
|
|
690
|
-
return (this.labels && this.labels.title) ||
|
|
443
|
+
return ((this.labels && this.labels.title) ||
|
|
444
|
+
DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.title);
|
|
691
445
|
}
|
|
692
446
|
get closeLabel() {
|
|
693
|
-
return (this.labels && this.labels.close) ||
|
|
447
|
+
return ((this.labels && this.labels.close) ||
|
|
448
|
+
DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.close);
|
|
694
449
|
}
|
|
695
450
|
get toggleDockedStateLabel() {
|
|
696
451
|
if (this.docked) {
|
|
697
|
-
return (this.labels && this.labels.unDock) ||
|
|
452
|
+
return ((this.labels && this.labels.unDock) ||
|
|
453
|
+
DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.unDock);
|
|
698
454
|
}
|
|
699
455
|
else {
|
|
700
|
-
return (this.labels && this.labels.dock) ||
|
|
456
|
+
return ((this.labels && this.labels.dock) ||
|
|
457
|
+
DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.dock);
|
|
701
458
|
}
|
|
702
459
|
}
|
|
703
460
|
toggleDockedState() {
|
|
704
461
|
this.dockToggled.emit(this.docked);
|
|
705
462
|
}
|
|
706
463
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
i0.ɵɵelementStart(0, "td-window-dialog", 0);
|
|
711
|
-
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(); });
|
|
712
|
-
i0.ɵɵelementStart(1, "td-markdown-navigator", 1);
|
|
713
|
-
i0.ɵɵlistener("buttonClicked", function TdMarkdownNavigatorWindowComponent_Template_td_markdown_navigator_buttonClicked_1_listener($event) { return ctx.buttonClicked.emit($event); });
|
|
714
|
-
i0.ɵɵelementEnd();
|
|
715
|
-
i0.ɵɵelementEnd();
|
|
716
|
-
}
|
|
717
|
-
if (rf & 2) {
|
|
718
|
-
i0.ɵɵproperty("toolbarColor", ctx.toolbarColor)("docked", ctx.docked)("title", ctx.titleLabel)("toggleDockedStateLabel", ctx.toggleDockedStateLabel)("closeLabel", ctx.closeLabel);
|
|
719
|
-
i0.ɵɵadvance(1);
|
|
720
|
-
i0.ɵɵstyleProp("display", ctx.docked ? "none" : "inherit");
|
|
721
|
-
i0.ɵɵproperty("items", ctx.items)("labels", ctx.markdownNavigatorLabels)("startAt", ctx.startAt)("compareWith", ctx.compareWith)("footer", ctx.footer)("copyCodeToClipboard", ctx.copyCodeToClipboard)("copyCodeTooltips", ctx.copyCodeTooltips);
|
|
722
|
-
}
|
|
723
|
-
}, 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 });
|
|
724
|
-
(function () {
|
|
725
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownNavigatorWindowComponent, [{
|
|
464
|
+
TdMarkdownNavigatorWindowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
465
|
+
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 });
|
|
466
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowComponent, decorators: [{
|
|
726
467
|
type: Component,
|
|
727
|
-
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
|
|
728
|
-
}],
|
|
468
|
+
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"] }]
|
|
469
|
+
}], propDecorators: { items: [{
|
|
729
470
|
type: Input
|
|
730
471
|
}], labels: [{
|
|
731
472
|
type: Input
|
|
@@ -749,8 +490,7 @@ class TdMarkdownNavigatorWindowComponent {
|
|
|
749
490
|
type: Output
|
|
750
491
|
}], buttonClicked: [{
|
|
751
492
|
type: Output
|
|
752
|
-
}] });
|
|
753
|
-
})();
|
|
493
|
+
}] } });
|
|
754
494
|
|
|
755
495
|
const CDK_OVERLAY_CUSTOM_CLASS = 'td-window-dialog';
|
|
756
496
|
const DEFAULT_POSITION = { bottom: '0px', right: '0px' };
|
|
@@ -772,23 +512,16 @@ class TdMarkdownNavigatorWindowService {
|
|
|
772
512
|
this._tdDialogService = _tdDialogService;
|
|
773
513
|
this._document = _document;
|
|
774
514
|
this.rendererFactory = rendererFactory;
|
|
775
|
-
this.markdownNavigatorWindowDialog = undefined;
|
|
776
515
|
this.markdownNavigatorWindowDialogsOpen = 0;
|
|
777
|
-
this._renderer2 = rendererFactory.createRenderer(undefined,
|
|
516
|
+
this._renderer2 = rendererFactory.createRenderer(undefined, null);
|
|
778
517
|
}
|
|
779
518
|
open(config) {
|
|
519
|
+
var _a;
|
|
780
520
|
this.close();
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
}
|
|
786
|
-
else {
|
|
787
|
-
panelClass = [config.dialogConfig.panelClass];
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
const draggableConfig = Object.assign(Object.assign(Object.assign({}, DEFAULT_DRAGGABLE_DIALOG_CONFIG), config.dialogConfig), { panelClass });
|
|
791
|
-
const { matDialogRef, dragRefSubject } = this._tdDialogService.openDraggable({
|
|
521
|
+
const configClass = (_a = config === null || config === void 0 ? void 0 : config.dialogConfig) === null || _a === void 0 ? void 0 : _a.panelClass;
|
|
522
|
+
const panelClass = configClass && !Array.isArray(configClass) ? [configClass] : [];
|
|
523
|
+
const draggableConfig = Object.assign(Object.assign(Object.assign({}, DEFAULT_DRAGGABLE_DIALOG_CONFIG), config.dialogConfig), panelClass);
|
|
524
|
+
const { matDialogRef, dragRefSubject, } = this._tdDialogService.openDraggable({
|
|
792
525
|
component: TdMarkdownNavigatorWindowComponent,
|
|
793
526
|
config: draggableConfig,
|
|
794
527
|
dragHandleSelectors: ['.td-window-dialog-toolbar'],
|
|
@@ -797,10 +530,14 @@ class TdMarkdownNavigatorWindowService {
|
|
|
797
530
|
this.markdownNavigatorWindowDialog = matDialogRef;
|
|
798
531
|
this.markdownNavigatorWindowDialog.componentInstance.items = config.items;
|
|
799
532
|
this.markdownNavigatorWindowDialog.componentInstance.labels = config.labels;
|
|
800
|
-
this.markdownNavigatorWindowDialog.componentInstance.startAt =
|
|
801
|
-
|
|
802
|
-
this.markdownNavigatorWindowDialog.componentInstance.
|
|
803
|
-
|
|
533
|
+
this.markdownNavigatorWindowDialog.componentInstance.startAt =
|
|
534
|
+
config.startAt;
|
|
535
|
+
this.markdownNavigatorWindowDialog.componentInstance.copyCodeToClipboard =
|
|
536
|
+
config.copyCodeToClipboard;
|
|
537
|
+
this.markdownNavigatorWindowDialog.componentInstance.copyCodeTooltips =
|
|
538
|
+
config.copyCodeTooltips;
|
|
539
|
+
this.markdownNavigatorWindowDialog.componentInstance.compareWith =
|
|
540
|
+
config.compareWith;
|
|
804
541
|
this.markdownNavigatorWindowDialog.componentInstance.toolbarColor =
|
|
805
542
|
'toolbarColor' in config ? config.toolbarColor : 'primary';
|
|
806
543
|
this.markdownNavigatorWindowDialogsOpen++;
|
|
@@ -831,7 +568,12 @@ class TdMarkdownNavigatorWindowService {
|
|
|
831
568
|
if (docked) {
|
|
832
569
|
this.markdownNavigatorWindowDialog.componentInstance.docked = false;
|
|
833
570
|
this.markdownNavigatorWindowDialog.updateSize(dimensions.width, dimensions.height);
|
|
834
|
-
this.markdownNavigatorWindowDialog.updatePosition({
|
|
571
|
+
this.markdownNavigatorWindowDialog.updatePosition({
|
|
572
|
+
top: '0px',
|
|
573
|
+
right: '0px',
|
|
574
|
+
bottom: '0px',
|
|
575
|
+
left: '0px',
|
|
576
|
+
});
|
|
835
577
|
this.dragRef.setFreeDragPosition(position);
|
|
836
578
|
this.dragRef.disabled = false;
|
|
837
579
|
this.resizableDraggableDialog.attach();
|
|
@@ -862,18 +604,16 @@ class TdMarkdownNavigatorWindowService {
|
|
|
862
604
|
};
|
|
863
605
|
}
|
|
864
606
|
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
(
|
|
868
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownNavigatorWindowService, [{
|
|
607
|
+
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 });
|
|
608
|
+
TdMarkdownNavigatorWindowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowService });
|
|
609
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowService, decorators: [{
|
|
869
610
|
type: Injectable
|
|
870
|
-
}], function () {
|
|
611
|
+
}], ctorParameters: function () {
|
|
871
612
|
return [{ type: i1$1.TdDialogService }, { type: undefined, decorators: [{
|
|
872
613
|
type: Inject,
|
|
873
614
|
args: [DOCUMENT]
|
|
874
615
|
}] }, { type: i0.RendererFactory2 }];
|
|
875
|
-
}
|
|
876
|
-
})();
|
|
616
|
+
} });
|
|
877
617
|
|
|
878
618
|
class TdMarkdownNavigatorWindowDirective {
|
|
879
619
|
constructor(_markdownNavigatorWindowService) {
|
|
@@ -881,24 +621,19 @@ class TdMarkdownNavigatorWindowDirective {
|
|
|
881
621
|
this.disabled = false;
|
|
882
622
|
}
|
|
883
623
|
click() {
|
|
884
|
-
if (!this.disabled) {
|
|
624
|
+
if (!this.disabled && this.config) {
|
|
885
625
|
this._markdownNavigatorWindowService.open(this.config);
|
|
886
626
|
}
|
|
887
627
|
}
|
|
888
628
|
}
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
i0.ɵɵlistener("click", function TdMarkdownNavigatorWindowDirective_click_HostBindingHandler() { return ctx.click(); });
|
|
893
|
-
}
|
|
894
|
-
}, inputs: { config: ["tdMarkdownNavigatorWindow", "config"], disabled: "disabled" } });
|
|
895
|
-
(function () {
|
|
896
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownNavigatorWindowDirective, [{
|
|
629
|
+
TdMarkdownNavigatorWindowDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowDirective, deps: [{ token: TdMarkdownNavigatorWindowService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
630
|
+
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 });
|
|
631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowDirective, decorators: [{
|
|
897
632
|
type: Directive,
|
|
898
633
|
args: [{
|
|
899
634
|
selector: '[tdMarkdownNavigatorWindow]',
|
|
900
635
|
}]
|
|
901
|
-
}], function () { return [{ type: TdMarkdownNavigatorWindowService }]; }, { config: [{
|
|
636
|
+
}], ctorParameters: function () { return [{ type: TdMarkdownNavigatorWindowService }]; }, propDecorators: { config: [{
|
|
902
637
|
type: Input,
|
|
903
638
|
args: ['tdMarkdownNavigatorWindow']
|
|
904
639
|
}], disabled: [{
|
|
@@ -906,14 +641,27 @@ class TdMarkdownNavigatorWindowDirective {
|
|
|
906
641
|
}], click: [{
|
|
907
642
|
type: HostListener,
|
|
908
643
|
args: ['click']
|
|
909
|
-
}] });
|
|
910
|
-
})();
|
|
644
|
+
}] } });
|
|
911
645
|
|
|
912
646
|
class CovalentMarkdownNavigatorModule {
|
|
913
647
|
}
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
648
|
+
CovalentMarkdownNavigatorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownNavigatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
649
|
+
CovalentMarkdownNavigatorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownNavigatorModule, declarations: [TdMarkdownNavigatorComponent,
|
|
650
|
+
TdMarkdownNavigatorWindowComponent,
|
|
651
|
+
TdMarkdownNavigatorWindowDirective], imports: [CommonModule,
|
|
652
|
+
// material
|
|
653
|
+
MatButtonModule,
|
|
654
|
+
MatTooltipModule,
|
|
655
|
+
MatListModule,
|
|
656
|
+
MatIconModule,
|
|
657
|
+
MatProgressBarModule,
|
|
658
|
+
CovalentBreadcrumbsModule,
|
|
659
|
+
CovalentDialogsModule,
|
|
660
|
+
CovalentFlavoredMarkdownModule,
|
|
661
|
+
CovalentMessageModule], exports: [TdMarkdownNavigatorComponent,
|
|
662
|
+
TdMarkdownNavigatorWindowComponent,
|
|
663
|
+
TdMarkdownNavigatorWindowDirective] });
|
|
664
|
+
CovalentMarkdownNavigatorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownNavigatorModule, providers: [TdMarkdownNavigatorWindowService], imports: [[
|
|
917
665
|
CommonModule,
|
|
918
666
|
// material
|
|
919
667
|
MatButtonModule,
|
|
@@ -921,12 +669,12 @@ class CovalentMarkdownNavigatorModule {
|
|
|
921
669
|
MatListModule,
|
|
922
670
|
MatIconModule,
|
|
923
671
|
MatProgressBarModule,
|
|
924
|
-
|
|
925
|
-
CovalentFlavoredMarkdownModule,
|
|
672
|
+
CovalentBreadcrumbsModule,
|
|
926
673
|
CovalentDialogsModule,
|
|
674
|
+
CovalentFlavoredMarkdownModule,
|
|
675
|
+
CovalentMessageModule,
|
|
927
676
|
]] });
|
|
928
|
-
(
|
|
929
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CovalentMarkdownNavigatorModule, [{
|
|
677
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownNavigatorModule, decorators: [{
|
|
930
678
|
type: NgModule,
|
|
931
679
|
args: [{
|
|
932
680
|
imports: [
|
|
@@ -937,28 +685,24 @@ class CovalentMarkdownNavigatorModule {
|
|
|
937
685
|
MatListModule,
|
|
938
686
|
MatIconModule,
|
|
939
687
|
MatProgressBarModule,
|
|
940
|
-
|
|
941
|
-
CovalentFlavoredMarkdownModule,
|
|
688
|
+
CovalentBreadcrumbsModule,
|
|
942
689
|
CovalentDialogsModule,
|
|
690
|
+
CovalentFlavoredMarkdownModule,
|
|
691
|
+
CovalentMessageModule,
|
|
692
|
+
],
|
|
693
|
+
declarations: [
|
|
694
|
+
TdMarkdownNavigatorComponent,
|
|
695
|
+
TdMarkdownNavigatorWindowComponent,
|
|
696
|
+
TdMarkdownNavigatorWindowDirective,
|
|
697
|
+
],
|
|
698
|
+
exports: [
|
|
699
|
+
TdMarkdownNavigatorComponent,
|
|
700
|
+
TdMarkdownNavigatorWindowComponent,
|
|
701
|
+
TdMarkdownNavigatorWindowDirective,
|
|
943
702
|
],
|
|
944
|
-
declarations: [TdMarkdownNavigatorComponent, TdMarkdownNavigatorWindowComponent, TdMarkdownNavigatorWindowDirective],
|
|
945
|
-
exports: [TdMarkdownNavigatorComponent, TdMarkdownNavigatorWindowComponent, TdMarkdownNavigatorWindowDirective],
|
|
946
703
|
providers: [TdMarkdownNavigatorWindowService],
|
|
947
704
|
}]
|
|
948
|
-
}]
|
|
949
|
-
})();
|
|
950
|
-
(function () {
|
|
951
|
-
(typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CovalentMarkdownNavigatorModule, { declarations: [TdMarkdownNavigatorComponent, TdMarkdownNavigatorWindowComponent, TdMarkdownNavigatorWindowDirective], imports: [CommonModule,
|
|
952
|
-
// material
|
|
953
|
-
MatButtonModule,
|
|
954
|
-
MatTooltipModule,
|
|
955
|
-
MatListModule,
|
|
956
|
-
MatIconModule,
|
|
957
|
-
MatProgressBarModule,
|
|
958
|
-
CovalentMessageModule,
|
|
959
|
-
CovalentFlavoredMarkdownModule,
|
|
960
|
-
CovalentDialogsModule], exports: [TdMarkdownNavigatorComponent, TdMarkdownNavigatorWindowComponent, TdMarkdownNavigatorWindowDirective] });
|
|
961
|
-
})();
|
|
705
|
+
}] });
|
|
962
706
|
|
|
963
707
|
/**
|
|
964
708
|
* Generated bundle index. Do not edit.
|