@eui/mobile-core 20.0.2 → 22.0.0-alpha.1
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/CHANGELOG.md +14 -0
- package/docs/architecture.html +223 -0
- package/docs/changelog.html +69 -4
- package/docs/components/EuiMUserProfileActionComponent.html +80 -130
- package/docs/components/EuiMUserProfileAvatarComponent.html +74 -129
- package/docs/components/EuiMUserProfileInfosComponent.html +117 -117
- package/docs/components/EuiMUserProfileInfosItemComponent.html +74 -129
- package/docs/components/EuimAboutComponent.html +108 -28
- package/docs/components/EuimAboutContentLoadingComponent.html +107 -33
- package/docs/components/EuimAlertMessageComponent.html +161 -90
- package/docs/components/EuimAppComponent.html +105 -27
- package/docs/components/EuimAvatarBadgeComponent.html +120 -72
- package/docs/components/EuimAvatarComponent.html +123 -121
- package/docs/components/EuimAvatarIconComponent.html +74 -129
- package/docs/components/EuimAvatarIconSubComponent.html +123 -121
- package/docs/components/EuimAvatarImageComponent.html +91 -121
- package/docs/components/EuimAvatarTextComponent.html +115 -117
- package/docs/components/EuimBadgeComponent.html +121 -43
- package/docs/components/EuimCardComponent.html +123 -71
- package/docs/components/EuimCardListComponent.html +118 -118
- package/docs/components/EuimChangelogComponent.html +131 -128
- package/docs/components/EuimChipSelectorComponent.html +257 -184
- package/docs/components/EuimDataSummaryColComponent.html +92 -25
- package/docs/components/EuimDataSummaryComponent.html +127 -44
- package/docs/components/EuimEmptyListPlaceholderComponent.html +176 -156
- package/docs/components/EuimHeaderDetailsComponent.html +130 -49
- package/docs/components/EuimHelpSupportComponent.html +159 -130
- package/docs/components/EuimHelperTextComponent.html +161 -66
- package/docs/components/EuimLabelComponent.html +134 -53
- package/docs/components/EuimLanguageListComponent.html +185 -31
- package/docs/components/EuimLanguageSelectorComponent.html +156 -54
- package/docs/components/EuimMediaHeaderComponent.html +137 -52
- package/docs/components/EuimMessageComponent.html +130 -47
- package/docs/components/EuimMessageTitleComponent.html +92 -25
- package/docs/components/EuimMultiselectComponent.html +160 -131
- package/docs/components/EuimMultiselectFilterComponent.html +103 -123
- package/docs/components/EuimMultiselectInfoComponent.html +91 -125
- package/docs/components/EuimMultiselectListComponent.html +85 -122
- package/docs/components/EuimMultiselectToolbarComponent.html +126 -134
- package/docs/components/EuimNotificationItemComponent.html +121 -43
- package/docs/components/EuimOpenSourceLicencesComponent.html +127 -137
- package/docs/components/EuimPdfViewerComponent.html +214 -141
- package/docs/components/EuimScrollerXComponent.html +78 -130
- package/docs/components/EuimSidebarComponent.html +125 -114
- package/docs/components/EuimSidebarContentComponent.html +151 -124
- package/docs/components/EuimSkeletonListComponent.html +127 -42
- package/docs/components/EuimSkeletonListItemComponent.html +159 -56
- package/docs/components/EuimSlideInfoScreenComponent.html +74 -129
- package/docs/components/EuimSliderInfoScreenComponent.html +247 -174
- package/docs/components/EuimSpinnerComponent.html +131 -119
- package/docs/components/EuimSpinnerDescriptionComponent.html +74 -129
- package/docs/components/EuimSpinnerMessageComponent.html +74 -129
- package/docs/components/EuimToolbarActionItemsComponent.html +74 -129
- package/docs/components/EuimToolbarComponent.html +150 -140
- package/docs/components/EuimToolbarDatepickerComponent.html +291 -114
- package/docs/components/EuimToolbarQrcodeComponent.html +100 -32
- package/docs/components/EuimToolbarTitleComponent.html +121 -43
- package/docs/components/EuimUserProfileComponent.html +117 -117
- package/docs/dependencies.html +56 -4
- package/docs/directives/BaseStatesDirective.html +175 -62
- package/docs/directives/EuimAlignCenterDirective.html +92 -23
- package/docs/directives/EuimAlignTopDirective.html +92 -23
- package/docs/directives/EuimAvatarMainIconDirective.html +73 -23
- package/docs/directives/EuimAvatarSubIconDirective.html +73 -23
- package/docs/directives/EuimCardImageDirective.html +86 -118
- package/docs/directives/EuimChipSelectorItemDirective.html +104 -108
- package/docs/directives/EuimDataSummaryColLabelDirective.html +121 -41
- package/docs/directives/EuimDataSummaryColValueDirective.html +117 -41
- package/docs/directives/EuimDividerDirective.html +118 -42
- package/docs/directives/EuimEmptyListPlaceholderIconDirective.html +92 -23
- package/docs/directives/EuimEmptyListPlaceholderSubtitleDirective.html +92 -23
- package/docs/directives/EuimEmptyListPlaceholderTitleDirective.html +92 -23
- package/docs/directives/EuimFooterTransparentDirective.html +92 -23
- package/docs/directives/EuimHeaderDetailsIconDirective.html +66 -126
- package/docs/directives/EuimHeaderDetailsMetaDirective.html +66 -126
- package/docs/directives/EuimHeaderDetailsTitleDirective.html +66 -126
- package/docs/directives/EuimListHeaderDirective.html +118 -42
- package/docs/directives/EuimListItemNoPaddingsDirective.html +92 -23
- package/docs/directives/EuimMediaHeaderCustomContentDirective.html +95 -23
- package/docs/directives/EuimMediaHeaderImageDirective.html +92 -23
- package/docs/directives/EuimMediaHeaderSubTitleDirective.html +92 -23
- package/docs/directives/EuimMediaHeaderTitleDirective.html +66 -126
- package/docs/directives/EuimMinWidthDirective.html +105 -29
- package/docs/directives/EuimMultiselectAllDirective.html +138 -101
- package/docs/directives/EuimMultiselectSelectFieldDirective.html +102 -127
- package/docs/directives/EuimReadOnlyFormDirective.html +66 -126
- package/docs/directives/EuimReadOnlyFormLabelDirective.html +92 -23
- package/docs/directives/EuimReadOnlyFormValueDirective.html +66 -126
- package/docs/directives/EuimSidebarFooterNoBordersDirective.html +92 -23
- package/docs/directives/EuimSkeletonTextAvatarDirective.html +92 -23
- package/docs/directives/EuimSliderInfoScreenContentDirective.html +112 -114
- package/docs/directives/EuimSliderInfoScreenSubTitleDirective.html +66 -126
- package/docs/directives/EuimSliderInfoScreenTitleDirective.html +66 -126
- package/docs/directives/EuimToolbarDatepickerDatetimeDirective.html +122 -43
- package/docs/directives/EuimToolbarTransparentDirective.html +140 -54
- package/docs/index.html +54 -2
- package/docs/injectables/EuimAppService.html +102 -38
- package/docs/interfaces/ActionBtnsIconsNames.html +169 -123
- package/docs/interfaces/ActionBtnsNames.html +169 -123
- package/docs/interfaces/FilteredData.html +138 -92
- package/docs/interfaces/HelpAndSupportItem.html +145 -99
- package/docs/interfaces/Item.html +504 -458
- package/docs/interfaces/MenuItem.html +408 -362
- package/docs/interfaces/UIState.html +109 -63
- package/docs/js/architecture-graph.js +288 -0
- package/docs/js/libs/bootstrap-native.js +4 -2
- package/docs/js/libs/jszip.min.js +13 -0
- package/docs/js/libs/svg-pan-zoom.min.js +3 -3
- package/docs/js/libs/tablesort.min.js +3 -3
- package/docs/js/libs/tablesort.number.min.js +3 -3
- package/docs/js/libs/vis-network.min.js +78 -0
- package/docs/js/menu-wc.js +25 -13
- package/docs/js/routes/routes_index.js +1 -0
- package/docs/js/routes.js +142 -34
- package/docs/js/search/search.js +62 -0
- package/docs/js/search/search_index.js +2 -2
- package/docs/js/tabs.js +98 -15
- package/docs/js/tree.js +44 -7
- package/docs/json/EuimAlertMessageComponent.md +1 -1
- package/docs/json/EuimAvatarImageComponent.md +1 -1
- package/docs/json/EuimCardListComponent.md +1 -1
- package/docs/json/EuimChangelogComponent.md +1 -1
- package/docs/json/EuimChipSelectorComponent.md +4 -4
- package/docs/json/EuimHeaderDetailsComponent.md +1 -1
- package/docs/json/EuimHelperTextComponent.md +1 -0
- package/docs/json/EuimMultiselectComponent.md +1 -1
- package/docs/json/EuimMultiselectToolbarComponent.md +2 -2
- package/docs/json/EuimOpenSourceLicencesComponent.md +2 -2
- package/docs/json/EuimPdfViewerComponent.md +0 -1
- package/docs/json/EuimSidebarContentComponent.md +3 -4
- package/docs/json/EuimSliderInfoScreenComponent.md +3 -3
- package/docs/json/EuimToolbarComponent.md +1 -1
- package/docs/json/EuimToolbarDatepickerComponent.md +5 -4
- package/docs/json/EuimToolbarQrcodeComponent.md +1 -1
- package/docs/json/HbsRenderService.md +6 -0
- package/docs/json/TemplateEditorService.md +6 -0
- package/docs/json/TemplatePlaygroundComponent.md +8 -0
- package/docs/json/ZipExportService.md +6 -0
- package/docs/json/documentation.json +6868 -3891
- package/docs/license.html +46 -4
- package/docs/llms.txt +1527 -0
- package/docs/miscellaneous/typealiases.html +53 -8
- package/docs/miscellaneous/variables.html +320 -36
- package/docs/modules/EuimAboutModule.html +87 -10
- package/docs/modules/EuimAlertMessageModule.html +75 -10
- package/docs/modules/EuimAllModule.html +190 -9
- package/docs/modules/EuimAppModule.html +75 -10
- package/docs/modules/EuimAvatarModule.html +99 -10
- package/docs/modules/EuimBadgeModule.html +75 -10
- package/docs/modules/EuimCardListModule.html +75 -10
- package/docs/modules/EuimCardModule.html +78 -10
- package/docs/modules/EuimChipSelectorComponentModule.html +74 -10
- package/docs/modules/EuimDataSummaryModule.html +84 -10
- package/docs/modules/EuimDividerModule.html +75 -10
- package/docs/modules/EuimEmptyListPlaceholderModule.html +90 -10
- package/docs/modules/EuimHeaderDetailsModule.html +84 -10
- package/docs/modules/EuimLabelModule.html +87 -10
- package/docs/modules/EuimLanguageSelectorModule.html +81 -10
- package/docs/modules/EuimListHeaderModule.html +75 -10
- package/docs/modules/EuimMediaHeaderModule.html +87 -10
- package/docs/modules/EuimMessageModule.html +78 -10
- package/docs/modules/EuimMultiselectModule.html +93 -10
- package/docs/modules/EuimNotificationItemModule.html +75 -10
- package/docs/modules/EuimPdfViewerModule.html +75 -10
- package/docs/modules/EuimScrollerXComponentModule.html +75 -10
- package/docs/modules/EuimSidebarModule.html +78 -10
- package/docs/modules/EuimSkeletonListItemModule.html +75 -10
- package/docs/modules/EuimSkeletonListModule.html +75 -10
- package/docs/modules/EuimSkeletonTextAvatarModule.html +75 -10
- package/docs/modules/EuimSliderInfoScreenModule.html +87 -10
- package/docs/modules/EuimSpinnerComponentModule.html +81 -10
- package/docs/modules/EuimToolbarComponentModule.html +81 -10
- package/docs/modules/EuimToolbarDatepickerModule.html +75 -10
- package/docs/modules/EuimToolbarQrcodeModule.html +75 -10
- package/docs/modules/EuimUserProfileModule.html +87 -10
- package/docs/modules.html +44 -2
- package/docs/properties.html +45 -3
- package/docs/routes.html +228 -0
- package/docs/styles/compodoc.css +365 -44
- package/docs/styles/dark.css +16 -0
- package/docs/template-playground/default-templates.json +192 -0
- package/docs/template-playground/hbs-render.service.ts +217 -0
- package/docs/template-playground/main.ts +9 -0
- package/docs/template-playground/template-editor.service.ts +173 -0
- package/docs/template-playground/template-playground.component.ts +614 -0
- package/docs/template-playground/template-playground.module.ts +29 -0
- package/docs/template-playground/zip-export.service.ts +86 -0
- package/docs/template-playground-app/app.js +1389 -0
- package/docs/template-playground-app/index.html +462 -0
- package/fesm2022/eui-mobile-core.mjs +870 -1214
- package/fesm2022/eui-mobile-core.mjs.map +1 -1
- package/package.json +12 -11
- package/{index.d.ts → types/eui-mobile-core.d.ts} +143 -215
- package/types/eui-mobile-core.d.ts.map +1 -0
- package/docs/js/libs/vis.min.js +0 -47
- package/docs/js/menu-wc_es5.js +0 -40
|
@@ -62,6 +62,20 @@
|
|
|
62
62
|
}
|
|
63
63
|
toggleDarkMode(darkModeState);
|
|
64
64
|
</script>
|
|
65
|
+
<script>
|
|
66
|
+
// --- Iframe navigation tracking for Template Playground ---
|
|
67
|
+
function sendCurrentUrlToParent() {
|
|
68
|
+
if (window.parent && window.parent !== window) {
|
|
69
|
+
window.parent.postMessage({
|
|
70
|
+
type: 'compodoc-iframe-navigate',
|
|
71
|
+
url: window.location.pathname + window.location.hash
|
|
72
|
+
}, '*');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
window.addEventListener('hashchange', sendCurrentUrlToParent, false);
|
|
76
|
+
window.addEventListener('popstate', sendCurrentUrlToParent, false);
|
|
77
|
+
window.addEventListener('DOMContentLoaded', sendCurrentUrlToParent, false);
|
|
78
|
+
</script>
|
|
65
79
|
|
|
66
80
|
<div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
|
|
67
81
|
<div class="d-flex">
|
|
@@ -71,7 +85,14 @@
|
|
|
71
85
|
</div>
|
|
72
86
|
|
|
73
87
|
<div class="xs-menu menu" id="mobile-menu">
|
|
74
|
-
<div id="book-search-input" role="search"
|
|
88
|
+
<div id="book-search-input" role="search">
|
|
89
|
+
<input type="text" placeholder="Type to search">
|
|
90
|
+
<button type="button"
|
|
91
|
+
class="search-input-clear"
|
|
92
|
+
aria-label="Clear search"
|
|
93
|
+
data-search-input-clear>×</button>
|
|
94
|
+
</div>
|
|
95
|
+
<compodoc-menu></compodoc-menu>
|
|
75
96
|
</div>
|
|
76
97
|
|
|
77
98
|
<div class="container-fluid main">
|
|
@@ -95,6 +116,10 @@
|
|
|
95
116
|
|
|
96
117
|
|
|
97
118
|
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
98
123
|
<ol class="breadcrumb">
|
|
99
124
|
<li class="breadcrumb-item">Interfaces</li>
|
|
100
125
|
<li class="breadcrumb-item"
|
|
@@ -102,6 +127,11 @@
|
|
|
102
127
|
UIState</li>
|
|
103
128
|
</ol>
|
|
104
129
|
|
|
130
|
+
<div class="io-file io-file-path" data-compodoc="entity-file-path">
|
|
131
|
+
<span class="icon ion-ios-document" aria-hidden="true"></span>
|
|
132
|
+
<code>packages/core/src/lib/services/euim-app.service.ts</code>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
105
135
|
<ul class="nav nav-tabs" role="tablist">
|
|
106
136
|
<li class="nav-item">
|
|
107
137
|
<a href="#info"
|
|
@@ -109,84 +139,83 @@
|
|
|
109
139
|
class="nav-link active"
|
|
110
140
|
role="tab" id="info-tab" data-bs-toggle="tab" data-link="info">Info</a>
|
|
111
141
|
</li>
|
|
142
|
+
<li class="nav-item">
|
|
143
|
+
<a href="#api"
|
|
144
|
+
class="nav-link"
|
|
145
|
+
|
|
146
|
+
role="tab" id="api-tab" data-bs-toggle="tab" data-link="api">API</a>
|
|
147
|
+
</li>
|
|
112
148
|
</ul>
|
|
113
149
|
|
|
114
150
|
<div class="tab-content">
|
|
115
151
|
<div class="tab-pane fade active in" id="info">
|
|
116
|
-
<p class="comment">
|
|
117
|
-
<h3>File</h3>
|
|
118
|
-
</p>
|
|
119
|
-
<p class="comment">
|
|
120
|
-
<code>packages/core/src/lib/services/euim-app.service.ts</code>
|
|
121
|
-
</p>
|
|
122
|
-
|
|
123
152
|
|
|
124
153
|
|
|
125
154
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<div class="tab-pane fade " id="api"><section data-compodoc="block-index">
|
|
158
|
+
<h3 id="index">Index</h3>
|
|
159
|
+
<table class="table table-sm table-bordered index-table">
|
|
160
|
+
<tbody>
|
|
161
|
+
<tr>
|
|
162
|
+
<td class="col-md-3">
|
|
163
|
+
<h6><b>Properties</b></h6>
|
|
164
|
+
</td>
|
|
165
|
+
<td class="col-md-9">
|
|
166
|
+
<ul class="index-list">
|
|
167
|
+
<li>
|
|
168
|
+
<a href="#isLanguageListVisible" class="reference-link ">
|
|
169
|
+
<span class="reference-badge reference-badge--property" aria-hidden="true">P</span><span class="reference-link-label">isLanguageListVisible</span>
|
|
170
|
+
</a>
|
|
171
|
+
</li>
|
|
172
|
+
</ul>
|
|
173
|
+
</td>
|
|
174
|
+
</tr>
|
|
175
|
+
</tbody>
|
|
176
|
+
</table>
|
|
177
|
+
</section>
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
<section data-compodoc="block-properties">
|
|
182
|
+
<h3 id="inputs">Properties</h3>
|
|
183
|
+
<table class="table table-sm table-bordered">
|
|
129
184
|
<tbody>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
>
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
</li>
|
|
144
|
-
</ul>
|
|
145
|
-
</td>
|
|
146
|
-
</tr>
|
|
147
|
-
</tbody>
|
|
148
|
-
</table>
|
|
149
|
-
</section>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
<section data-compodoc="block-properties">
|
|
154
|
-
<h3 id="inputs">Properties</h3>
|
|
155
|
-
<table class="table table-sm table-bordered">
|
|
156
|
-
<tbody>
|
|
157
|
-
<tr>
|
|
158
|
-
<td class="col-md-4">
|
|
159
|
-
<a name="isLanguageListVisible"></a>
|
|
160
|
-
<span class="name "><b>isLanguageListVisible</b>
|
|
161
|
-
<a href="#isLanguageListVisible">
|
|
162
|
-
<span class="icon ion-ios-link"></span>
|
|
163
|
-
</a>
|
|
164
|
-
</span>
|
|
165
|
-
</td>
|
|
166
|
-
</tr>
|
|
167
|
-
<tr>
|
|
168
|
-
<td class="col-md-4">
|
|
169
|
-
<code>isLanguageListVisible: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
|
|
185
|
+
<tr>
|
|
186
|
+
<td class="col-md-4">
|
|
187
|
+
<a name="isLanguageListVisible"></a>
|
|
188
|
+
<span class="name "><b>isLanguageListVisible</b>
|
|
189
|
+
<a href="#isLanguageListVisible">
|
|
190
|
+
<span class="icon ion-ios-link"></span>
|
|
191
|
+
</a>
|
|
192
|
+
</span>
|
|
193
|
+
</td>
|
|
194
|
+
</tr>
|
|
195
|
+
<tr>
|
|
196
|
+
<td class="col-md-4">
|
|
197
|
+
<code>isLanguageListVisible: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
|
|
170
198
|
</code>
|
|
171
|
-
|
|
172
|
-
|
|
199
|
+
</td>
|
|
200
|
+
</tr>
|
|
173
201
|
|
|
174
202
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
203
|
+
<tr>
|
|
204
|
+
<td class="col-md-4">
|
|
205
|
+
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
|
|
178
206
|
|
|
179
|
-
|
|
180
|
-
|
|
207
|
+
</td>
|
|
208
|
+
</tr>
|
|
181
209
|
|
|
182
210
|
|
|
183
211
|
|
|
184
212
|
|
|
185
213
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
</
|
|
189
|
-
</
|
|
214
|
+
|
|
215
|
+
</tbody>
|
|
216
|
+
</table>
|
|
217
|
+
</section>
|
|
218
|
+
</div>
|
|
190
219
|
|
|
191
220
|
|
|
192
221
|
</div>
|
|
@@ -230,6 +259,24 @@
|
|
|
230
259
|
|
|
231
260
|
<script>
|
|
232
261
|
$darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
|
|
262
|
+
var updateDarkModeSwitchOffset = function () {
|
|
263
|
+
var content = document.querySelector('.content');
|
|
264
|
+
var scrollbarWidth = 0;
|
|
265
|
+
|
|
266
|
+
if (content) {
|
|
267
|
+
scrollbarWidth = Math.max(0, content.offsetWidth - content.clientWidth);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
document.documentElement.style.setProperty(
|
|
271
|
+
'--content-scrollbar-width',
|
|
272
|
+
scrollbarWidth + 'px'
|
|
273
|
+
);
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
updateDarkModeSwitchOffset();
|
|
277
|
+
requestAnimationFrame(updateDarkModeSwitchOffset);
|
|
278
|
+
window.addEventListener('resize', updateDarkModeSwitchOffset);
|
|
279
|
+
|
|
233
280
|
checkToggle(darkModeState);
|
|
234
281
|
if ($darkModeToggleSwitchers.length > 0) {
|
|
235
282
|
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
@@ -245,7 +292,6 @@
|
|
|
245
292
|
<script src="../js/libs/lit-html.js"></script>
|
|
246
293
|
|
|
247
294
|
<script src="../js/menu-wc.js" defer></script>
|
|
248
|
-
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
|
249
295
|
|
|
250
296
|
<script src="../js/libs/bootstrap-native.js"></script>
|
|
251
297
|
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
2
|
+
var container = document.getElementById("architecture-graph");
|
|
3
|
+
if (!container) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
if (
|
|
7
|
+
typeof ARCHITECTURE_DEP_GRAPH === "undefined" ||
|
|
8
|
+
!ARCHITECTURE_DEP_GRAPH ||
|
|
9
|
+
!ARCHITECTURE_DEP_GRAPH.nodes
|
|
10
|
+
) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (typeof vis === "undefined" || !vis.Network) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var typeColors = {
|
|
18
|
+
component: "#10b39c",
|
|
19
|
+
directive: "#6747dd",
|
|
20
|
+
pipe: "#de3b91",
|
|
21
|
+
module: "#2973f0",
|
|
22
|
+
injectable: "#b77006",
|
|
23
|
+
};
|
|
24
|
+
var isDarkMode = function () {
|
|
25
|
+
return !!(document.body && document.body.classList.contains("dark"));
|
|
26
|
+
};
|
|
27
|
+
var getNodeTextColor = function () {
|
|
28
|
+
return isDarkMode() ? "#f0f0f0" : "#2d2d2d";
|
|
29
|
+
};
|
|
30
|
+
var getEdgeColor = function () {
|
|
31
|
+
return isDarkMode() ? "#b5b5b5" : "#8b8b8b";
|
|
32
|
+
};
|
|
33
|
+
var getEdgeOpacity = function () {
|
|
34
|
+
return isDarkMode() ? 0.8 : 0.65;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var allNodes = ARCHITECTURE_DEP_GRAPH.nodes.map(function (node) {
|
|
38
|
+
return {
|
|
39
|
+
id: node.id,
|
|
40
|
+
label: node.name,
|
|
41
|
+
type: node.type,
|
|
42
|
+
url: node.url,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
var allEdges = ARCHITECTURE_DEP_GRAPH.edges.map(function (edge) {
|
|
46
|
+
return {
|
|
47
|
+
from: edge.source,
|
|
48
|
+
to: edge.target,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
if (!allNodes.length || !allEdges.length) {
|
|
53
|
+
container.innerHTML =
|
|
54
|
+
'<p class="alert alert-warning">No dependency links to render.</p>';
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var degreeByNodeId = {};
|
|
59
|
+
allEdges.forEach(function (edge) {
|
|
60
|
+
degreeByNodeId[edge.from] = (degreeByNodeId[edge.from] || 0) + 1;
|
|
61
|
+
degreeByNodeId[edge.to] = (degreeByNodeId[edge.to] || 0) + 1;
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
allNodes = allNodes.map(function (node) {
|
|
65
|
+
var degree = degreeByNodeId[node.id] || 1;
|
|
66
|
+
return {
|
|
67
|
+
id: node.id,
|
|
68
|
+
label: node.label,
|
|
69
|
+
title: node.label + " (" + node.type + ")",
|
|
70
|
+
type: node.type,
|
|
71
|
+
url: node.url,
|
|
72
|
+
color: typeColors[node.type] || typeColors.module,
|
|
73
|
+
size: Math.min(30, 10 + degree * 1.3),
|
|
74
|
+
font: { color: getNodeTextColor(), size: 12 },
|
|
75
|
+
borderWidth: 1,
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
var activeTypes = {};
|
|
80
|
+
var knownTypes = ["component", "directive", "pipe", "module", "injectable"];
|
|
81
|
+
knownTypes.forEach(function (type) {
|
|
82
|
+
activeTypes[type] = true;
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
var nodeById = {};
|
|
86
|
+
allNodes.forEach(function (node) {
|
|
87
|
+
nodeById[node.id] = node;
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
var network;
|
|
91
|
+
var currentScale = 1;
|
|
92
|
+
|
|
93
|
+
var applyGraphTheme = function () {
|
|
94
|
+
var textColor = getNodeTextColor();
|
|
95
|
+
var edgeColor = getEdgeColor();
|
|
96
|
+
var edgeOpacity = getEdgeOpacity();
|
|
97
|
+
|
|
98
|
+
for (var i = 0; i < allNodes.length; i++) {
|
|
99
|
+
allNodes[i].font = allNodes[i].font || {};
|
|
100
|
+
allNodes[i].font.color = textColor;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (network) {
|
|
104
|
+
network.setOptions({
|
|
105
|
+
edges: {
|
|
106
|
+
color: { color: edgeColor, opacity: edgeOpacity },
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
var getFilteredGraphData = function () {
|
|
113
|
+
var visibleNodes = allNodes.filter(function (node) {
|
|
114
|
+
return activeTypes[node.type];
|
|
115
|
+
});
|
|
116
|
+
var visibleNodeIds = {};
|
|
117
|
+
visibleNodes.forEach(function (node) {
|
|
118
|
+
visibleNodeIds[node.id] = true;
|
|
119
|
+
});
|
|
120
|
+
var visibleEdges = allEdges.filter(function (edge) {
|
|
121
|
+
return visibleNodeIds[edge.from] && visibleNodeIds[edge.to];
|
|
122
|
+
});
|
|
123
|
+
return { nodes: visibleNodes, edges: visibleEdges };
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
var renderFilteredGraph = function () {
|
|
127
|
+
var filtered = getFilteredGraphData();
|
|
128
|
+
network.setData({
|
|
129
|
+
nodes: new vis.DataSet(filtered.nodes),
|
|
130
|
+
edges: new vis.DataSet(filtered.edges),
|
|
131
|
+
});
|
|
132
|
+
network.stabilize(120);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
var options = {
|
|
136
|
+
autoResize: true,
|
|
137
|
+
layout: {
|
|
138
|
+
improvedLayout: true,
|
|
139
|
+
},
|
|
140
|
+
interaction: {
|
|
141
|
+
hover: true,
|
|
142
|
+
dragView: true,
|
|
143
|
+
zoomView: true,
|
|
144
|
+
},
|
|
145
|
+
physics: {
|
|
146
|
+
enabled: true,
|
|
147
|
+
stabilization: {
|
|
148
|
+
enabled: true,
|
|
149
|
+
iterations: 180,
|
|
150
|
+
fit: true,
|
|
151
|
+
},
|
|
152
|
+
barnesHut: {
|
|
153
|
+
gravitationalConstant: -6000,
|
|
154
|
+
centralGravity: 0.35,
|
|
155
|
+
springLength: 130,
|
|
156
|
+
springConstant: 0.02,
|
|
157
|
+
damping: 0.2,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
edges: {
|
|
161
|
+
arrows: { to: { enabled: true, scaleFactor: 0.6 } },
|
|
162
|
+
color: { color: getEdgeColor(), opacity: getEdgeOpacity() },
|
|
163
|
+
smooth: {
|
|
164
|
+
enabled: true,
|
|
165
|
+
type: "dynamic",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
nodes: {
|
|
169
|
+
shape: "dot",
|
|
170
|
+
scaling: {
|
|
171
|
+
min: 9,
|
|
172
|
+
max: 32,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
var initialData = getFilteredGraphData();
|
|
178
|
+
network = new vis.Network(
|
|
179
|
+
container,
|
|
180
|
+
{
|
|
181
|
+
nodes: new vis.DataSet(initialData.nodes),
|
|
182
|
+
edges: new vis.DataSet(initialData.edges),
|
|
183
|
+
},
|
|
184
|
+
options,
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
network.on("click", function (params) {
|
|
188
|
+
if (!params.nodes || params.nodes.length === 0) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
var node = nodeById[params.nodes[0]];
|
|
192
|
+
if (node && node.url) {
|
|
193
|
+
document.location.href = node.url;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
network.once("stabilizationIterationsDone", function () {
|
|
198
|
+
network.fit({ animation: { duration: 250, easingFunction: "easeOutQuad" } });
|
|
199
|
+
currentScale = 1;
|
|
200
|
+
});
|
|
201
|
+
applyGraphTheme();
|
|
202
|
+
|
|
203
|
+
var legendButtons = document.querySelectorAll("[data-architecture-filter]");
|
|
204
|
+
var updateLegendState = function () {
|
|
205
|
+
for (var i = 0; i < legendButtons.length; i++) {
|
|
206
|
+
var button = legendButtons[i];
|
|
207
|
+
var type = button.getAttribute("data-architecture-filter");
|
|
208
|
+
var active = !!activeTypes[type];
|
|
209
|
+
button.setAttribute("aria-pressed", active ? "true" : "false");
|
|
210
|
+
if (active) {
|
|
211
|
+
button.classList.remove("is-disabled");
|
|
212
|
+
} else {
|
|
213
|
+
button.classList.add("is-disabled");
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
for (var i = 0; i < legendButtons.length; i++) {
|
|
219
|
+
legendButtons[i].addEventListener("click", function (event) {
|
|
220
|
+
event.preventDefault();
|
|
221
|
+
var type = this.getAttribute("data-architecture-filter");
|
|
222
|
+
if (!type) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
activeTypes[type] = !activeTypes[type];
|
|
227
|
+
|
|
228
|
+
var activeCount = 0;
|
|
229
|
+
knownTypes.forEach(function (entry) {
|
|
230
|
+
if (activeTypes[entry]) {
|
|
231
|
+
activeCount += 1;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
if (activeCount === 0) {
|
|
235
|
+
knownTypes.forEach(function (entry) {
|
|
236
|
+
activeTypes[entry] = true;
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
updateLegendState();
|
|
241
|
+
renderFilteredGraph();
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
updateLegendState();
|
|
245
|
+
|
|
246
|
+
var zoomIn = document.getElementById("architecture-zoom-in");
|
|
247
|
+
var zoomOut = document.getElementById("architecture-zoom-out");
|
|
248
|
+
var reset = document.getElementById("architecture-reset");
|
|
249
|
+
|
|
250
|
+
if (zoomIn) {
|
|
251
|
+
zoomIn.addEventListener("click", function (ev) {
|
|
252
|
+
ev.preventDefault();
|
|
253
|
+
currentScale = Math.min(4, currentScale * 1.25);
|
|
254
|
+
network.moveTo({
|
|
255
|
+
scale: currentScale,
|
|
256
|
+
animation: { duration: 160, easingFunction: "easeOutQuad" },
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
if (zoomOut) {
|
|
261
|
+
zoomOut.addEventListener("click", function (ev) {
|
|
262
|
+
ev.preventDefault();
|
|
263
|
+
currentScale = Math.max(0.2, currentScale / 1.25);
|
|
264
|
+
network.moveTo({
|
|
265
|
+
scale: currentScale,
|
|
266
|
+
animation: { duration: 160, easingFunction: "easeOutQuad" },
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
if (reset) {
|
|
271
|
+
reset.addEventListener("click", function (ev) {
|
|
272
|
+
ev.preventDefault();
|
|
273
|
+
network.fit({ animation: { duration: 180, easingFunction: "easeOutQuad" } });
|
|
274
|
+
currentScale = 1;
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (window.MutationObserver && document.body) {
|
|
279
|
+
var bodyThemeObserver = new MutationObserver(function () {
|
|
280
|
+
applyGraphTheme();
|
|
281
|
+
renderFilteredGraph();
|
|
282
|
+
});
|
|
283
|
+
bodyThemeObserver.observe(document.body, {
|
|
284
|
+
attributes: true,
|
|
285
|
+
attributeFilter: ["class"],
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
});
|