@eui/base 23.0.0-alpha.2 → 23.0.0-alpha.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.
Files changed (108) hide show
  1. package/docs/architecture.html +223 -0
  2. package/docs/changelog.html +126 -2
  3. package/docs/classes/ConsoleAppender.html +76 -27
  4. package/docs/classes/EuiEuLanguages.html +55 -16
  5. package/docs/classes/EuiLazyService.html +86 -25
  6. package/docs/classes/EuiPagination.html +69 -16
  7. package/docs/classes/EuiService.html +103 -28
  8. package/docs/classes/LogAppender.html +52 -20
  9. package/docs/classes/Logger.html +100 -30
  10. package/docs/classes/LoggerMock.html +92 -22
  11. package/docs/classes/UrlAppender.html +78 -24
  12. package/docs/classes/UxBadgeLegacy.html +47 -16
  13. package/docs/classes/UxClearErrorFeedbackEvent.html +47 -16
  14. package/docs/classes/UxErrorGroupOnClickEvent.html +47 -16
  15. package/docs/classes/UxErrorOutput.html +91 -24
  16. package/docs/classes/UxLinkLegacy.html +105 -31
  17. package/docs/classes/UxPublishErrorFeedbackEvent.html +49 -16
  18. package/docs/classes/UxValidationErrorClass.html +77 -18
  19. package/docs/dependencies.html +38 -4
  20. package/docs/index.html +26 -2
  21. package/docs/interfaces/ApiQueue.html +41 -11
  22. package/docs/interfaces/ApiQueueItem.html +209 -181
  23. package/docs/interfaces/AppState.html +312 -284
  24. package/docs/interfaces/ConnectionStatus.html +134 -93
  25. package/docs/interfaces/ConsoleAppenderConfig.html +206 -104
  26. package/docs/interfaces/ConsoleAppenderTypeConfig.html +253 -53
  27. package/docs/interfaces/CoreState.html +272 -244
  28. package/docs/interfaces/EnvDynamicConfig.html +218 -190
  29. package/docs/interfaces/EuiAppHandlersConfig.html +229 -201
  30. package/docs/interfaces/EuiAppJsonConfig.html +171 -143
  31. package/docs/interfaces/EuiAuthConfig.html +184 -156
  32. package/docs/interfaces/EuiConfig.html +131 -103
  33. package/docs/interfaces/EuiEnvConfig.html +180 -152
  34. package/docs/interfaces/EuiGlobalConfig.html +140 -112
  35. package/docs/interfaces/EuiGrowlMessage.html +408 -380
  36. package/docs/interfaces/EuiLanguage.html +169 -141
  37. package/docs/interfaces/EuiMenuItem.html +1708 -1653
  38. package/docs/interfaces/EuiPaginationConfig.html +228 -200
  39. package/docs/interfaces/EuiServiceModel.html +109 -67
  40. package/docs/interfaces/EuiServiceStatus.html +138 -108
  41. package/docs/interfaces/EuiStoreServiceModel.html +64 -36
  42. package/docs/interfaces/EuiUserRight.html +127 -99
  43. package/docs/interfaces/GlobalConfig.html +268 -240
  44. package/docs/interfaces/HttpErrorHandlerConfig.html +96 -68
  45. package/docs/interfaces/HttpErrorRouteConfig.html +136 -108
  46. package/docs/interfaces/I18nConfig.html +157 -129
  47. package/docs/interfaces/I18nLoaderConfig.html +199 -152
  48. package/docs/interfaces/I18nResource.html +176 -148
  49. package/docs/interfaces/I18nServiceConfig.html +141 -113
  50. package/docs/interfaces/I18nState.html +91 -63
  51. package/docs/interfaces/LoadedConfigModules.html +137 -107
  52. package/docs/interfaces/LocaleServiceConfig.html +102 -74
  53. package/docs/interfaces/LocaleState.html +96 -68
  54. package/docs/interfaces/LogAppenderConfig.html +123 -70
  55. package/docs/interfaces/LogAppenderTypeConfig.html +159 -61
  56. package/docs/interfaces/LogConfig.html +196 -149
  57. package/docs/interfaces/LogEvent.html +246 -199
  58. package/docs/interfaces/LogPosition.html +151 -123
  59. package/docs/interfaces/ModuleConfig.html +236 -12
  60. package/docs/interfaces/ModulesConfig.html +41 -11
  61. package/docs/interfaces/NotificationsState.html +98 -70
  62. package/docs/interfaces/UrlAppenderConfig.html +200 -98
  63. package/docs/interfaces/UrlAppenderTypeConfig.html +247 -53
  64. package/docs/interfaces/UrlLogEvent.html +368 -96
  65. package/docs/interfaces/UserConfig.html +97 -69
  66. package/docs/interfaces/UserDetails.html +237 -190
  67. package/docs/interfaces/UserPreferences.html +141 -113
  68. package/docs/interfaces/UserState.html +326 -279
  69. package/docs/interfaces/UxErrorFeedback.html +373 -235
  70. package/docs/interfaces/UxErrorFollowMap.html +41 -11
  71. package/docs/interfaces/UxErrorInfo.html +201 -151
  72. package/docs/interfaces/UxErrorMessage.html +149 -102
  73. package/docs/interfaces/UxFormValidationError.html +91 -63
  74. package/docs/interfaces/UxHttpErrorInfo.html +112 -65
  75. package/docs/interfaces/UxHttpErrorResponse.html +108 -61
  76. package/docs/interfaces/UxModalLegacy.html +164 -136
  77. package/docs/interfaces/UxValidationErrorAttribute.html +121 -93
  78. package/docs/interfaces/UxValidationErrorFeedback.html +126 -98
  79. package/docs/interfaces/UxValidationErrorI18nMessage.html +127 -99
  80. package/docs/interfaces/VersionsConfig.html +96 -68
  81. package/docs/interfaces/XHRConfig.html +346 -318
  82. package/docs/js/architecture-graph.js +288 -0
  83. package/docs/js/libs/bootstrap-native.js +4 -2
  84. package/docs/js/libs/tablesort.min.js +3 -3
  85. package/docs/js/libs/tablesort.number.min.js +2 -2
  86. package/docs/js/libs/vis-network.min.js +7 -7
  87. package/docs/js/menu-wc.js +30 -23
  88. package/docs/js/routes.js +138 -37
  89. package/docs/js/search/search.js +62 -0
  90. package/docs/js/search/search_index.js +2 -2
  91. package/docs/js/tabs.js +98 -15
  92. package/docs/js/tree.js +44 -7
  93. package/docs/json/documentation.json +3154 -482
  94. package/docs/license.html +26 -2
  95. package/docs/llms.txt +1084 -0
  96. package/docs/miscellaneous/enumerations.html +30 -6
  97. package/docs/miscellaneous/functions.html +138 -27
  98. package/docs/miscellaneous/typealiases.html +62 -29
  99. package/docs/miscellaneous/variables.html +77 -53
  100. package/docs/modules.html +26 -2
  101. package/docs/overview.html +26 -2
  102. package/docs/properties.html +27 -3
  103. package/docs/routes.html +26 -2
  104. package/docs/styles/compodoc.css +365 -44
  105. package/docs/styles/dark.css +16 -0
  106. package/docs/template-playground/hbs-render.service.ts +6 -1
  107. package/package.json +1 -1
  108. package/docs/js/menu-wc_es5.js +0 -40
@@ -19,7 +19,14 @@ customElements.define('compodoc-menu', class extends HTMLElement {
19
19
  </li>
20
20
 
21
21
  <li class="divider"></li>
22
- ${ isNormalMode ? `<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div>` : '' }
22
+ ${ isNormalMode ? `<div id="book-search-input" role="search">
23
+ <input type="text" placeholder="Type to search">
24
+ <button type="button"
25
+ class="search-input-clear"
26
+ aria-label="Clear search"
27
+ data-search-input-clear>&times;</button>
28
+ </div>
29
+ ` : '' }
23
30
  <li class="chapter">
24
31
  <a data-type="chapter-link" href="index.html"><span class="icon ion-ios-home"></span>Getting started</a>
25
32
  <ul class="links">
@@ -68,16 +75,16 @@ customElements.define('compodoc-menu', class extends HTMLElement {
68
75
  <a href="classes/EuiEuLanguages.html" data-type="entity-link" >EuiEuLanguages</a>
69
76
  </li>
70
77
  <li class="link">
71
- <a href="classes/EuiLazyService.html" data-type="entity-link" >EuiLazyService</a>
78
+ <a href="classes/EuiLazyService.html" data-type="entity-link" >EuiLazyService&lt;T&gt;</a>
72
79
  </li>
73
80
  <li class="link">
74
81
  <a href="classes/EuiPagination.html" data-type="entity-link" >EuiPagination</a>
75
82
  </li>
76
83
  <li class="link">
77
- <a href="classes/EuiService.html" data-type="entity-link" >EuiService</a>
84
+ <a href="classes/EuiService.html" data-type="entity-link" >EuiService&lt;T&gt;</a>
78
85
  </li>
79
86
  <li class="link">
80
- <a href="classes/LogAppender.html" data-type="entity-link" >LogAppender</a>
87
+ <a href="classes/LogAppender.html" data-type="entity-link" >LogAppender&lt;CFG extends LogAppenderConfig &#x3D; LogAppenderConfig&gt;</a>
81
88
  </li>
82
89
  <li class="link">
83
90
  <a href="classes/Logger.html" data-type="entity-link" >Logger</a>
@@ -98,16 +105,16 @@ customElements.define('compodoc-menu', class extends HTMLElement {
98
105
  <a href="classes/UxErrorGroupOnClickEvent.html" data-type="entity-link" >UxErrorGroupOnClickEvent</a>
99
106
  </li>
100
107
  <li class="link">
101
- <a href="classes/UxErrorOutput.html" data-type="entity-link" >UxErrorOutput</a>
108
+ <a href="classes/UxErrorOutput.html" data-type="entity-link" >UxErrorOutput&lt;DETAILS &#x3D; unknown&gt;</a>
102
109
  </li>
103
110
  <li class="link">
104
- <a href="classes/UxLinkLegacy.html" data-type="entity-link" >UxLinkLegacy</a>
111
+ <a href="classes/UxLinkLegacy.html" data-type="entity-link" >UxLinkLegacy&lt;METADATA &#x3D; unknown&gt;</a>
105
112
  </li>
106
113
  <li class="link">
107
114
  <a href="classes/UxPublishErrorFeedbackEvent.html" data-type="entity-link" >UxPublishErrorFeedbackEvent</a>
108
115
  </li>
109
116
  <li class="link">
110
- <a href="classes/UxValidationErrorClass.html" data-type="entity-link" >UxValidationErrorClass</a>
117
+ <a href="classes/UxValidationErrorClass.html" data-type="entity-link" >UxValidationErrorClass&lt;Details &#x3D; object&gt;</a>
111
118
  </li>
112
119
  </ul>
113
120
  </li>
@@ -123,10 +130,10 @@ customElements.define('compodoc-menu', class extends HTMLElement {
123
130
  <a href="interfaces/ApiQueue.html" data-type="entity-link" >ApiQueue</a>
124
131
  </li>
125
132
  <li class="link">
126
- <a href="interfaces/ApiQueueItem.html" data-type="entity-link" >ApiQueueItem</a>
133
+ <a href="interfaces/ApiQueueItem.html" data-type="entity-link" >ApiQueueItem&lt;PAYLOAD &#x3D; unknown&gt;</a>
127
134
  </li>
128
135
  <li class="link">
129
- <a href="interfaces/AppState.html" data-type="entity-link" >AppState</a>
136
+ <a href="interfaces/AppState.html" data-type="entity-link" >AppState&lt;T &#x3D; any&gt;</a>
130
137
  </li>
131
138
  <li class="link">
132
139
  <a href="interfaces/ConnectionStatus.html" data-type="entity-link" >ConnectionStatus</a>
@@ -144,10 +151,10 @@ customElements.define('compodoc-menu', class extends HTMLElement {
144
151
  <a href="interfaces/EnvDynamicConfig.html" data-type="entity-link" >EnvDynamicConfig</a>
145
152
  </li>
146
153
  <li class="link">
147
- <a href="interfaces/EuiAppHandlersConfig.html" data-type="entity-link" >EuiAppHandlersConfig</a>
154
+ <a href="interfaces/EuiAppHandlersConfig.html" data-type="entity-link" >EuiAppHandlersConfig&lt;T &#x3D; any&gt;</a>
148
155
  </li>
149
156
  <li class="link">
150
- <a href="interfaces/EuiAppJsonConfig.html" data-type="entity-link" >EuiAppJsonConfig</a>
157
+ <a href="interfaces/EuiAppJsonConfig.html" data-type="entity-link" >EuiAppJsonConfig&lt;T &#x3D; any&gt;</a>
151
158
  </li>
152
159
  <li class="link">
153
160
  <a href="interfaces/EuiAuthConfig.html" data-type="entity-link" >EuiAuthConfig</a>
@@ -156,7 +163,7 @@ customElements.define('compodoc-menu', class extends HTMLElement {
156
163
  <a href="interfaces/EuiConfig.html" data-type="entity-link" >EuiConfig</a>
157
164
  </li>
158
165
  <li class="link">
159
- <a href="interfaces/EuiEnvConfig.html" data-type="entity-link" >EuiEnvConfig</a>
166
+ <a href="interfaces/EuiEnvConfig.html" data-type="entity-link" >EuiEnvConfig&lt;T &#x3D; unknown&gt;</a>
160
167
  </li>
161
168
  <li class="link">
162
169
  <a href="interfaces/EuiGlobalConfig.html" data-type="entity-link" >EuiGlobalConfig</a>
@@ -168,25 +175,25 @@ customElements.define('compodoc-menu', class extends HTMLElement {
168
175
  <a href="interfaces/EuiLanguage.html" data-type="entity-link" >EuiLanguage</a>
169
176
  </li>
170
177
  <li class="link">
171
- <a href="interfaces/EuiMenuItem.html" data-type="entity-link" >EuiMenuItem</a>
178
+ <a href="interfaces/EuiMenuItem.html" data-type="entity-link" >EuiMenuItem&lt;METADATA &#x3D; unknown&gt;</a>
172
179
  </li>
173
180
  <li class="link">
174
181
  <a href="interfaces/EuiPaginationConfig.html" data-type="entity-link" >EuiPaginationConfig</a>
175
182
  </li>
176
183
  <li class="link">
177
- <a href="interfaces/EuiServiceModel.html" data-type="entity-link" >EuiServiceModel</a>
184
+ <a href="interfaces/EuiServiceModel.html" data-type="entity-link" >EuiServiceModel&lt;T&gt;</a>
178
185
  </li>
179
186
  <li class="link">
180
- <a href="interfaces/EuiServiceStatus.html" data-type="entity-link" >EuiServiceStatus</a>
187
+ <a href="interfaces/EuiServiceStatus.html" data-type="entity-link" >EuiServiceStatus&lt;T &#x3D; unknown&gt;</a>
181
188
  </li>
182
189
  <li class="link">
183
- <a href="interfaces/EuiStoreServiceModel.html" data-type="entity-link" >EuiStoreServiceModel</a>
190
+ <a href="interfaces/EuiStoreServiceModel.html" data-type="entity-link" >EuiStoreServiceModel&lt;T&gt;</a>
184
191
  </li>
185
192
  <li class="link">
186
193
  <a href="interfaces/EuiUserRight.html" data-type="entity-link" >EuiUserRight</a>
187
194
  </li>
188
195
  <li class="link">
189
- <a href="interfaces/GlobalConfig.html" data-type="entity-link" >GlobalConfig</a>
196
+ <a href="interfaces/GlobalConfig.html" data-type="entity-link" >GlobalConfig&lt;T &#x3D; any&gt;</a>
190
197
  </li>
191
198
  <li class="link">
192
199
  <a href="interfaces/HttpErrorHandlerConfig.html" data-type="entity-link" >HttpErrorHandlerConfig</a>
@@ -228,19 +235,19 @@ customElements.define('compodoc-menu', class extends HTMLElement {
228
235
  <a href="interfaces/LogConfig.html" data-type="entity-link" >LogConfig</a>
229
236
  </li>
230
237
  <li class="link">
231
- <a href="interfaces/LogEvent.html" data-type="entity-link" >LogEvent</a>
238
+ <a href="interfaces/LogEvent.html" data-type="entity-link" >LogEvent&lt;MESSAGES &#x3D; unknown&gt;</a>
232
239
  </li>
233
240
  <li class="link">
234
241
  <a href="interfaces/LogPosition.html" data-type="entity-link" >LogPosition</a>
235
242
  </li>
236
243
  <li class="link">
237
- <a href="interfaces/ModuleConfig.html" data-type="entity-link" >ModuleConfig</a>
244
+ <a href="interfaces/ModuleConfig.html" data-type="entity-link" >ModuleConfig&lt;T &#x3D; any&gt;</a>
238
245
  </li>
239
246
  <li class="link">
240
247
  <a href="interfaces/ModulesConfig.html" data-type="entity-link" >ModulesConfig</a>
241
248
  </li>
242
249
  <li class="link">
243
- <a href="interfaces/NotificationsState.html" data-type="entity-link" >NotificationsState</a>
250
+ <a href="interfaces/NotificationsState.html" data-type="entity-link" >NotificationsState&lt;LIST &#x3D; unknown&gt;</a>
244
251
  </li>
245
252
  <li class="link">
246
253
  <a href="interfaces/UrlAppenderConfig.html" data-type="entity-link" >UrlAppenderConfig</a>
@@ -258,7 +265,7 @@ customElements.define('compodoc-menu', class extends HTMLElement {
258
265
  <a href="interfaces/UserDetails.html" data-type="entity-link" >UserDetails</a>
259
266
  </li>
260
267
  <li class="link">
261
- <a href="interfaces/UserPreferences.html" data-type="entity-link" >UserPreferences</a>
268
+ <a href="interfaces/UserPreferences.html" data-type="entity-link" >UserPreferences&lt;DASHBOARD &#x3D; any, T &#x3D; any&gt;</a>
262
269
  </li>
263
270
  <li class="link">
264
271
  <a href="interfaces/UserState.html" data-type="entity-link" >UserState</a>
@@ -270,7 +277,7 @@ customElements.define('compodoc-menu', class extends HTMLElement {
270
277
  <a href="interfaces/UxErrorFollowMap.html" data-type="entity-link" >UxErrorFollowMap</a>
271
278
  </li>
272
279
  <li class="link">
273
- <a href="interfaces/UxErrorInfo.html" data-type="entity-link" >UxErrorInfo</a>
280
+ <a href="interfaces/UxErrorInfo.html" data-type="entity-link" >UxErrorInfo&lt;DETAILS &#x3D; unknown&gt;</a>
274
281
  </li>
275
282
  <li class="link">
276
283
  <a href="interfaces/UxErrorMessage.html" data-type="entity-link" >UxErrorMessage</a>
@@ -334,4 +341,4 @@ customElements.define('compodoc-menu', class extends HTMLElement {
334
341
  `);
335
342
  this.innerHTML = tp.strings;
336
343
  }
337
- });
344
+ });
package/docs/js/routes.js CHANGED
@@ -15,6 +15,65 @@ document.addEventListener('DOMContentLoaded', function () {
15
15
  return lazyModuleName;
16
16
  }
17
17
 
18
+ function foundLazyComponentWithPath(path) {
19
+ var split = path.split('#'),
20
+ lazyComponentName = split[1];
21
+ return lazyComponentName;
22
+ }
23
+
24
+ function safeHref(href) {
25
+ return String(href || '').replace(/"/g, '&quot;');
26
+ }
27
+
28
+ function resolveNodeHref(d) {
29
+ if (!d) {
30
+ return '';
31
+ }
32
+
33
+ if (d.href) {
34
+ return d.href;
35
+ }
36
+
37
+ if (d.component && d.component !== 'default') {
38
+ return './components/' + d.component + '.html';
39
+ }
40
+
41
+ if (d.module && d.module !== 'default') {
42
+ return './modules/' + d.module + '.html';
43
+ }
44
+
45
+ if (d.loadComponent) {
46
+ var lazyComponent = foundLazyComponentWithPath(d.loadComponent);
47
+ if (lazyComponent && lazyComponent !== 'default') {
48
+ return './components/' + lazyComponent + '.html';
49
+ }
50
+ }
51
+
52
+ if (d.loadChildren) {
53
+ var lazyModule = foundLazyModuleWithPath(d.loadChildren);
54
+ if (lazyModule && lazyModule !== 'default') {
55
+ return './modules/' + lazyModule + '.html';
56
+ }
57
+ }
58
+
59
+ return '';
60
+ }
61
+
62
+ function wrapLabelWithLink(label, href) {
63
+ if (!href) {
64
+ return label;
65
+ }
66
+ return '<a href="' + safeHref(href) + '" target="_top">' + label + '</a>';
67
+ }
68
+
69
+ function withLeadingSlash(routeValue) {
70
+ var value = String(routeValue || '');
71
+ if (value.length === 0) {
72
+ return '/';
73
+ }
74
+ return value.charAt(0) === '/' ? value : '/' + value;
75
+ }
76
+
18
77
  function getBB(selection) {
19
78
  selection.each(function (d) {
20
79
  d.bbox = this.getBBox();
@@ -26,16 +85,32 @@ document.addEventListener('DOMContentLoaded', function () {
26
85
  var tree = ROUTES_INDEX;
27
86
 
28
87
  function cleanStringChildren(obj) {
88
+ if (!obj || typeof obj !== 'object') {
89
+ return;
90
+ }
29
91
  for (var property in obj) {
30
- if (obj.hasOwnProperty(property)) {
31
- if (property === 'children' && typeof obj[property] === 'object') {
32
- for (var i = obj[property].length - 1; i >= 0; i--) {
33
- if (typeof obj[property][i] === 'string') {
34
- obj[property].splice(i, 1);
92
+ if (Object.prototype.hasOwnProperty.call(obj, property)) {
93
+ if (property === 'children') {
94
+ if (typeof obj[property] === 'string') {
95
+ obj[property] = [];
96
+ continue;
97
+ }
98
+
99
+ if (Array.isArray(obj[property])) {
100
+ for (var i = obj[property].length - 1; i >= 0; i--) {
101
+ if (
102
+ typeof obj[property][i] !== 'object' ||
103
+ obj[property][i] === null
104
+ ) {
105
+ obj[property].splice(i, 1);
106
+ }
35
107
  }
108
+ } else if (obj[property] && typeof obj[property] === 'object') {
109
+ obj[property] = [];
36
110
  }
37
111
  }
38
- if (typeof obj[property] === 'object') {
112
+
113
+ if (obj[property] && typeof obj[property] === 'object') {
39
114
  cleanStringChildren(obj[property]);
40
115
  }
41
116
  }
@@ -84,6 +159,17 @@ document.addEventListener('DOMContentLoaded', function () {
84
159
  dy: 0
85
160
  });
86
161
 
162
+ infos_group
163
+ .style('cursor', function (d) {
164
+ return resolveNodeHref(d) ? 'pointer' : null;
165
+ })
166
+ .on('click', function (d) {
167
+ var href = resolveNodeHref(d);
168
+ if (href) {
169
+ window.location.href = href;
170
+ }
171
+ });
172
+
87
173
  //Node icon
88
174
  infos_group
89
175
  .append('text')
@@ -118,56 +204,66 @@ document.addEventListener('DOMContentLoaded', function () {
118
204
  // if kind === module name + module
119
205
  // if kind === component component + path
120
206
  var _name = '';
207
+ var nodeHref = resolveNodeHref(d);
121
208
  if (d.kind === 'module') {
122
209
  if (d.module) {
123
210
  _name +=
124
- '<tspan x="0" dy="1.4em"><a href="./modules/' +
125
- d.module +
126
- '.html">' +
127
- d.module +
128
- '</a></tspan>';
211
+ '<tspan x="0" dy="1.4em">' +
212
+ wrapLabelWithLink(d.module, nodeHref || './modules/' + d.module + '.html') +
213
+ '</tspan>';
129
214
  if (d.name) {
130
215
  _name += '<tspan x="0" dy="1.4em">' + d.name + '</tspan>';
131
216
  }
132
217
  } else {
133
- _name += '<tspan x="0" dy="1.4em">' + htmlEntities(d.name) + '</tspan>';
218
+ _name +=
219
+ '<tspan x="0" dy="1.4em">' +
220
+ wrapLabelWithLink(htmlEntities(d.name), nodeHref) +
221
+ '</tspan>';
134
222
  }
135
223
  } else if (d.kind === 'component') {
136
- _name += '<tspan x="0" dy="1.4em">' + (d.path || d.name) + '</tspan>';
224
+ _name +=
225
+ '<tspan x="0" dy="1.4em">' +
226
+ wrapLabelWithLink(d.path || d.name, nodeHref) +
227
+ '</tspan>';
137
228
  if (d.component) {
138
- _name +=
139
- '<tspan x="0" dy="1.4em"><a href="./components/' +
140
- d.component +
141
- '.html">' +
142
- d.component +
143
- '</a></tspan>';
144
- } else if (d.name && d.name.includes('Component')) {
145
229
  _name +=
146
230
  '<tspan x="0" dy="1.4em">' +
147
- d.name +
231
+ wrapLabelWithLink(d.component, nodeHref) +
148
232
  '</tspan>';
233
+ } else if (d.name && d.name.includes('Component')) {
234
+ _name += '<tspan x="0" dy="1.4em">' + wrapLabelWithLink(d.name, nodeHref) + '</tspan>';
149
235
  }
150
236
  if (d.outlet) {
151
237
  _name += '<tspan x="0" dy="1.4em">&lt;outlet&gt; : ' + d.outlet + '</tspan>';
152
238
  }
153
239
  } else {
154
- _name += '<tspan x="0" dy="1.4em">/' + (d.path || d.name) + '</tspan>';
240
+ if (d.kind === 'route-redirect') {
241
+ var fromPath = d.path === '' ? "''" : withLeadingSlash(d.path || '');
242
+ var redirectTo = withLeadingSlash(d.redirectTo || d.name);
243
+ _name += '<tspan x="0" dy="1.4em">' + fromPath + ' &rarr; ' + redirectTo + '</tspan>';
244
+ if (d.pathMatch) {
245
+ _name += '<tspan x="0" dy="1.4em">pathMatch: ' + d.pathMatch + '</tspan>';
246
+ }
247
+ } else {
248
+ _name +=
249
+ '<tspan x="0" dy="1.4em">' +
250
+ wrapLabelWithLink(withLeadingSlash(d.path || d.name), nodeHref) +
251
+ '</tspan>';
252
+ }
155
253
  if (d.component) {
156
254
  _name +=
157
- '<tspan x="0" dy="1.4em"><a href="./components/' +
158
- d.component +
159
- '.html">' +
160
- d.component +
161
- '</a></tspan>';
255
+ '<tspan x="0" dy="1.4em">' +
256
+ wrapLabelWithLink(d.component, nodeHref) +
257
+ '</tspan>';
162
258
  }
163
259
  if (d.loadChildren) {
164
260
  var moduleName = foundLazyModuleWithPath(d.loadChildren);
165
- _name +=
166
- '<tspan x="0" dy="1.4em"><a href="./modules/' +
167
- moduleName +
168
- '.html">' +
169
- moduleName +
170
- '</a></tspan>';
261
+ if (moduleName && moduleName !== 'default') {
262
+ _name +=
263
+ '<tspan x="0" dy="1.4em">' +
264
+ wrapLabelWithLink(moduleName, './modules/' + moduleName + '.html') +
265
+ '</tspan>';
266
+ }
171
267
  }
172
268
  if (d.canActivate) {
173
269
  _name += '<tspan x="0" dy="1.4em">&#10003; canActivate</tspan>';
@@ -181,10 +277,10 @@ document.addEventListener('DOMContentLoaded', function () {
181
277
  if (d.canLoad) {
182
278
  _name += '<tspan x="0" dy="1.4em">&#8594; canLoad</tspan>';
183
279
  }
184
- if (d.redirectTo) {
280
+ if (d.kind !== 'route-redirect' && d.redirectTo) {
185
281
  _name += '<tspan x="0" dy="1.4em">&rarr; ' + d.redirectTo + '</tspan>';
186
282
  }
187
- if (d.pathMatch) {
283
+ if (d.kind !== 'route-redirect' && d.pathMatch) {
188
284
  _name += '<tspan x="0" dy="1.4em">&gt; ' + d.pathMatch + '</tspan>';
189
285
  }
190
286
  if (d.outlet) {
@@ -266,11 +362,16 @@ document.addEventListener('DOMContentLoaded', function () {
266
362
 
267
363
  var area_ave = area_sum / nodes.length;
268
364
  var scale = 80 / Math.sqrt(area_ave);
365
+ var depthHorizontalSpacing = 40;
269
366
 
270
367
  function svg_x(node_y) {
271
368
  return node_y - ymin;
272
369
  }
273
370
 
371
+ function projected_x(node) {
372
+ return svg_x(node.y) + (node.depth || 0) * depthHorizontalSpacing;
373
+ }
374
+
274
375
  function svg_y(node_x) {
275
376
  return (node_x - xmin) * scale;
276
377
  }
@@ -279,11 +380,11 @@ document.addEventListener('DOMContentLoaded', function () {
279
380
  var nodebox_vertical_margin = Math.min(y_size_min * scale, 3);
280
381
 
281
382
  node.attr('transform', function (d) {
282
- return 'translate(' + svg_x(d.y) + ',' + svg_y(d.x) + ')';
383
+ return 'translate(' + projected_x(d) + ',' + svg_y(d.x) + ')';
283
384
  });
284
385
 
285
386
  var diagonal = d3.svg.diagonal().projection(function (d) {
286
- return [svg_x(d.y), svg_y(d.x)];
387
+ return [projected_x(d), svg_y(d.x)];
287
388
  });
288
389
 
289
390
  var links = engine.links(nodes);
@@ -8,6 +8,8 @@
8
8
  $searchTitle,
9
9
  $searchResultsCount,
10
10
  $searchQuery,
11
+ $searchInputs,
12
+ $searchClearButtons,
11
13
  $mainContainer,
12
14
  $xsMenu;
13
15
 
@@ -160,12 +162,44 @@
160
162
  $searchInputs.forEach((item, index) => {
161
163
  item.value = '';
162
164
  });
165
+ syncSearchClearButtons();
166
+ });
167
+ }
168
+
169
+ function getSearchInputContainer(element) {
170
+ var current = element;
171
+ while (current && current !== document) {
172
+ if (current.id === 'book-search-input') {
173
+ return current;
174
+ }
175
+ current = current.parentNode;
176
+ }
177
+ return null;
178
+ }
179
+
180
+ function syncSearchClearButtons() {
181
+ if (!$searchInputs || !$searchClearButtons) {
182
+ return;
183
+ }
184
+
185
+ var hasValue = false;
186
+ $searchInputs.forEach((input) => {
187
+ if (input.value && input.value.length > 0) {
188
+ hasValue = true;
189
+ }
190
+ });
191
+
192
+ $searchClearButtons.forEach((button) => {
193
+ button.classList.toggle('is-visible', hasValue);
163
194
  });
164
195
  }
165
196
 
166
197
  function bindSearch() {
167
198
  // Bind DOM
168
199
  $searchInputs = document.querySelectorAll('#book-search-input input');
200
+ $searchClearButtons = document.querySelectorAll(
201
+ '#book-search-input [data-search-input-clear]'
202
+ );
169
203
 
170
204
  $searchResults = document.querySelector('.search-results');
171
205
  $searchList = $searchResults.querySelector('.search-results-list');
@@ -194,11 +228,13 @@
194
228
  // HTML5 (IE9 & others)
195
229
  item.addEventListener('input', function (e) {
196
230
  handleUpdate(this);
231
+ syncSearchClearButtons();
197
232
  });
198
233
  // Workaround for IE < 9
199
234
  item.addEventListener('propertychange', function (e) {
200
235
  if (e.originalEvent.propertyName == 'value') {
201
236
  handleUpdate(this);
237
+ syncSearchClearButtons();
202
238
  }
203
239
  });
204
240
  // Push to history on blur
@@ -212,6 +248,31 @@
212
248
  }
213
249
  });
214
250
  });
251
+
252
+ $searchClearButtons.forEach((button) => {
253
+ button.addEventListener('click', function (e) {
254
+ e.preventDefault();
255
+
256
+ var container = getSearchInputContainer(this);
257
+ var containerInput = container ? container.querySelector('input') : null;
258
+ var nextValue = '';
259
+
260
+ $searchInputs.forEach((input) => {
261
+ input.value = nextValue;
262
+ });
263
+
264
+ if (containerInput) {
265
+ handleUpdate(containerInput);
266
+ containerInput.focus();
267
+ } else if ($searchInputs.length > 0) {
268
+ handleUpdate($searchInputs[0]);
269
+ }
270
+
271
+ syncSearchClearButtons();
272
+ });
273
+ });
274
+
275
+ syncSearchClearButtons();
215
276
  }
216
277
 
217
278
  function launchSearchFromQueryString() {
@@ -221,6 +282,7 @@
221
282
  $searchInputs.forEach((item, index) => {
222
283
  item.value = q;
223
284
  });
285
+ syncSearchClearButtons();
224
286
  // Launch search
225
287
  launchSearch(q);
226
288
  }