@covalent/markdown-navigator 4.0.0-alpha.0 → 4.0.0-beta.4
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/covalent-markdown-navigator.d.ts +1 -1
- package/esm2020/covalent-markdown-navigator.mjs +5 -0
- package/esm2020/index.mjs +2 -0
- package/esm2020/markdown-navigator-window/markdown-navigator-window.component.mjs +91 -0
- package/esm2020/markdown-navigator-window-directive/markdown-navigator-window.directive.mjs +34 -0
- package/esm2020/markdown-navigator-window-service/markdown-navigator-window.service.mjs +129 -0
- package/esm2020/markdown-navigator.component.mjs +587 -0
- package/esm2020/markdown-navigator.module.mjs +62 -0
- package/esm2020/public-api.mjs +6 -0
- package/fesm2015/covalent-markdown-navigator.mjs +968 -0
- package/fesm2015/covalent-markdown-navigator.mjs.map +1 -0
- package/fesm2020/covalent-markdown-navigator.mjs +889 -0
- package/fesm2020/covalent-markdown-navigator.mjs.map +1 -0
- package/markdown-navigator-window/markdown-navigator-window.component.d.ts +3 -0
- package/markdown-navigator-window/markdown-navigator-window.component.scss +1 -0
- package/markdown-navigator-window-directive/markdown-navigator-window.directive.d.ts +3 -0
- package/markdown-navigator-window-service/markdown-navigator-window.service.d.ts +3 -0
- package/markdown-navigator.component.d.ts +3 -0
- package/markdown-navigator.component.scss +5 -0
- package/markdown-navigator.module.d.ts +16 -0
- package/package.json +30 -15
- package/public-api.d.ts +1 -0
- package/bundles/covalent-markdown-navigator.umd.js +0 -1650
- package/bundles/covalent-markdown-navigator.umd.js.map +0 -1
- package/bundles/covalent-markdown-navigator.umd.min.js +0 -16
- package/bundles/covalent-markdown-navigator.umd.min.js.map +0 -1
- package/covalent-markdown-navigator.metadata.json +0 -1
- package/esm2015/covalent-markdown-navigator.js +0 -11
- package/esm2015/index.js +0 -7
- package/esm2015/markdown-navigator-window/markdown-navigator-window.component.js +0 -129
- package/esm2015/markdown-navigator-window-directive/markdown-navigator-window.directive.js +0 -50
- package/esm2015/markdown-navigator-window-service/markdown-navigator-window.service.js +0 -254
- package/esm2015/markdown-navigator.component.js +0 -698
- package/esm2015/markdown-navigator.module.js +0 -41
- package/esm2015/public-api.js +0 -10
- package/fesm2015/covalent-markdown-navigator.js +0 -1181
- package/fesm2015/covalent-markdown-navigator.js.map +0 -1
|
@@ -0,0 +1,968 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, SecurityContext, Component, ChangeDetectionStrategy, Input, Output, ViewChild, HostListener, Injectable, Inject, Directive, NgModule } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/common';
|
|
4
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
5
|
+
import { __awaiter } from 'tslib';
|
|
6
|
+
import * as i1 from '@covalent/markdown';
|
|
7
|
+
import { removeLeadingHash, isAnchorLink } from '@covalent/markdown';
|
|
8
|
+
import * as i2 from '@angular/platform-browser';
|
|
9
|
+
import * as i3 from '@angular/common/http';
|
|
10
|
+
import * as i5 from '@angular/material/progress-bar';
|
|
11
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
12
|
+
import * as i6 from '@angular/material/button';
|
|
13
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
14
|
+
import * as i7 from '@angular/material/tooltip';
|
|
15
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
16
|
+
import * as i8 from '@angular/material/icon';
|
|
17
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
18
|
+
import * as i9 from '@angular/material/divider';
|
|
19
|
+
import * as i10 from '@covalent/core/message';
|
|
20
|
+
import { CovalentMessageModule } from '@covalent/core/message';
|
|
21
|
+
import * as i11 from '@covalent/flavored-markdown';
|
|
22
|
+
import { CovalentFlavoredMarkdownModule } from '@covalent/flavored-markdown';
|
|
23
|
+
import * as i12 from '@angular/material/list';
|
|
24
|
+
import { MatListModule } from '@angular/material/list';
|
|
25
|
+
import * as i13 from '@angular/material/core';
|
|
26
|
+
import * as i1$1 from '@covalent/core/dialogs';
|
|
27
|
+
import { ResizableDraggableDialog, CovalentDialogsModule } from '@covalent/core/dialogs';
|
|
28
|
+
|
|
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
|
+
const DEFAULT_MARKDOWN_NAVIGATOR_LABELS = {
|
|
267
|
+
goHome: 'Go home',
|
|
268
|
+
goBack: 'Go back',
|
|
269
|
+
emptyState: 'No item(s) to display',
|
|
270
|
+
};
|
|
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
|
+
class TdMarkdownNavigatorComponent {
|
|
302
|
+
constructor(_markdownUrlLoaderService, _changeDetectorRef, _sanitizer, _http) {
|
|
303
|
+
this._markdownUrlLoaderService = _markdownUrlLoaderService;
|
|
304
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
305
|
+
this._sanitizer = _sanitizer;
|
|
306
|
+
this._http = _http;
|
|
307
|
+
/**
|
|
308
|
+
* copyCodeToClipboard?: boolean
|
|
309
|
+
*
|
|
310
|
+
* Display copy button on code snippets to copy code to clipboard.
|
|
311
|
+
*
|
|
312
|
+
*/
|
|
313
|
+
this.copyCodeToClipboard = false;
|
|
314
|
+
/**
|
|
315
|
+
* copyCodeTooltips?: ICopyCodeTooltips
|
|
316
|
+
*
|
|
317
|
+
* Tooltips for copy button to copy and upon copying.
|
|
318
|
+
*/
|
|
319
|
+
this.copyCodeTooltips = {};
|
|
320
|
+
this.buttonClicked = new EventEmitter();
|
|
321
|
+
this.historyStack = []; // history
|
|
322
|
+
this.currentMenuItems = []; // current menu items
|
|
323
|
+
this.loading = false;
|
|
324
|
+
}
|
|
325
|
+
clickListener(event) {
|
|
326
|
+
const element = event.srcElement;
|
|
327
|
+
if (element.matches('a[href]') && isMarkdownHref(element)) {
|
|
328
|
+
this.handleLinkClick(event);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
get showGoBackButton() {
|
|
332
|
+
return this.historyStack.length > 0;
|
|
333
|
+
}
|
|
334
|
+
get showHomeButton() {
|
|
335
|
+
return this.historyStack.length > 1;
|
|
336
|
+
}
|
|
337
|
+
get showHeader() {
|
|
338
|
+
return this.showHomeButton || this.showGoBackButton || !!this.currentItemTitle;
|
|
339
|
+
}
|
|
340
|
+
get showMenu() {
|
|
341
|
+
return this.currentMenuItems && this.currentMenuItems.length > 0;
|
|
342
|
+
}
|
|
343
|
+
get showTdMarkdownLoader() {
|
|
344
|
+
return !!this.currentMarkdownItem && !!this.currentMarkdownItem.url && !this.showTdMarkdown;
|
|
345
|
+
}
|
|
346
|
+
get showTdMarkdown() {
|
|
347
|
+
return !!this.currentMarkdownItem && !!this.currentMarkdownItem.markdownString;
|
|
348
|
+
}
|
|
349
|
+
get url() {
|
|
350
|
+
if (this.currentMarkdownItem) {
|
|
351
|
+
return this.currentMarkdownItem.url;
|
|
352
|
+
}
|
|
353
|
+
return undefined;
|
|
354
|
+
}
|
|
355
|
+
get footerComponent() {
|
|
356
|
+
if (this.currentMarkdownItem && this.currentMarkdownItem.footer) {
|
|
357
|
+
return this.currentMarkdownItem.footer;
|
|
358
|
+
}
|
|
359
|
+
return this.footer;
|
|
360
|
+
}
|
|
361
|
+
get httpOptions() {
|
|
362
|
+
if (this.currentMarkdownItem) {
|
|
363
|
+
return this.currentMarkdownItem.httpOptions;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
get markdownString() {
|
|
367
|
+
if (this.currentMarkdownItem) {
|
|
368
|
+
return this.currentMarkdownItem.markdownString;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
get anchor() {
|
|
372
|
+
if (this.currentMarkdownItem) {
|
|
373
|
+
return this.currentMarkdownItem.anchor;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
get showEmptyState() {
|
|
377
|
+
return !this.items || this.items.length < 1;
|
|
378
|
+
}
|
|
379
|
+
get goHomeLabel() {
|
|
380
|
+
return (this.labels && this.labels.goHome) || DEFAULT_MARKDOWN_NAVIGATOR_LABELS.goHome;
|
|
381
|
+
}
|
|
382
|
+
get goBackLabel() {
|
|
383
|
+
return (this.labels && this.labels.goBack) || DEFAULT_MARKDOWN_NAVIGATOR_LABELS.goBack;
|
|
384
|
+
}
|
|
385
|
+
get emptyStateLabel() {
|
|
386
|
+
return (this.labels && this.labels.emptyState) || DEFAULT_MARKDOWN_NAVIGATOR_LABELS.emptyState;
|
|
387
|
+
}
|
|
388
|
+
get currentItemTitle() {
|
|
389
|
+
if (this.historyStack.length < 1) {
|
|
390
|
+
return '';
|
|
391
|
+
}
|
|
392
|
+
else if (this.currentMarkdownItem) {
|
|
393
|
+
return this.getTitle(this.currentMarkdownItem);
|
|
394
|
+
}
|
|
395
|
+
else if (this.historyStack.length > 0) {
|
|
396
|
+
return this.getTitle(this.historyStack[this.historyStack.length - 1]);
|
|
397
|
+
}
|
|
398
|
+
return '';
|
|
399
|
+
}
|
|
400
|
+
ngOnChanges(changes) {
|
|
401
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
402
|
+
if (changes.items) {
|
|
403
|
+
this.reset();
|
|
404
|
+
}
|
|
405
|
+
if (changes.startAt && this.items && this.startAt) {
|
|
406
|
+
this._jumpTo(this.startAt, undefined);
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
hasChildrenOrChildrenUrl(item) {
|
|
411
|
+
return (item.children && item.children.length > 0) || !!item.childrenUrl;
|
|
412
|
+
}
|
|
413
|
+
clearErrors() {
|
|
414
|
+
this.markdownLoaderError = undefined;
|
|
415
|
+
this.childrenUrlError = undefined;
|
|
416
|
+
}
|
|
417
|
+
reset() {
|
|
418
|
+
this.loading = false;
|
|
419
|
+
this.clearErrors();
|
|
420
|
+
// if single item and no children
|
|
421
|
+
if (this.items && this.items.length === 1 && !this.hasChildrenOrChildrenUrl(this.items[0])) {
|
|
422
|
+
this.currentMenuItems = [];
|
|
423
|
+
this.currentMarkdownItem = this.items[0];
|
|
424
|
+
}
|
|
425
|
+
else {
|
|
426
|
+
this.currentMenuItems = this.items;
|
|
427
|
+
this.currentMarkdownItem = undefined;
|
|
428
|
+
}
|
|
429
|
+
this.historyStack = [];
|
|
430
|
+
this._changeDetectorRef.markForCheck();
|
|
431
|
+
}
|
|
432
|
+
goBack() {
|
|
433
|
+
this.loading = false;
|
|
434
|
+
this.clearErrors();
|
|
435
|
+
if (this.historyStack.length > 1) {
|
|
436
|
+
let parent = this.historyStack[this.historyStack.length - 2];
|
|
437
|
+
if (parent.startAtLink) {
|
|
438
|
+
parent = this.historyStack[this.historyStack.length - 3]
|
|
439
|
+
? this.historyStack[this.historyStack.length - 3]
|
|
440
|
+
: undefined;
|
|
441
|
+
this.historyStack = this.historyStack.slice(0, -1);
|
|
442
|
+
}
|
|
443
|
+
if (parent) {
|
|
444
|
+
this.currentMarkdownItem = parent;
|
|
445
|
+
this.historyStack = this.historyStack.slice(0, -1);
|
|
446
|
+
this.setChildrenAsCurrentMenuItems(parent);
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
this.reset();
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
// one level down just go to root
|
|
454
|
+
this.reset();
|
|
455
|
+
}
|
|
456
|
+
this._changeDetectorRef.markForCheck();
|
|
457
|
+
}
|
|
458
|
+
handleItemSelected(item) {
|
|
459
|
+
this.clearErrors();
|
|
460
|
+
this.currentMarkdownItem = item;
|
|
461
|
+
this.historyStack = [...this.historyStack, item];
|
|
462
|
+
this.setChildrenAsCurrentMenuItems(item);
|
|
463
|
+
this._changeDetectorRef.markForCheck();
|
|
464
|
+
}
|
|
465
|
+
setChildrenAsCurrentMenuItems(item) {
|
|
466
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
467
|
+
this.currentMenuItems = [];
|
|
468
|
+
this.loading = true;
|
|
469
|
+
this._changeDetectorRef.markForCheck();
|
|
470
|
+
const stackSnapshot = this.historyStack;
|
|
471
|
+
let children = [];
|
|
472
|
+
if (item.children) {
|
|
473
|
+
children = item.children;
|
|
474
|
+
}
|
|
475
|
+
else if (item.childrenUrl) {
|
|
476
|
+
children = yield this.loadChildrenUrl(item);
|
|
477
|
+
}
|
|
478
|
+
if (children && children.length && item.startAtLink) {
|
|
479
|
+
this._jumpTo(item.startAtLink, children);
|
|
480
|
+
}
|
|
481
|
+
const newStackSnapshot = this.historyStack;
|
|
482
|
+
if (stackSnapshot.length === newStackSnapshot.length &&
|
|
483
|
+
stackSnapshot.every((stackItem, index) => stackItem === newStackSnapshot[index])) {
|
|
484
|
+
this.currentMenuItems = children;
|
|
485
|
+
}
|
|
486
|
+
this.loading = false;
|
|
487
|
+
this._changeDetectorRef.markForCheck();
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
loadChildrenUrl(item) {
|
|
491
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
492
|
+
const sanitizedUrl = this._sanitizer.sanitize(SecurityContext.URL, item.childrenUrl);
|
|
493
|
+
try {
|
|
494
|
+
return yield this._http.get(sanitizedUrl, Object.assign({}, item.httpOptions)).toPromise();
|
|
495
|
+
}
|
|
496
|
+
catch (error) {
|
|
497
|
+
this.handleChildrenUrlError(error);
|
|
498
|
+
return [];
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
getTitle(item) {
|
|
503
|
+
if (item) {
|
|
504
|
+
return (removeLeadingHash(item.anchor) ||
|
|
505
|
+
item.title ||
|
|
506
|
+
getTitleFromUrl(item.url) ||
|
|
507
|
+
getTitleFromMarkdownString(item.markdownString) ||
|
|
508
|
+
'').trim();
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
getIcon(item) {
|
|
512
|
+
if (item) {
|
|
513
|
+
return item.icon || 'subject';
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
handleChildrenUrlError(error) {
|
|
517
|
+
this.childrenUrlError = error.message;
|
|
518
|
+
this._changeDetectorRef.markForCheck();
|
|
519
|
+
}
|
|
520
|
+
handleMarkdownLoaderError(error) {
|
|
521
|
+
this.markdownLoaderError = error.message;
|
|
522
|
+
this._changeDetectorRef.markForCheck();
|
|
523
|
+
}
|
|
524
|
+
_jumpTo(itemOrPath, children) {
|
|
525
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
526
|
+
const historyStack = this.historyStack;
|
|
527
|
+
this.reset();
|
|
528
|
+
if (this.items && this.items.length > 0) {
|
|
529
|
+
let path = [];
|
|
530
|
+
if (Array.isArray(itemOrPath)) {
|
|
531
|
+
path = yield this.followPath(this.items, itemOrPath);
|
|
532
|
+
}
|
|
533
|
+
else if (children && children.length > 0) {
|
|
534
|
+
this.historyStack = historyStack;
|
|
535
|
+
path = this.findPath(children, itemOrPath);
|
|
536
|
+
}
|
|
537
|
+
else {
|
|
538
|
+
path = this.findPath(this.items, itemOrPath);
|
|
539
|
+
}
|
|
540
|
+
(path || []).forEach((pathItem) => this.handleItemSelected(pathItem));
|
|
541
|
+
}
|
|
542
|
+
this._changeDetectorRef.markForCheck();
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
followPath(items, path) {
|
|
546
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
547
|
+
let pathItems = [];
|
|
548
|
+
let currentLevel = items;
|
|
549
|
+
const compareWith = this.compareWith || defaultCompareWith;
|
|
550
|
+
for (const pathItem of path) {
|
|
551
|
+
const foundItem = currentLevel.find((item) => compareWith(pathItem, item));
|
|
552
|
+
if (foundItem) {
|
|
553
|
+
pathItems = [...pathItems, foundItem];
|
|
554
|
+
if (foundItem.children) {
|
|
555
|
+
currentLevel = foundItem.children;
|
|
556
|
+
}
|
|
557
|
+
else if (foundItem.childrenUrl) {
|
|
558
|
+
currentLevel = yield this.loadChildrenUrl(foundItem);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
else {
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
if (pathItems.length !== path.length) {
|
|
566
|
+
pathItems = [];
|
|
567
|
+
}
|
|
568
|
+
return pathItems;
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
findPath(items, item) {
|
|
572
|
+
const compareWith = this.compareWith || defaultCompareWith;
|
|
573
|
+
if (items) {
|
|
574
|
+
for (const child of items) {
|
|
575
|
+
if (compareWith(child, item)) {
|
|
576
|
+
return [child];
|
|
577
|
+
}
|
|
578
|
+
const ancestors = this.findPath(child.children, item);
|
|
579
|
+
if (ancestors) {
|
|
580
|
+
return [child, ...ancestors];
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
return undefined;
|
|
585
|
+
}
|
|
586
|
+
handleLinkClick(event) {
|
|
587
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
588
|
+
event.preventDefault();
|
|
589
|
+
const link = event.target;
|
|
590
|
+
const url = new URL(link.href);
|
|
591
|
+
this.loading = true;
|
|
592
|
+
this._changeDetectorRef.markForCheck();
|
|
593
|
+
try {
|
|
594
|
+
const markdownString = yield this._markdownUrlLoaderService.load(url.href);
|
|
595
|
+
// pass in url to be able to use currentMarkdownItem.url later on
|
|
596
|
+
this.handleItemSelected({ markdownString, url: url.href });
|
|
597
|
+
this.markdownWrapper.nativeElement.scrollTop = 0;
|
|
598
|
+
}
|
|
599
|
+
catch (error) {
|
|
600
|
+
const win = window.open(url.href, '_blank');
|
|
601
|
+
win.focus();
|
|
602
|
+
}
|
|
603
|
+
finally {
|
|
604
|
+
this.loading = false;
|
|
605
|
+
}
|
|
606
|
+
this._changeDetectorRef.markForCheck();
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
/** @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)); };
|
|
611
|
+
/** @nocollapse */ /** @nocollapse */ TdMarkdownNavigatorComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: TdMarkdownNavigatorComponent, selectors: [["td-markdown-navigator"]], viewQuery: function TdMarkdownNavigatorComponent_Query(rf, ctx) {
|
|
612
|
+
if (rf & 1) {
|
|
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, [{
|
|
636
|
+
type: Component,
|
|
637
|
+
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"] }]
|
|
638
|
+
}], function () { return [{ type: i1.TdMarkdownLoaderService }, { type: i0.ChangeDetectorRef }, { type: i2.DomSanitizer }, { type: i3.HttpClient }]; }, { items: [{
|
|
639
|
+
type: Input
|
|
640
|
+
}], labels: [{
|
|
641
|
+
type: Input
|
|
642
|
+
}], startAt: [{
|
|
643
|
+
type: Input
|
|
644
|
+
}], copyCodeToClipboard: [{
|
|
645
|
+
type: Input
|
|
646
|
+
}], copyCodeTooltips: [{
|
|
647
|
+
type: Input
|
|
648
|
+
}], footer: [{
|
|
649
|
+
type: Input
|
|
650
|
+
}], compareWith: [{
|
|
651
|
+
type: Input
|
|
652
|
+
}], buttonClicked: [{
|
|
653
|
+
type: Output
|
|
654
|
+
}], markdownWrapper: [{
|
|
655
|
+
type: ViewChild,
|
|
656
|
+
args: ['markdownWrapper']
|
|
657
|
+
}], clickListener: [{
|
|
658
|
+
type: HostListener,
|
|
659
|
+
args: ['click', ['$event']]
|
|
660
|
+
}] });
|
|
661
|
+
})();
|
|
662
|
+
|
|
663
|
+
const DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS = {
|
|
664
|
+
title: 'Help',
|
|
665
|
+
close: 'Close',
|
|
666
|
+
dock: 'Dock',
|
|
667
|
+
unDock: 'Undock',
|
|
668
|
+
};
|
|
669
|
+
class TdMarkdownNavigatorWindowComponent {
|
|
670
|
+
constructor() {
|
|
671
|
+
this.toolbarColor = 'primary';
|
|
672
|
+
this.docked = false;
|
|
673
|
+
this.copyCodeToClipboard = false;
|
|
674
|
+
this.copyCodeTooltips = {};
|
|
675
|
+
this.closed = new EventEmitter();
|
|
676
|
+
this.dockToggled = new EventEmitter();
|
|
677
|
+
this.buttonClicked = new EventEmitter();
|
|
678
|
+
}
|
|
679
|
+
get markdownNavigatorLabels() {
|
|
680
|
+
if (this.labels) {
|
|
681
|
+
const { goHome, goBack, emptyState } = this.labels;
|
|
682
|
+
return {
|
|
683
|
+
goHome,
|
|
684
|
+
goBack,
|
|
685
|
+
emptyState,
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
get titleLabel() {
|
|
690
|
+
return (this.labels && this.labels.title) || DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.title;
|
|
691
|
+
}
|
|
692
|
+
get closeLabel() {
|
|
693
|
+
return (this.labels && this.labels.close) || DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.close;
|
|
694
|
+
}
|
|
695
|
+
get toggleDockedStateLabel() {
|
|
696
|
+
if (this.docked) {
|
|
697
|
+
return (this.labels && this.labels.unDock) || DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.unDock;
|
|
698
|
+
}
|
|
699
|
+
else {
|
|
700
|
+
return (this.labels && this.labels.dock) || DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.dock;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
toggleDockedState() {
|
|
704
|
+
this.dockToggled.emit(this.docked);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
/** @nocollapse */ /** @nocollapse */ TdMarkdownNavigatorWindowComponent.ɵfac = function TdMarkdownNavigatorWindowComponent_Factory(t) { return new (t || TdMarkdownNavigatorWindowComponent)(); };
|
|
708
|
+
/** @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) {
|
|
709
|
+
if (rf & 1) {
|
|
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, [{
|
|
726
|
+
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:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}td-markdown-navigator{height:calc(100% - 56px)}\n"] }]
|
|
728
|
+
}], null, { items: [{
|
|
729
|
+
type: Input
|
|
730
|
+
}], labels: [{
|
|
731
|
+
type: Input
|
|
732
|
+
}], toolbarColor: [{
|
|
733
|
+
type: Input
|
|
734
|
+
}], startAt: [{
|
|
735
|
+
type: Input
|
|
736
|
+
}], compareWith: [{
|
|
737
|
+
type: Input
|
|
738
|
+
}], docked: [{
|
|
739
|
+
type: Input
|
|
740
|
+
}], copyCodeToClipboard: [{
|
|
741
|
+
type: Input
|
|
742
|
+
}], copyCodeTooltips: [{
|
|
743
|
+
type: Input
|
|
744
|
+
}], footer: [{
|
|
745
|
+
type: Input
|
|
746
|
+
}], closed: [{
|
|
747
|
+
type: Output
|
|
748
|
+
}], dockToggled: [{
|
|
749
|
+
type: Output
|
|
750
|
+
}], buttonClicked: [{
|
|
751
|
+
type: Output
|
|
752
|
+
}] });
|
|
753
|
+
})();
|
|
754
|
+
|
|
755
|
+
const CDK_OVERLAY_CUSTOM_CLASS = 'td-window-dialog';
|
|
756
|
+
const DEFAULT_POSITION = { bottom: '0px', right: '0px' };
|
|
757
|
+
const DEFAULT_WIDTH = '360px';
|
|
758
|
+
const DEFAULT_HEIGHT = '75vh';
|
|
759
|
+
const MIN_HEIGHT = '56px';
|
|
760
|
+
const MAX_WIDTH = '100vw';
|
|
761
|
+
const DEFAULT_DRAGGABLE_DIALOG_CONFIG = {
|
|
762
|
+
hasBackdrop: false,
|
|
763
|
+
closeOnNavigation: true,
|
|
764
|
+
panelClass: [CDK_OVERLAY_CUSTOM_CLASS],
|
|
765
|
+
position: DEFAULT_POSITION,
|
|
766
|
+
height: DEFAULT_HEIGHT,
|
|
767
|
+
width: DEFAULT_WIDTH,
|
|
768
|
+
maxWidth: MAX_WIDTH,
|
|
769
|
+
};
|
|
770
|
+
class TdMarkdownNavigatorWindowService {
|
|
771
|
+
constructor(_tdDialogService, _document, rendererFactory) {
|
|
772
|
+
this._tdDialogService = _tdDialogService;
|
|
773
|
+
this._document = _document;
|
|
774
|
+
this.rendererFactory = rendererFactory;
|
|
775
|
+
this.markdownNavigatorWindowDialog = undefined;
|
|
776
|
+
this.markdownNavigatorWindowDialogsOpen = 0;
|
|
777
|
+
this._renderer2 = rendererFactory.createRenderer(undefined, undefined);
|
|
778
|
+
}
|
|
779
|
+
open(config) {
|
|
780
|
+
this.close();
|
|
781
|
+
let panelClass = [...DEFAULT_DRAGGABLE_DIALOG_CONFIG.panelClass];
|
|
782
|
+
if (config.dialogConfig && config.dialogConfig.panelClass) {
|
|
783
|
+
if (Array.isArray(config.dialogConfig.panelClass)) {
|
|
784
|
+
panelClass = [...config.dialogConfig.panelClass];
|
|
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({
|
|
792
|
+
component: TdMarkdownNavigatorWindowComponent,
|
|
793
|
+
config: draggableConfig,
|
|
794
|
+
dragHandleSelectors: ['.td-window-dialog-toolbar'],
|
|
795
|
+
draggableClass: 'td-draggable-markdown-navigator-window',
|
|
796
|
+
});
|
|
797
|
+
this.markdownNavigatorWindowDialog = matDialogRef;
|
|
798
|
+
this.markdownNavigatorWindowDialog.componentInstance.items = config.items;
|
|
799
|
+
this.markdownNavigatorWindowDialog.componentInstance.labels = config.labels;
|
|
800
|
+
this.markdownNavigatorWindowDialog.componentInstance.startAt = config.startAt;
|
|
801
|
+
this.markdownNavigatorWindowDialog.componentInstance.copyCodeToClipboard = config.copyCodeToClipboard;
|
|
802
|
+
this.markdownNavigatorWindowDialog.componentInstance.copyCodeTooltips = config.copyCodeTooltips;
|
|
803
|
+
this.markdownNavigatorWindowDialog.componentInstance.compareWith = config.compareWith;
|
|
804
|
+
this.markdownNavigatorWindowDialog.componentInstance.toolbarColor =
|
|
805
|
+
'toolbarColor' in config ? config.toolbarColor : 'primary';
|
|
806
|
+
this.markdownNavigatorWindowDialogsOpen++;
|
|
807
|
+
this.markdownNavigatorWindowDialog.componentInstance.footer = config.footer;
|
|
808
|
+
dragRefSubject.subscribe((dragRf) => {
|
|
809
|
+
this.dragRef = dragRf;
|
|
810
|
+
this.resizableDraggableDialog = new ResizableDraggableDialog(this._document, this._renderer2, this.markdownNavigatorWindowDialog, this.dragRef);
|
|
811
|
+
});
|
|
812
|
+
this._handleEvents();
|
|
813
|
+
return this.markdownNavigatorWindowDialog;
|
|
814
|
+
}
|
|
815
|
+
close() {
|
|
816
|
+
if (this.markdownNavigatorWindowDialog) {
|
|
817
|
+
if (this.resizableDraggableDialog) {
|
|
818
|
+
this.resizableDraggableDialog.detach();
|
|
819
|
+
}
|
|
820
|
+
this.markdownNavigatorWindowDialog.close();
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
get isOpen() {
|
|
824
|
+
return this.markdownNavigatorWindowDialogsOpen > 0;
|
|
825
|
+
}
|
|
826
|
+
_handleEvents() {
|
|
827
|
+
let position;
|
|
828
|
+
let dimensions;
|
|
829
|
+
this.markdownNavigatorWindowDialog.componentInstance.closed.subscribe(() => this.close());
|
|
830
|
+
this.markdownNavigatorWindowDialog.componentInstance.dockToggled.subscribe((docked) => {
|
|
831
|
+
if (docked) {
|
|
832
|
+
this.markdownNavigatorWindowDialog.componentInstance.docked = false;
|
|
833
|
+
this.markdownNavigatorWindowDialog.updateSize(dimensions.width, dimensions.height);
|
|
834
|
+
this.markdownNavigatorWindowDialog.updatePosition({ top: '0px', right: '0px', bottom: '0px', left: '0px' });
|
|
835
|
+
this.dragRef.setFreeDragPosition(position);
|
|
836
|
+
this.dragRef.disabled = false;
|
|
837
|
+
this.resizableDraggableDialog.attach();
|
|
838
|
+
}
|
|
839
|
+
else {
|
|
840
|
+
dimensions = this._getDialogSize(this.markdownNavigatorWindowDialog);
|
|
841
|
+
position = this.dragRef.getFreeDragPosition();
|
|
842
|
+
this.markdownNavigatorWindowDialog.componentInstance.docked = true;
|
|
843
|
+
this.markdownNavigatorWindowDialog.updateSize(DEFAULT_WIDTH, MIN_HEIGHT);
|
|
844
|
+
this.markdownNavigatorWindowDialog.updatePosition(DEFAULT_POSITION);
|
|
845
|
+
this.dragRef.reset();
|
|
846
|
+
this.dragRef.disabled = true;
|
|
847
|
+
this.resizableDraggableDialog.detach();
|
|
848
|
+
}
|
|
849
|
+
});
|
|
850
|
+
this.markdownNavigatorWindowDialog
|
|
851
|
+
.afterClosed()
|
|
852
|
+
.toPromise()
|
|
853
|
+
.then(() => {
|
|
854
|
+
this.markdownNavigatorWindowDialogsOpen--;
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
_getDialogSize(dialogRef) {
|
|
858
|
+
const { width, height } = getComputedStyle(this._document.getElementById(dialogRef.id).parentElement);
|
|
859
|
+
return {
|
|
860
|
+
width,
|
|
861
|
+
height,
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
/** @nocollapse */ /** @nocollapse */ TdMarkdownNavigatorWindowService.ɵfac = function TdMarkdownNavigatorWindowService_Factory(t) { return new (t || TdMarkdownNavigatorWindowService)(i0.ɵɵinject(i1$1.TdDialogService), i0.ɵɵinject(DOCUMENT), i0.ɵɵinject(i0.RendererFactory2)); };
|
|
866
|
+
/** @nocollapse */ /** @nocollapse */ TdMarkdownNavigatorWindowService.ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TdMarkdownNavigatorWindowService, factory: TdMarkdownNavigatorWindowService.ɵfac });
|
|
867
|
+
(function () {
|
|
868
|
+
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownNavigatorWindowService, [{
|
|
869
|
+
type: Injectable
|
|
870
|
+
}], function () {
|
|
871
|
+
return [{ type: i1$1.TdDialogService }, { type: undefined, decorators: [{
|
|
872
|
+
type: Inject,
|
|
873
|
+
args: [DOCUMENT]
|
|
874
|
+
}] }, { type: i0.RendererFactory2 }];
|
|
875
|
+
}, null);
|
|
876
|
+
})();
|
|
877
|
+
|
|
878
|
+
class TdMarkdownNavigatorWindowDirective {
|
|
879
|
+
constructor(_markdownNavigatorWindowService) {
|
|
880
|
+
this._markdownNavigatorWindowService = _markdownNavigatorWindowService;
|
|
881
|
+
this.disabled = false;
|
|
882
|
+
}
|
|
883
|
+
click() {
|
|
884
|
+
if (!this.disabled) {
|
|
885
|
+
this._markdownNavigatorWindowService.open(this.config);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
/** @nocollapse */ /** @nocollapse */ TdMarkdownNavigatorWindowDirective.ɵfac = function TdMarkdownNavigatorWindowDirective_Factory(t) { return new (t || TdMarkdownNavigatorWindowDirective)(i0.ɵɵdirectiveInject(TdMarkdownNavigatorWindowService)); };
|
|
890
|
+
/** @nocollapse */ /** @nocollapse */ TdMarkdownNavigatorWindowDirective.ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: TdMarkdownNavigatorWindowDirective, selectors: [["", "tdMarkdownNavigatorWindow", ""]], hostBindings: function TdMarkdownNavigatorWindowDirective_HostBindings(rf, ctx) {
|
|
891
|
+
if (rf & 1) {
|
|
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, [{
|
|
897
|
+
type: Directive,
|
|
898
|
+
args: [{
|
|
899
|
+
selector: '[tdMarkdownNavigatorWindow]',
|
|
900
|
+
}]
|
|
901
|
+
}], function () { return [{ type: TdMarkdownNavigatorWindowService }]; }, { config: [{
|
|
902
|
+
type: Input,
|
|
903
|
+
args: ['tdMarkdownNavigatorWindow']
|
|
904
|
+
}], disabled: [{
|
|
905
|
+
type: Input
|
|
906
|
+
}], click: [{
|
|
907
|
+
type: HostListener,
|
|
908
|
+
args: ['click']
|
|
909
|
+
}] });
|
|
910
|
+
})();
|
|
911
|
+
|
|
912
|
+
class CovalentMarkdownNavigatorModule {
|
|
913
|
+
}
|
|
914
|
+
/** @nocollapse */ /** @nocollapse */ CovalentMarkdownNavigatorModule.ɵfac = function CovalentMarkdownNavigatorModule_Factory(t) { return new (t || CovalentMarkdownNavigatorModule)(); };
|
|
915
|
+
/** @nocollapse */ /** @nocollapse */ CovalentMarkdownNavigatorModule.ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: CovalentMarkdownNavigatorModule });
|
|
916
|
+
/** @nocollapse */ /** @nocollapse */ CovalentMarkdownNavigatorModule.ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ providers: [TdMarkdownNavigatorWindowService], imports: [[
|
|
917
|
+
CommonModule,
|
|
918
|
+
// material
|
|
919
|
+
MatButtonModule,
|
|
920
|
+
MatTooltipModule,
|
|
921
|
+
MatListModule,
|
|
922
|
+
MatIconModule,
|
|
923
|
+
MatProgressBarModule,
|
|
924
|
+
CovalentMessageModule,
|
|
925
|
+
CovalentFlavoredMarkdownModule,
|
|
926
|
+
CovalentDialogsModule,
|
|
927
|
+
]] });
|
|
928
|
+
(function () {
|
|
929
|
+
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CovalentMarkdownNavigatorModule, [{
|
|
930
|
+
type: NgModule,
|
|
931
|
+
args: [{
|
|
932
|
+
imports: [
|
|
933
|
+
CommonModule,
|
|
934
|
+
// material
|
|
935
|
+
MatButtonModule,
|
|
936
|
+
MatTooltipModule,
|
|
937
|
+
MatListModule,
|
|
938
|
+
MatIconModule,
|
|
939
|
+
MatProgressBarModule,
|
|
940
|
+
CovalentMessageModule,
|
|
941
|
+
CovalentFlavoredMarkdownModule,
|
|
942
|
+
CovalentDialogsModule,
|
|
943
|
+
],
|
|
944
|
+
declarations: [TdMarkdownNavigatorComponent, TdMarkdownNavigatorWindowComponent, TdMarkdownNavigatorWindowDirective],
|
|
945
|
+
exports: [TdMarkdownNavigatorComponent, TdMarkdownNavigatorWindowComponent, TdMarkdownNavigatorWindowDirective],
|
|
946
|
+
providers: [TdMarkdownNavigatorWindowService],
|
|
947
|
+
}]
|
|
948
|
+
}], null, null);
|
|
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
|
+
})();
|
|
962
|
+
|
|
963
|
+
/**
|
|
964
|
+
* Generated bundle index. Do not edit.
|
|
965
|
+
*/
|
|
966
|
+
|
|
967
|
+
export { CovalentMarkdownNavigatorModule, DEFAULT_MARKDOWN_NAVIGATOR_LABELS, DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS, TdMarkdownNavigatorComponent, TdMarkdownNavigatorWindowComponent, TdMarkdownNavigatorWindowDirective, TdMarkdownNavigatorWindowService };
|
|
968
|
+
//# sourceMappingURL=covalent-markdown-navigator.mjs.map
|