@eui/core 17.0.0-next.9 → 17.0.0-rc.2
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/assets/i18n-eui/bg.json +1 -0
- package/assets/i18n-eui/cs.json +1 -0
- package/assets/i18n-eui/da.json +1 -0
- package/assets/i18n-eui/de.json +1 -0
- package/assets/i18n-eui/el.json +1 -0
- package/assets/i18n-eui/en.json +1 -0
- package/assets/i18n-eui/es.json +1 -0
- package/assets/i18n-eui/et.json +1 -0
- package/assets/i18n-eui/fi.json +1 -0
- package/assets/i18n-eui/fr.json +1 -0
- package/assets/i18n-eui/ga.json +1 -0
- package/assets/i18n-eui/hr.json +1 -0
- package/assets/i18n-eui/hu.json +1 -1
- package/assets/i18n-eui/it.json +1 -0
- package/assets/i18n-eui/lt.json +1 -1
- package/assets/i18n-eui/lv.json +1 -0
- package/assets/i18n-eui/mt.json +1 -0
- package/assets/i18n-eui/nl.json +1 -0
- package/assets/i18n-eui/pl.json +1 -0
- package/assets/i18n-eui/pt.json +1 -0
- package/assets/i18n-eui/ro.json +1 -1
- package/assets/i18n-eui/sk.json +1 -0
- package/assets/i18n-eui/sl.json +1 -0
- package/assets/i18n-eui/sv.json +1 -0
- package/docs/classes/ActivatedRouteAction.html +282 -0
- package/docs/classes/AddApiQueueItemAction.html +282 -0
- package/docs/classes/AddAppLoadedConfigModulesAction.html +282 -0
- package/docs/classes/ApiQueueServiceMock.html +545 -0
- package/docs/classes/AsyncStorageService.html +923 -0
- package/docs/classes/AsyncStorageServiceMock.html +427 -0
- package/docs/classes/EmptyApiQueueAction.html +282 -0
- package/docs/classes/ErrorSubClass.html +357 -0
- package/docs/classes/EuiCoreRootGuardClass.html +167 -0
- package/docs/classes/EuiError.html +363 -0
- package/docs/classes/I18nResourceImpl.html +506 -0
- package/docs/classes/InitStoreAction.html +282 -0
- package/docs/classes/LogServiceMock.html +223 -0
- package/docs/classes/OpenIdConnectServiceMock.html +223 -0
- package/docs/classes/RemoveApiQueueItemAction.html +282 -0
- package/docs/classes/RouterMock.html +482 -0
- package/docs/classes/StorageService.html +630 -0
- package/docs/classes/StorageServiceMock.html +316 -0
- package/docs/classes/StoreMock.html +391 -0
- package/docs/classes/TranslateServiceMock.html +907 -0
- package/docs/classes/UpdateAppConnectionAction.html +282 -0
- package/docs/classes/UpdateAppStatusAction.html +282 -0
- package/docs/classes/UpdateAppVersionAction.html +282 -0
- package/docs/classes/UpdateCurrentModuleAction.html +282 -0
- package/docs/classes/UpdateI18nStateAction.html +282 -0
- package/docs/classes/UpdateLocaleStateAction.html +282 -0
- package/docs/classes/UpdateNotificationsListAction.html +282 -0
- package/docs/classes/UpdateUserDashboardAction.html +282 -0
- package/docs/classes/UpdateUserDetailsAction.html +282 -0
- package/docs/classes/UpdateUserPreferencesAction.html +282 -0
- package/docs/classes/UpdateUserRightsAction.html +282 -0
- package/docs/classes/UpdateUserStateAction.html +282 -0
- package/docs/dependencies.html +323 -0
- package/docs/directives/TranslateMockDirective.html +266 -0
- package/docs/fonts/ionicons.eot +0 -0
- package/docs/fonts/ionicons.svg +2090 -0
- package/docs/fonts/ionicons.ttf +0 -0
- package/docs/fonts/ionicons.woff +0 -0
- package/docs/fonts/ionicons.woff2 +0 -0
- package/docs/fonts/roboto-v15-latin-300.eot +0 -0
- package/docs/fonts/roboto-v15-latin-300.svg +314 -0
- package/docs/fonts/roboto-v15-latin-300.ttf +0 -0
- package/docs/fonts/roboto-v15-latin-300.woff +0 -0
- package/docs/fonts/roboto-v15-latin-300.woff2 +0 -0
- package/docs/fonts/roboto-v15-latin-700.eot +0 -0
- package/docs/fonts/roboto-v15-latin-700.svg +310 -0
- package/docs/fonts/roboto-v15-latin-700.ttf +0 -0
- package/docs/fonts/roboto-v15-latin-700.woff +0 -0
- package/docs/fonts/roboto-v15-latin-700.woff2 +0 -0
- package/docs/fonts/roboto-v15-latin-italic.eot +0 -0
- package/docs/fonts/roboto-v15-latin-italic.svg +323 -0
- package/docs/fonts/roboto-v15-latin-italic.ttf +0 -0
- package/docs/fonts/roboto-v15-latin-italic.woff +0 -0
- package/docs/fonts/roboto-v15-latin-italic.woff2 +0 -0
- package/docs/fonts/roboto-v15-latin-regular.eot +0 -0
- package/docs/fonts/roboto-v15-latin-regular.svg +308 -0
- package/docs/fonts/roboto-v15-latin-regular.ttf +0 -0
- package/docs/fonts/roboto-v15-latin-regular.woff +0 -0
- package/docs/fonts/roboto-v15-latin-regular.woff2 +0 -0
- package/docs/images/compodoc-vectorise-inverted.png +0 -0
- package/docs/images/compodoc-vectorise-inverted.svg +201 -0
- package/docs/images/compodoc-vectorise.png +0 -0
- package/docs/images/compodoc-vectorise.svg +201 -0
- package/docs/images/favicon.ico +0 -0
- package/docs/index.html +171 -0
- package/docs/injectables/ApiQueueService.html +784 -0
- package/docs/injectables/CoreAppEffects.html +390 -0
- package/docs/injectables/EuiAppShellService.html +2822 -0
- package/docs/injectables/EuiDynamicComponentService.html +433 -0
- package/docs/injectables/EuiDynamicMenuService.html +377 -0
- package/docs/injectables/EuiGrowlService.html +821 -0
- package/docs/injectables/EuiPermissionService.html +642 -0
- package/docs/injectables/EuiTimezoneService.html +378 -0
- package/docs/injectables/GlobalErrorHandler.html +291 -0
- package/docs/injectables/I18nLoader.html +589 -0
- package/docs/injectables/I18nService.html +991 -0
- package/docs/injectables/I18nServiceMock.html +626 -0
- package/docs/injectables/LocalForageService.html +761 -0
- package/docs/injectables/LocalStorageService.html +548 -0
- package/docs/injectables/LocaleService.html +753 -0
- package/docs/injectables/LocaleServiceMock.html +453 -0
- package/docs/injectables/LogService.html +351 -0
- package/docs/injectables/OpenIdConnectService.html +225 -0
- package/docs/injectables/SessionStorageService.html +548 -0
- package/docs/injectables/StoreService.html +641 -0
- package/docs/injectables/StoreServiceMock.html +455 -0
- package/docs/injectables/UserService.html +738 -0
- package/docs/injectables/UserServiceMock.html +708 -0
- package/docs/interceptors/AddLangParamInterceptor.html +311 -0
- package/docs/interceptors/CachePreventionInterceptor.html +260 -0
- package/docs/interceptors/CorsSecurityInterceptor.html +260 -0
- package/docs/interceptors/CsrfPreventionInterceptor.html +260 -0
- package/docs/interceptors/EuLoginSessionTimeoutHandlingInterceptor.html +260 -0
- package/docs/interceptors/HttpErrorHandlerInterceptor.html +319 -0
- package/docs/interceptors/OpenIdConnectInterceptor.html +345 -0
- package/docs/interceptors/UxRequestErrorModelInterceptor.html +295 -0
- package/docs/interfaces/EuiTimeZone.html +247 -0
- package/docs/interfaces/LoadedResources.html +292 -0
- package/docs/interfaces/LoadedResourcesError.html +247 -0
- package/docs/interfaces/ModuleLoadEvent.html +292 -0
- package/docs/interfaces/OpenIdConnectUserDetails.html +439 -0
- package/docs/interfaces/ResourceError.html +298 -0
- package/docs/interfaces/UIState.html +1810 -0
- package/docs/js/compodoc.js +14 -0
- package/docs/js/lazy-load-graphs.js +44 -0
- package/docs/js/libs/EventDispatcher.js +5 -0
- package/docs/js/libs/bootstrap-native.js +1 -0
- package/docs/js/libs/clipboard.min.js +7 -0
- package/docs/js/libs/custom-elements-es5-adapter.js +15 -0
- package/docs/js/libs/custom-elements.min.js +38 -0
- package/docs/js/libs/d3.v3.min.js +2 -0
- package/docs/js/libs/deep-iterator.js +2 -0
- package/docs/js/libs/es6-shim.min.js +11 -0
- package/docs/js/libs/htmlparser.js +23 -0
- package/docs/js/libs/innersvg.js +9 -0
- package/docs/js/libs/lit-html.js +1 -0
- package/docs/js/libs/prism.js +46 -0
- package/docs/js/libs/promise.min.js +6 -0
- package/docs/js/libs/svg-pan-zoom.min.js +3 -0
- package/docs/js/libs/tablesort.min.js +6 -0
- package/docs/js/libs/tablesort.number.min.js +6 -0
- package/docs/js/libs/vis.min.js +47 -0
- package/docs/js/libs/zepto.min.js +2 -0
- package/docs/js/menu-wc.js +377 -0
- package/docs/js/menu-wc_es5.js +42 -0
- package/docs/js/menu.js +325 -0
- package/docs/js/routes.js +301 -0
- package/docs/js/search/lunr.min.js +6 -0
- package/docs/js/search/search-lunr.js +67 -0
- package/docs/js/search/search.js +268 -0
- package/docs/js/search/search_index.js +4 -0
- package/docs/js/sourceCode.js +58 -0
- package/docs/js/svg-pan-zoom.controls.js +53 -0
- package/docs/js/tabs.js +21 -0
- package/docs/js/tree.js +147 -0
- package/docs/license.html +379 -0
- package/docs/miscellaneous/enumerations.html +418 -0
- package/docs/miscellaneous/functions.html +1796 -0
- package/docs/miscellaneous/typealiases.html +258 -0
- package/docs/miscellaneous/variables.html +3967 -0
- package/docs/modules/CoreModule.html +254 -0
- package/docs/modules/I18nModule.html +198 -0
- package/docs/modules/LogModule.html +301 -0
- package/docs/modules/TranslateMockModule.html +176 -0
- package/docs/modules.html +168 -0
- package/docs/pipes/TranslateMockPipe.html +225 -0
- package/docs/properties.html +124 -0
- package/docs/styles/bootstrap-card.css +219 -0
- package/docs/styles/bootstrap.min.css +6 -0
- package/docs/styles/compodoc.css +1121 -0
- package/docs/styles/dark.css +121 -0
- package/docs/styles/ionicons.min.css +11 -0
- package/docs/styles/laravel.css +113 -0
- package/docs/styles/material.css +131 -0
- package/docs/styles/original.css +51 -0
- package/docs/styles/postmark.css +238 -0
- package/docs/styles/prism.css +301 -0
- package/docs/styles/readthedocs.css +117 -0
- package/docs/styles/reset.css +129 -0
- package/docs/styles/stripe.css +106 -0
- package/docs/styles/style.css +7 -0
- package/docs/styles/tablesort.css +33 -0
- package/docs/styles/vagrant.css +130 -0
- package/esm2022/lib/eui-core.module.mjs +7 -7
- package/esm2022/lib/helpers/date-helpers.mjs +1 -1
- package/esm2022/lib/helpers/dom-helpers.mjs +10 -8
- package/esm2022/lib/helpers/event-helpers.mjs +1 -1
- package/esm2022/lib/helpers/form-helpers.mjs +1 -1
- package/esm2022/lib/helpers/format-helpers.mjs +6 -5
- package/esm2022/lib/helpers/http-helpers.mjs +3 -5
- package/esm2022/lib/interceptors/add-lang-param.interceptor.mjs +4 -4
- package/esm2022/lib/interceptors/cache-prevention.interceptor.mjs +4 -4
- package/esm2022/lib/interceptors/cors-security.interceptor.mjs +4 -4
- package/esm2022/lib/interceptors/csrf-prevention.interceptor.mjs +4 -4
- package/esm2022/lib/interceptors/eu-login-session-timeout-handling.interceptor.mjs +13 -6
- package/esm2022/lib/interceptors/openid/openid-connect.interceptor.mjs +37 -8
- package/esm2022/lib/interceptors/openid/openid-connect.service.mjs +6 -4
- package/esm2022/lib/interceptors/ux-request-error-model.interceptor.mjs +10 -5
- package/esm2022/lib/services/app/eui-init-app.mjs +2 -2
- package/esm2022/lib/services/app/eui-pre-init-app.mjs +1 -1
- package/esm2022/lib/services/app/factories/log.mjs +1 -1
- package/esm2022/lib/services/config/tokens.mjs +3 -1
- package/esm2022/lib/services/dynamic-component/dynamic-component.service.mjs +9 -4
- package/esm2022/lib/services/dynamic-menu/dynamic-menu.service.mjs +8 -5
- package/esm2022/lib/services/errors/eui.error.mjs +5 -1
- package/esm2022/lib/services/errors/global-error-handler.mjs +7 -5
- package/esm2022/lib/services/errors/http-error-handler-callback-functions.mjs +2 -2
- package/esm2022/lib/services/errors/http-error-handler.interceptor.mjs +24 -17
- package/esm2022/lib/services/eui-app-shell.service.mjs +123 -15
- package/esm2022/lib/services/eui-timezone.service.mjs +4 -4
- package/esm2022/lib/services/growl/eui-growl.service.mjs +4 -4
- package/esm2022/lib/services/i18n/i18n.loader.mjs +16 -5
- package/esm2022/lib/services/i18n/i18n.resource.mjs +8 -3
- package/esm2022/lib/services/i18n/i18n.service.mjs +17 -19
- package/esm2022/lib/services/i18n/index.mjs +2 -2
- package/esm2022/lib/services/locale/locale.service.mjs +7 -5
- package/esm2022/lib/services/locale/locale.service.mock.mjs +4 -4
- package/esm2022/lib/services/log/log.module.mjs +5 -5
- package/esm2022/lib/services/log/log.service.mjs +4 -4
- package/esm2022/lib/services/log/log.service.mock.mjs +1 -1
- package/esm2022/lib/services/permission/permission.service.mjs +5 -5
- package/esm2022/lib/services/queue/api-queue.service.mjs +20 -8
- package/esm2022/lib/services/queue/api-queue.service.mock.mjs +5 -1
- package/esm2022/lib/services/storage/async-storage.service.mjs +1 -1
- package/esm2022/lib/services/storage/async-storage.service.mock.mjs +9 -1
- package/esm2022/lib/services/storage/local-forage.service.mjs +43 -18
- package/esm2022/lib/services/storage/local-storage.service.mjs +8 -4
- package/esm2022/lib/services/storage/session-storage.service.mjs +8 -4
- package/esm2022/lib/services/storage/storage.service.mjs +1 -1
- package/esm2022/lib/services/storage/storage.service.mock.mjs +1 -1
- package/esm2022/lib/services/store/actions/app.actions.mjs +3 -1
- package/esm2022/lib/services/store/actions/notifications.actions.mjs +3 -1
- package/esm2022/lib/services/store/actions/user.actions.mjs +3 -1
- package/esm2022/lib/services/store/effects/app.effects.mjs +4 -4
- package/esm2022/lib/services/store/reducers/app.reducers.mjs +2 -3
- package/esm2022/lib/services/store/reducers/core.reducers.mjs +3 -1
- package/esm2022/lib/services/store/reducers/i18n.reducers.mjs +2 -2
- package/esm2022/lib/services/store/reducers/locale.reducers.mjs +1 -1
- package/esm2022/lib/services/store/reducers/meta.reducers.mjs +4 -2
- package/esm2022/lib/services/store/reducers/notifications.reducers.mjs +2 -2
- package/esm2022/lib/services/store/reducers/user.reducers.mjs +2 -2
- package/esm2022/lib/services/store/store.service.mjs +14 -6
- package/esm2022/lib/services/store/store.service.mock.mjs +4 -4
- package/esm2022/lib/services/user/user.service.mjs +13 -7
- package/esm2022/lib/services/user/user.service.mock.mjs +11 -17
- package/fesm2022/eui-core.mjs +825 -591
- package/fesm2022/eui-core.mjs.map +1 -1
- package/lib/eui-core.module.d.ts +1 -1
- package/lib/eui-core.module.d.ts.map +1 -1
- package/lib/helpers/date-helpers.d.ts.map +1 -1
- package/lib/helpers/dom-helpers.d.ts +9 -7
- package/lib/helpers/dom-helpers.d.ts.map +1 -1
- package/lib/helpers/event-helpers.d.ts.map +1 -1
- package/lib/helpers/form-helpers.d.ts.map +1 -1
- package/lib/helpers/format-helpers.d.ts.map +1 -1
- package/lib/helpers/http-helpers.d.ts +2 -1
- package/lib/helpers/http-helpers.d.ts.map +1 -1
- package/lib/interceptors/add-lang-param.interceptor.d.ts +1 -1
- package/lib/interceptors/add-lang-param.interceptor.d.ts.map +1 -1
- package/lib/interceptors/cache-prevention.interceptor.d.ts +1 -1
- package/lib/interceptors/cache-prevention.interceptor.d.ts.map +1 -1
- package/lib/interceptors/cors-security.interceptor.d.ts +1 -1
- package/lib/interceptors/cors-security.interceptor.d.ts.map +1 -1
- package/lib/interceptors/csrf-prevention.interceptor.d.ts +1 -1
- package/lib/interceptors/csrf-prevention.interceptor.d.ts.map +1 -1
- package/lib/interceptors/eu-login-session-timeout-handling.interceptor.d.ts +1 -1
- package/lib/interceptors/eu-login-session-timeout-handling.interceptor.d.ts.map +1 -1
- package/lib/interceptors/openid/openid-connect.interceptor.d.ts.map +1 -1
- package/lib/interceptors/openid/openid-connect.service.d.ts.map +1 -1
- package/lib/interceptors/ux-request-error-model.interceptor.d.ts.map +1 -1
- package/lib/services/app/eui-init-app.d.ts +1 -1
- package/lib/services/app/eui-init-app.d.ts.map +1 -1
- package/lib/services/config/tokens.d.ts +2 -2
- package/lib/services/config/tokens.d.ts.map +1 -1
- package/lib/services/dynamic-component/dynamic-component.service.d.ts +3 -7
- package/lib/services/dynamic-component/dynamic-component.service.d.ts.map +1 -1
- package/lib/services/dynamic-menu/dynamic-menu.service.d.ts +6 -6
- package/lib/services/dynamic-menu/dynamic-menu.service.d.ts.map +1 -1
- package/lib/services/errors/eui.error.d.ts.map +1 -1
- package/lib/services/errors/global-error-handler.d.ts +1 -1
- package/lib/services/errors/global-error-handler.d.ts.map +1 -1
- package/lib/services/errors/http-error-handler-callback-functions.d.ts.map +1 -1
- package/lib/services/errors/http-error-handler.interceptor.d.ts.map +1 -1
- package/lib/services/eui-app-shell.service.d.ts +39 -10
- package/lib/services/eui-app-shell.service.d.ts.map +1 -1
- package/lib/services/i18n/i18n.loader.d.ts.map +1 -1
- package/lib/services/i18n/i18n.resource.d.ts +1 -1
- package/lib/services/i18n/i18n.resource.d.ts.map +1 -1
- package/lib/services/i18n/i18n.service.d.ts +4 -4
- package/lib/services/i18n/i18n.service.d.ts.map +1 -1
- package/lib/services/i18n/index.d.ts +0 -1
- package/lib/services/i18n/index.d.ts.map +1 -1
- package/lib/services/locale/locale.service.d.ts.map +1 -1
- package/lib/services/log/log.service.d.ts.map +1 -1
- package/lib/services/log/log.service.mock.d.ts.map +1 -1
- package/lib/services/permission/permission.service.d.ts.map +1 -1
- package/lib/services/queue/api-queue.service.d.ts +2 -2
- package/lib/services/queue/api-queue.service.d.ts.map +1 -1
- package/lib/services/queue/api-queue.service.mock.d.ts.map +1 -1
- package/lib/services/storage/async-storage.service.d.ts.map +1 -1
- package/lib/services/storage/async-storage.service.mock.d.ts.map +1 -1
- package/lib/services/storage/local-forage.service.d.ts +1 -1
- package/lib/services/storage/local-forage.service.d.ts.map +1 -1
- package/lib/services/storage/local-storage.service.d.ts.map +1 -1
- package/lib/services/storage/session-storage.service.d.ts.map +1 -1
- package/lib/services/storage/storage.service.d.ts.map +1 -1
- package/lib/services/storage/storage.service.mock.d.ts +1 -1
- package/lib/services/storage/storage.service.mock.d.ts.map +1 -1
- package/lib/services/store/actions/app.actions.d.ts.map +1 -1
- package/lib/services/store/actions/notifications.actions.d.ts.map +1 -1
- package/lib/services/store/actions/user.actions.d.ts.map +1 -1
- package/lib/services/store/reducers/app.reducers.d.ts.map +1 -1
- package/lib/services/store/reducers/core.reducers.d.ts.map +1 -1
- package/lib/services/store/reducers/meta.reducers.d.ts +2 -2
- package/lib/services/store/reducers/meta.reducers.d.ts.map +1 -1
- package/lib/services/store/reducers/user.reducers.d.ts.map +1 -1
- package/lib/services/store/store.service.d.ts +8 -8
- package/lib/services/store/store.service.d.ts.map +1 -1
- package/lib/services/store/store.service.mock.d.ts +2 -1
- package/lib/services/store/store.service.mock.d.ts.map +1 -1
- package/lib/services/user/user.service.d.ts +3 -3
- package/lib/services/user/user.service.d.ts.map +1 -1
- package/lib/services/user/user.service.mock.d.ts +10 -12
- package/lib/services/user/user.service.mock.d.ts.map +1 -1
- package/package.json +2 -2
- package/esm2022/lib/services/i18n/i18n.service.mock.mjs +0 -38
- package/lib/services/i18n/i18n.service.mock.d.ts +0 -20
- package/lib/services/i18n/i18n.service.mock.d.ts.map +0 -1
package/docs/js/menu.js
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
document.addEventListener('DOMContentLoaded', function () {
|
|
2
|
+
var menuCollapsed = false,
|
|
3
|
+
mobileMenu = document.getElementById('mobile-menu');
|
|
4
|
+
|
|
5
|
+
var localContextInUrl = '';
|
|
6
|
+
|
|
7
|
+
if (COMPODOC_CURRENT_PAGE_CONTEXT !== '') {
|
|
8
|
+
switch (COMPODOC_CURRENT_PAGE_CONTEXT) {
|
|
9
|
+
case 'additional-page':
|
|
10
|
+
localContextInUrl = 'additional-documentation';
|
|
11
|
+
break;
|
|
12
|
+
case 'class':
|
|
13
|
+
localContextInUrl = 'classes';
|
|
14
|
+
break;
|
|
15
|
+
case 'miscellaneous-functions':
|
|
16
|
+
case 'miscellaneous-variables':
|
|
17
|
+
case 'miscellaneous-typealiases':
|
|
18
|
+
case 'miscellaneous-enumerations':
|
|
19
|
+
localContextInUrl = 'miscellaneous';
|
|
20
|
+
default:
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function hasClass(el, cls) {
|
|
26
|
+
return el.className && new RegExp('(\\s|^)' + cls + '(\\s|$)').test(el.className);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var processLink = function (link, url) {
|
|
30
|
+
if (url.charAt(0) !== '.') {
|
|
31
|
+
var prefix = '';
|
|
32
|
+
switch (COMPODOC_CURRENT_PAGE_DEPTH) {
|
|
33
|
+
case 5:
|
|
34
|
+
prefix = '../../../../../';
|
|
35
|
+
break;
|
|
36
|
+
case 4:
|
|
37
|
+
prefix = '../../../../';
|
|
38
|
+
break;
|
|
39
|
+
case 3:
|
|
40
|
+
prefix = '../../../';
|
|
41
|
+
break;
|
|
42
|
+
case 2:
|
|
43
|
+
prefix = '../../';
|
|
44
|
+
break;
|
|
45
|
+
case 1:
|
|
46
|
+
prefix = '../';
|
|
47
|
+
break;
|
|
48
|
+
case 0:
|
|
49
|
+
prefix = './';
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
link.setAttribute('href', prefix + url);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
var processMenuLinks = function (links, dontAddClass) {
|
|
57
|
+
for (var i = 0; i < links.length; i++) {
|
|
58
|
+
var link = links[i];
|
|
59
|
+
var linkHref = link.getAttribute('href');
|
|
60
|
+
if (linkHref) {
|
|
61
|
+
var linkHrefFile = linkHref.substr(linkHref.lastIndexOf('/') + 1, linkHref.length);
|
|
62
|
+
if (
|
|
63
|
+
linkHrefFile.toLowerCase() === COMPODOC_CURRENT_PAGE_URL.toLowerCase() &&
|
|
64
|
+
link.innerHTML.indexOf('Getting started') == -1 &&
|
|
65
|
+
!dontAddClass &&
|
|
66
|
+
linkHref.toLowerCase().indexOf(localContextInUrl.toLowerCase()) !== -1
|
|
67
|
+
) {
|
|
68
|
+
link.classList.add('active');
|
|
69
|
+
}
|
|
70
|
+
processLink(link, linkHref);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var chapterLinks = document.querySelectorAll('[data-type="chapter-link"]');
|
|
75
|
+
processMenuLinks(chapterLinks);
|
|
76
|
+
var entityLinks = document.querySelectorAll('[data-type="entity-link"]');
|
|
77
|
+
processMenuLinks(entityLinks);
|
|
78
|
+
var indexLinks = document.querySelectorAll('[data-type="index-link"]');
|
|
79
|
+
processMenuLinks(indexLinks, true);
|
|
80
|
+
var compodocLogos = document.querySelectorAll('[data-type="compodoc-logo"]');
|
|
81
|
+
var customLogo = document.querySelectorAll('[data-type="custom-logo"]');
|
|
82
|
+
var processLogos = function (entityLogos) {
|
|
83
|
+
for (var i = 0; i < entityLogos.length; i++) {
|
|
84
|
+
var entityLogo = entityLogos[i];
|
|
85
|
+
if (entityLogo) {
|
|
86
|
+
var url = entityLogo.getAttribute('data-src');
|
|
87
|
+
// Dark mode + logo
|
|
88
|
+
let isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
89
|
+
if (isDarkMode && url.indexOf('compodoc') !== -1) {
|
|
90
|
+
url = 'images/compodoc-vectorise-inverted.png';
|
|
91
|
+
}
|
|
92
|
+
if (url.charAt(0) !== '.') {
|
|
93
|
+
var prefix = '';
|
|
94
|
+
switch (COMPODOC_CURRENT_PAGE_DEPTH) {
|
|
95
|
+
case 5:
|
|
96
|
+
prefix = '../../../../../';
|
|
97
|
+
break;
|
|
98
|
+
case 4:
|
|
99
|
+
prefix = '../../../../';
|
|
100
|
+
break;
|
|
101
|
+
case 3:
|
|
102
|
+
prefix = '../../../';
|
|
103
|
+
break;
|
|
104
|
+
case 2:
|
|
105
|
+
prefix = '../../';
|
|
106
|
+
break;
|
|
107
|
+
case 1:
|
|
108
|
+
prefix = '../';
|
|
109
|
+
break;
|
|
110
|
+
case 0:
|
|
111
|
+
prefix = './';
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
entityLogo.src = prefix + url;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
processLogos(compodocLogos);
|
|
120
|
+
processLogos(customLogo);
|
|
121
|
+
|
|
122
|
+
setTimeout(function () {
|
|
123
|
+
document.getElementById('btn-menu').addEventListener('click', function () {
|
|
124
|
+
if (menuCollapsed) {
|
|
125
|
+
mobileMenu.style.display = 'none';
|
|
126
|
+
} else {
|
|
127
|
+
mobileMenu.style.display = 'block';
|
|
128
|
+
document.getElementsByTagName('body')[0].style['overflow-y'] = 'hidden';
|
|
129
|
+
}
|
|
130
|
+
menuCollapsed = !menuCollapsed;
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Native bootstrap doesn't wait DOMContentLoaded event to start his job, re do it here
|
|
135
|
+
*/
|
|
136
|
+
var Collapses = document.querySelectorAll('[data-bs-toggle="collapse"]');
|
|
137
|
+
for (var o = 0, cll = Collapses.length; o < cll; o++) {
|
|
138
|
+
var collapse = Collapses[o],
|
|
139
|
+
options = {};
|
|
140
|
+
options.duration = collapse.getAttribute('data-duration');
|
|
141
|
+
const targetId = collapse.getAttribute('data-bs-target');
|
|
142
|
+
if (targetId !== '') {
|
|
143
|
+
options.parent = collapse;
|
|
144
|
+
const c = new BSN.Collapse(targetId, options);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// collapse menu
|
|
149
|
+
var classnameMenuToggler = document.getElementsByClassName('menu-toggler'),
|
|
150
|
+
faAngleUpClass = 'ion-ios-arrow-up',
|
|
151
|
+
faAngleDownClass = 'ion-ios-arrow-down',
|
|
152
|
+
toggleItemMenu = function (e) {
|
|
153
|
+
var element = $(e.target),
|
|
154
|
+
parent = element[0].parentNode,
|
|
155
|
+
parentLink,
|
|
156
|
+
elementIconChild;
|
|
157
|
+
if (parent) {
|
|
158
|
+
if (!$(parent).hasClass('linked')) {
|
|
159
|
+
e.preventDefault();
|
|
160
|
+
} else {
|
|
161
|
+
parentLink = parent.parentNode;
|
|
162
|
+
if (parentLink && element.hasClass('link-name')) {
|
|
163
|
+
$(parentLink).trigger('click');
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
elementIconChild = parent.getElementsByClassName(faAngleUpClass)[0];
|
|
167
|
+
if (!elementIconChild) {
|
|
168
|
+
elementIconChild = parent.getElementsByClassName(faAngleDownClass)[0];
|
|
169
|
+
}
|
|
170
|
+
if (elementIconChild) {
|
|
171
|
+
elementIconChild = $(elementIconChild);
|
|
172
|
+
if (elementIconChild.hasClass(faAngleUpClass)) {
|
|
173
|
+
elementIconChild.addClass(faAngleDownClass);
|
|
174
|
+
elementIconChild.removeClass(faAngleUpClass);
|
|
175
|
+
} else {
|
|
176
|
+
elementIconChild.addClass(faAngleUpClass);
|
|
177
|
+
elementIconChild.removeClass(faAngleDownClass);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
for (var i = 0; i < classnameMenuToggler.length; i++) {
|
|
184
|
+
classnameMenuToggler[i].addEventListener('click', toggleItemMenu, false);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Scroll to active link
|
|
188
|
+
var menus = document.querySelectorAll('.menu'),
|
|
189
|
+
i = 0,
|
|
190
|
+
len = menus.length,
|
|
191
|
+
activeMenu,
|
|
192
|
+
activeMenuClass,
|
|
193
|
+
activeLink;
|
|
194
|
+
|
|
195
|
+
for (i; i < len; i++) {
|
|
196
|
+
if (getComputedStyle(menus[i]).display != 'none') {
|
|
197
|
+
activeMenu = menus[i];
|
|
198
|
+
activeMenuClass = activeMenu.getAttribute('class').split(' ')[0];
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (activeMenu) {
|
|
203
|
+
activeLink = document.querySelector('.' + activeMenuClass + ' .active');
|
|
204
|
+
if (activeLink) {
|
|
205
|
+
var linkType = activeLink.getAttribute('data-type');
|
|
206
|
+
var linkContext = activeLink.getAttribute('data-context');
|
|
207
|
+
if (linkType === 'entity-link') {
|
|
208
|
+
var parentLi = activeLink.parentNode,
|
|
209
|
+
parentUl,
|
|
210
|
+
parentChapterMenu;
|
|
211
|
+
if (parentLi) {
|
|
212
|
+
parentUl = parentLi.parentNode;
|
|
213
|
+
if (parentUl) {
|
|
214
|
+
parentChapterMenu = parentUl.parentNode;
|
|
215
|
+
if (parentChapterMenu) {
|
|
216
|
+
var toggler = parentChapterMenu.querySelector('.menu-toggler'),
|
|
217
|
+
elementIconChild =
|
|
218
|
+
toggler.getElementsByClassName(faAngleUpClass)[0];
|
|
219
|
+
if (toggler && !elementIconChild) {
|
|
220
|
+
toggler.click();
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (linkContext && linkContext === 'sub-entity') {
|
|
226
|
+
// Toggle also the master parent menu
|
|
227
|
+
var linkContextId = activeLink.getAttribute('data-context-id');
|
|
228
|
+
var toggler = activeMenu.querySelector(
|
|
229
|
+
'.chapter.' + linkContextId + ' a .menu-toggler'
|
|
230
|
+
);
|
|
231
|
+
if (toggler) {
|
|
232
|
+
toggler.click();
|
|
233
|
+
}
|
|
234
|
+
if (linkContextId === 'additional') {
|
|
235
|
+
var mainToggler = activeMenu.querySelector(
|
|
236
|
+
'.chapter.' + linkContextId + ' div.menu-toggler'
|
|
237
|
+
);
|
|
238
|
+
if (mainToggler) {
|
|
239
|
+
mainToggler.click();
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
} else if (linkType === 'chapter-link') {
|
|
244
|
+
var linkContextId = activeLink.getAttribute('data-context-id');
|
|
245
|
+
var toggler = activeLink.querySelector('.menu-toggler');
|
|
246
|
+
if (toggler) {
|
|
247
|
+
toggler.click();
|
|
248
|
+
}
|
|
249
|
+
if (linkContextId === 'additional') {
|
|
250
|
+
var mainToggler = activeMenu.querySelector(
|
|
251
|
+
'.chapter.' + linkContextId + ' div.menu-toggler'
|
|
252
|
+
);
|
|
253
|
+
if (mainToggler) {
|
|
254
|
+
mainToggler.click();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
setTimeout(function () {
|
|
259
|
+
activeMenu.scrollTop = activeLink.offsetTop;
|
|
260
|
+
if (
|
|
261
|
+
activeLink.innerHTML.toLowerCase().indexOf('readme') != -1 ||
|
|
262
|
+
activeLink.innerHTML.toLowerCase().indexOf('overview') != -1
|
|
263
|
+
) {
|
|
264
|
+
activeMenu.scrollTop = 0;
|
|
265
|
+
}
|
|
266
|
+
}, 300);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
// Dark mode toggle button
|
|
270
|
+
var useDark = window.matchMedia('(prefers-color-scheme: dark)');
|
|
271
|
+
var darkModeState = useDark.matches;
|
|
272
|
+
var $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
|
|
273
|
+
var $darkModeToggles = document.querySelectorAll('.dark-mode-switch');
|
|
274
|
+
var darkModeStateLocal = localStorage.getItem('compodoc_darkmode-state');
|
|
275
|
+
|
|
276
|
+
function checkToggle(check) {
|
|
277
|
+
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
278
|
+
$darkModeToggleSwitchers[i].checked = check;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function toggleDarkMode(state) {
|
|
283
|
+
if (window.localStorage) {
|
|
284
|
+
localStorage.setItem('compodoc_darkmode-state', state);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
checkToggle(state);
|
|
288
|
+
|
|
289
|
+
const hasClass = document.body.classList.contains('dark');
|
|
290
|
+
|
|
291
|
+
if (state) {
|
|
292
|
+
for (var i = 0; i < $darkModeToggles.length; i++) {
|
|
293
|
+
$darkModeToggles[i].classList.add('dark');
|
|
294
|
+
}
|
|
295
|
+
if (!hasClass) {
|
|
296
|
+
document.body.classList.add('dark');
|
|
297
|
+
}
|
|
298
|
+
} else {
|
|
299
|
+
for (var i = 0; i < $darkModeToggles.length; i++) {
|
|
300
|
+
$darkModeToggles[i].classList.remove('dark');
|
|
301
|
+
}
|
|
302
|
+
if (hasClass) {
|
|
303
|
+
document.body.classList.remove('dark');
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
useDark.addEventListener('change', function (evt) {
|
|
309
|
+
toggleDarkMode(evt.matches);
|
|
310
|
+
});
|
|
311
|
+
if (darkModeStateLocal) {
|
|
312
|
+
darkModeState = darkModeStateLocal === 'true';
|
|
313
|
+
}
|
|
314
|
+
toggleDarkMode(darkModeState);
|
|
315
|
+
|
|
316
|
+
if ($darkModeToggles.length > 0) {
|
|
317
|
+
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
318
|
+
$darkModeToggleSwitchers[i].addEventListener('change', function (event) {
|
|
319
|
+
darkModeState = !darkModeState;
|
|
320
|
+
toggleDarkMode(darkModeState);
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}, 0);
|
|
325
|
+
});
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
document.addEventListener('DOMContentLoaded', function () {
|
|
2
|
+
function htmlEntities(str) {
|
|
3
|
+
return String(str)
|
|
4
|
+
.replace(/&/g, '&')
|
|
5
|
+
.replace(/</g, '<')
|
|
6
|
+
.replace(/>/g, '>')
|
|
7
|
+
.replace(/"/g, '"');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function foundLazyModuleWithPath(path) {
|
|
11
|
+
//path is like app/customers/customers.module#CustomersModule
|
|
12
|
+
var split = path.split('#'),
|
|
13
|
+
lazyModulePath = split[0],
|
|
14
|
+
lazyModuleName = split[1];
|
|
15
|
+
return lazyModuleName;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getBB(selection) {
|
|
19
|
+
selection.each(function (d) {
|
|
20
|
+
d.bbox = this.getBBox();
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var test_cases, test_case, test_case_num, engine;
|
|
25
|
+
|
|
26
|
+
var tree = ROUTES_INDEX;
|
|
27
|
+
|
|
28
|
+
function cleanStringChildren(obj) {
|
|
29
|
+
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);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (typeof obj[property] === 'object') {
|
|
39
|
+
cleanStringChildren(obj[property]);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
cleanStringChildren(tree);
|
|
45
|
+
|
|
46
|
+
engine = d3.layout.tree().setNodeSizes(true);
|
|
47
|
+
|
|
48
|
+
engine.spacing(function (a, b) {
|
|
49
|
+
return a.parent == b.parent ? 0 : engine.rootXSize();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
engine.nodeSize(function (d) {
|
|
53
|
+
return [
|
|
54
|
+
document.getElementById(d.id).getBBox()['height'] + 70,
|
|
55
|
+
document.getElementById(d.id).getBBox()['width'] + 30
|
|
56
|
+
];
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
var nodes = d3.layout.hierarchy()(tree),
|
|
60
|
+
svg = d3.select('#body-routes').append('svg'),
|
|
61
|
+
svg_g = svg.append('g'),
|
|
62
|
+
svg_p = svg.append('g'),
|
|
63
|
+
last_id = 0,
|
|
64
|
+
node = svg_g
|
|
65
|
+
.selectAll('.node')
|
|
66
|
+
.data(nodes, function (d) {
|
|
67
|
+
return d.id || (d.id = ++last_id);
|
|
68
|
+
})
|
|
69
|
+
.enter()
|
|
70
|
+
.append('g')
|
|
71
|
+
.attr('class', 'node');
|
|
72
|
+
|
|
73
|
+
svg.attr('id', 'main');
|
|
74
|
+
|
|
75
|
+
svg_g.attr('transform', 'translate(20,0)').attr('id', 'main-group');
|
|
76
|
+
|
|
77
|
+
svg_p.attr('transform', 'translate(20,0)').attr('id', 'paths');
|
|
78
|
+
|
|
79
|
+
var infos_group = node.append('g').attr({
|
|
80
|
+
id: function (d) {
|
|
81
|
+
return d.id;
|
|
82
|
+
},
|
|
83
|
+
dx: 0,
|
|
84
|
+
dy: 0
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
//Node icon
|
|
88
|
+
infos_group
|
|
89
|
+
.append('text')
|
|
90
|
+
.attr('font-family', 'Ionicons')
|
|
91
|
+
.attr('y', 5)
|
|
92
|
+
.attr('x', 0)
|
|
93
|
+
.attr('class', function (d) {
|
|
94
|
+
return d.children || d._children ? 'icon has-children' : 'icon';
|
|
95
|
+
})
|
|
96
|
+
.attr('font-size', function (d) {
|
|
97
|
+
return '15px';
|
|
98
|
+
})
|
|
99
|
+
.text(function (d) {
|
|
100
|
+
return '\uf183';
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
//node infos
|
|
104
|
+
infos_group
|
|
105
|
+
.append('svg:text')
|
|
106
|
+
.attr('x', function (d) {
|
|
107
|
+
return 0;
|
|
108
|
+
})
|
|
109
|
+
.attr('y', function (d) {
|
|
110
|
+
return 10;
|
|
111
|
+
})
|
|
112
|
+
.attr('dy', '.35em')
|
|
113
|
+
.attr('class', 'text')
|
|
114
|
+
.attr('text-anchor', function (d) {
|
|
115
|
+
return 'start';
|
|
116
|
+
})
|
|
117
|
+
.html(function (d) {
|
|
118
|
+
// if kind === module name + module
|
|
119
|
+
// if kind === component component + path
|
|
120
|
+
var _name = '';
|
|
121
|
+
if (d.kind === 'module') {
|
|
122
|
+
if (d.module) {
|
|
123
|
+
_name +=
|
|
124
|
+
'<tspan x="0" dy="1.4em"><a href="./modules/' +
|
|
125
|
+
d.module +
|
|
126
|
+
'.html">' +
|
|
127
|
+
d.module +
|
|
128
|
+
'</a></tspan>';
|
|
129
|
+
if (d.name) {
|
|
130
|
+
_name += '<tspan x="0" dy="1.4em">' + d.name + '</tspan>';
|
|
131
|
+
}
|
|
132
|
+
} else {
|
|
133
|
+
_name += '<tspan x="0" dy="1.4em">' + htmlEntities(d.name) + '</tspan>';
|
|
134
|
+
}
|
|
135
|
+
} else if (d.kind === 'component') {
|
|
136
|
+
_name += '<tspan x="0" dy="1.4em">' + d.path + '</tspan>';
|
|
137
|
+
_name +=
|
|
138
|
+
'<tspan x="0" dy="1.4em"><a href="./components/' +
|
|
139
|
+
d.component +
|
|
140
|
+
'.html">' +
|
|
141
|
+
d.component +
|
|
142
|
+
'</a></tspan>';
|
|
143
|
+
if (d.outlet) {
|
|
144
|
+
_name += '<tspan x="0" dy="1.4em"><outlet> : ' + d.outlet + '</tspan>';
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
_name += '<tspan x="0" dy="1.4em">/' + d.path + '</tspan>';
|
|
148
|
+
if (d.component) {
|
|
149
|
+
_name +=
|
|
150
|
+
'<tspan x="0" dy="1.4em"><a href="./components/' +
|
|
151
|
+
d.component +
|
|
152
|
+
'.html">' +
|
|
153
|
+
d.component +
|
|
154
|
+
'</a></tspan>';
|
|
155
|
+
}
|
|
156
|
+
if (d.loadChildren) {
|
|
157
|
+
var moduleName = foundLazyModuleWithPath(d.loadChildren);
|
|
158
|
+
_name +=
|
|
159
|
+
'<tspan x="0" dy="1.4em"><a href="./modules/' +
|
|
160
|
+
moduleName +
|
|
161
|
+
'.html">' +
|
|
162
|
+
moduleName +
|
|
163
|
+
'</a></tspan>';
|
|
164
|
+
}
|
|
165
|
+
if (d.canActivate) {
|
|
166
|
+
_name += '<tspan x="0" dy="1.4em">✓ canActivate</tspan>';
|
|
167
|
+
}
|
|
168
|
+
if (d.canDeactivate) {
|
|
169
|
+
_name += '<tspan x="0" dy="1.4em">× canDeactivate</tspan>';
|
|
170
|
+
}
|
|
171
|
+
if (d.canActivateChild) {
|
|
172
|
+
_name += '<tspan x="0" dy="1.4em">✓ canActivateChild</tspan>';
|
|
173
|
+
}
|
|
174
|
+
if (d.canLoad) {
|
|
175
|
+
_name += '<tspan x="0" dy="1.4em">→ canLoad</tspan>';
|
|
176
|
+
}
|
|
177
|
+
if (d.redirectTo) {
|
|
178
|
+
_name += '<tspan x="0" dy="1.4em">→ ' + d.redirectTo + '</tspan>';
|
|
179
|
+
}
|
|
180
|
+
if (d.pathMatch) {
|
|
181
|
+
_name += '<tspan x="0" dy="1.4em">> ' + d.pathMatch + '</tspan>';
|
|
182
|
+
}
|
|
183
|
+
if (d.outlet) {
|
|
184
|
+
_name += '<tspan x="0" dy="1.4em"><outlet> : ' + d.outlet + '</tspan>';
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return _name;
|
|
188
|
+
})
|
|
189
|
+
.call(getBB);
|
|
190
|
+
|
|
191
|
+
//
|
|
192
|
+
// Node lazy loaded ?
|
|
193
|
+
//
|
|
194
|
+
infos_group
|
|
195
|
+
.append('svg:text')
|
|
196
|
+
.attr('y', function (d) {
|
|
197
|
+
return 45;
|
|
198
|
+
})
|
|
199
|
+
.attr('x', function (d) {
|
|
200
|
+
return -18;
|
|
201
|
+
})
|
|
202
|
+
.attr('font-family', 'Ionicons')
|
|
203
|
+
.attr('class', function (d) {
|
|
204
|
+
return 'icon';
|
|
205
|
+
})
|
|
206
|
+
.attr('font-size', function (d) {
|
|
207
|
+
return '15px';
|
|
208
|
+
})
|
|
209
|
+
.text(function (d) {
|
|
210
|
+
var _text = '';
|
|
211
|
+
if (d.loadChildren || d.loadComponent) {
|
|
212
|
+
_text = '\uf4c1';
|
|
213
|
+
}
|
|
214
|
+
if (d.guarded) {
|
|
215
|
+
_text = '\uf1b0';
|
|
216
|
+
}
|
|
217
|
+
return _text;
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
//Node text background
|
|
221
|
+
infos_group
|
|
222
|
+
.insert('rect', 'text')
|
|
223
|
+
.attr('width', function (d) {
|
|
224
|
+
return d.bbox.width;
|
|
225
|
+
})
|
|
226
|
+
.attr('height', function (d) {
|
|
227
|
+
return d.bbox.height;
|
|
228
|
+
})
|
|
229
|
+
.attr('y', function (d) {
|
|
230
|
+
return 15;
|
|
231
|
+
})
|
|
232
|
+
.style('fill', 'white')
|
|
233
|
+
.style('fill-opacity', 0.75);
|
|
234
|
+
|
|
235
|
+
nodes = engine.nodes(tree);
|
|
236
|
+
|
|
237
|
+
function node_extents(n) {
|
|
238
|
+
return [n.x - n.x_size / 2, n.y, n.x + n.x_size / 2, n.y + n.y_size];
|
|
239
|
+
}
|
|
240
|
+
var root_extents = node_extents(nodes[0]);
|
|
241
|
+
var xmin = root_extents[0],
|
|
242
|
+
ymin = root_extents[1],
|
|
243
|
+
xmax = root_extents[2],
|
|
244
|
+
ymax = root_extents[3],
|
|
245
|
+
area_sum = (xmax - xmin) * (ymax - ymin),
|
|
246
|
+
x_size_min = nodes[0].x_size,
|
|
247
|
+
y_size_min = nodes[0].y_size;
|
|
248
|
+
|
|
249
|
+
nodes.slice(1).forEach(function (n) {
|
|
250
|
+
var ne = node_extents(n);
|
|
251
|
+
xmin = Math.min(xmin, ne[0]);
|
|
252
|
+
ymin = Math.min(ymin, ne[1]);
|
|
253
|
+
xmax = Math.max(xmax, ne[2]);
|
|
254
|
+
ymax = Math.max(ymax, ne[3]);
|
|
255
|
+
area_sum += (ne[2] - ne[0]) * (ne[3] - ne[1]);
|
|
256
|
+
x_size_min = Math.min(x_size_min, n.x_size);
|
|
257
|
+
y_size_min = Math.min(y_size_min, n.y_size);
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
var area_ave = area_sum / nodes.length;
|
|
261
|
+
var scale = 80 / Math.sqrt(area_ave);
|
|
262
|
+
|
|
263
|
+
function svg_x(node_y) {
|
|
264
|
+
return node_y - ymin;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function svg_y(node_x) {
|
|
268
|
+
return (node_x - xmin) * scale;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
var nodebox_right_margin = Math.min(x_size_min * scale, 10);
|
|
272
|
+
var nodebox_vertical_margin = Math.min(y_size_min * scale, 3);
|
|
273
|
+
|
|
274
|
+
node.attr('transform', function (d) {
|
|
275
|
+
return 'translate(' + svg_x(d.y) + ',' + svg_y(d.x) + ')';
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
var diagonal = d3.svg.diagonal().projection(function (d) {
|
|
279
|
+
return [svg_x(d.y), svg_y(d.x)];
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
var links = engine.links(nodes);
|
|
283
|
+
var links = svg_p
|
|
284
|
+
.selectAll('.link')
|
|
285
|
+
.data(links)
|
|
286
|
+
.enter()
|
|
287
|
+
.append('path')
|
|
288
|
+
.attr('class', 'link')
|
|
289
|
+
.attr('d', diagonal);
|
|
290
|
+
|
|
291
|
+
var _svg = document.getElementById('main'),
|
|
292
|
+
main_g = _svg.childNodes[0];
|
|
293
|
+
|
|
294
|
+
_svg.removeChild(main_g);
|
|
295
|
+
_svg.appendChild(main_g);
|
|
296
|
+
|
|
297
|
+
svg.attr({
|
|
298
|
+
width: document.getElementById('main-group').getBBox()['width'] + 30,
|
|
299
|
+
height: document.getElementById('main-group').getBBox()['height'] + 50
|
|
300
|
+
});
|
|
301
|
+
});
|