@rxap/layout 22.0.0-dev.0 → 22.0.0-dev.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/CHANGELOG.md +54 -0
- package/README.md +5 -3
- package/compodoc/{directives/FooterDirective-1.html → architecture.html} +68 -139
- package/compodoc/changelog.html +98 -5
- package/compodoc/components/AppsButtonComponent.html +174 -40
- package/compodoc/components/BaseLayoutComponent.html +115 -23
- package/compodoc/components/DefaultHeaderComponent.html +205 -36
- package/compodoc/components/FooterComponent.html +142 -27
- package/compodoc/components/HeaderComponent.html +165 -61
- package/compodoc/components/LayoutComponent.html +194 -44
- package/compodoc/components/MinimalLayoutComponent.html +120 -26
- package/compodoc/components/NavigationComponent.html +220 -133
- package/compodoc/components/NavigationItemComponent.html +248 -115
- package/compodoc/components/NavigationProgressBarComponent.html +121 -25
- package/compodoc/components/ReleaseInfoComponent.html +149 -32
- package/compodoc/components/SettingsButtonComponent.html +220 -62
- package/compodoc/components/SidenavComponent.html +222 -56
- package/compodoc/components/SidenavToggleButtonComponent.html +117 -27
- package/compodoc/components/UserProfileIconComponent.html +155 -66
- package/compodoc/dependencies.html +152 -49
- package/compodoc/directives/FooterDirective.html +74 -20
- package/compodoc/directives/HeaderDirective.html +74 -20
- package/compodoc/directives/SidenavFooterDirective.html +91 -19
- package/compodoc/directives/SidenavHeaderDirective.html +72 -19
- package/compodoc/index.html +50 -8
- package/compodoc/injectables/DefaultHeaderService.html +91 -25
- package/compodoc/injectables/ExternalAppsService.html +123 -21
- package/compodoc/injectables/FooterService.html +91 -25
- package/compodoc/injectables/HeaderService.html +91 -25
- package/compodoc/injectables/LayoutService.html +91 -21
- package/compodoc/injectables/LogoService.html +103 -17
- package/compodoc/injectables/NavigationService.html +84 -24
- package/compodoc/interfaces/NavigationDividerItem.html +155 -100
- package/compodoc/interfaces/NavigationInsertItem.html +114 -64
- package/compodoc/interfaces/NavigationItem.html +305 -216
- package/compodoc/interfaces/NavigationStatus.html +80 -35
- package/compodoc/interfaces/ReleaseInfoModule.html +197 -137
- package/compodoc/interfaces/SettingsMenuItem.html +197 -137
- package/compodoc/js/architecture-graph.js +288 -0
- package/compodoc/js/libs/bootstrap-native.js +4 -2
- package/compodoc/js/libs/jszip.min.js +13 -0
- package/compodoc/js/libs/svg-pan-zoom.min.js +3 -3
- package/compodoc/js/libs/tablesort.min.js +3 -3
- package/compodoc/js/libs/tablesort.number.min.js +3 -3
- package/compodoc/js/libs/vis-network.min.js +78 -0
- package/compodoc/js/menu-wc.js +26 -13
- package/compodoc/js/menu.js +10 -11
- package/compodoc/js/routes/routes_index.js +1 -0
- package/compodoc/js/routes.js +142 -34
- package/compodoc/js/search/search-lunr.js +6 -8
- package/compodoc/js/search/search.js +118 -66
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/js/tabs.js +98 -15
- package/compodoc/js/tree.js +44 -7
- package/compodoc/license.html +48 -6
- package/compodoc/llms.txt +525 -0
- package/compodoc/miscellaneous/functions.html +171 -41
- package/compodoc/miscellaneous/typealiases.html +55 -12
- package/compodoc/miscellaneous/variables.html +163 -20
- package/compodoc/modules.html +44 -3
- package/compodoc/overview.html +54 -3
- package/compodoc/properties.html +45 -4
- package/compodoc/routes.html +227 -0
- package/compodoc/styles/compodoc.css +365 -44
- package/compodoc/styles/dark.css +16 -0
- package/compodoc/template-playground/default-templates.json +192 -0
- package/compodoc/template-playground/hbs-render.service.ts +217 -0
- package/compodoc/template-playground/main.ts +9 -0
- package/compodoc/template-playground/template-editor.service.ts +173 -0
- package/compodoc/template-playground/template-playground.component.ts +614 -0
- package/compodoc/template-playground/template-playground.module.ts +29 -0
- package/compodoc/template-playground/zip-export.service.ts +86 -0
- package/compodoc/template-playground-app/app.js +1389 -0
- package/compodoc/template-playground-app/index.html +462 -0
- package/docs/documentation.json +1700 -1219
- package/docs/html/assets/highlight.css +1 -1
- package/docs/html/assets/icons.js +1 -1
- package/docs/html/assets/icons.svg +1 -1
- package/docs/html/assets/main.js +5 -5
- package/docs/html/assets/search.js +1 -1
- package/docs/html/assets/style.css +265 -228
- package/docs/html/classes/AppsButtonComponent.html +110 -8
- package/docs/html/classes/BaseLayoutComponent.html +56 -2
- package/docs/html/classes/DefaultHeaderComponent.html +112 -10
- package/docs/html/classes/DefaultHeaderService.html +128 -13
- package/docs/html/classes/ExternalAppsService.html +240 -19
- package/docs/html/classes/FooterComponent.html +82 -5
- package/docs/html/classes/FooterDirective.html +95 -6
- package/docs/html/classes/FooterService.html +128 -13
- package/docs/html/classes/HeaderComponent.html +88 -6
- package/docs/html/classes/HeaderDirective.html +95 -6
- package/docs/html/classes/HeaderService.html +128 -13
- package/docs/html/classes/LayoutComponent.html +88 -6
- package/docs/html/classes/LayoutService.html +174 -16
- package/docs/html/classes/LogoService.html +88 -6
- package/docs/html/classes/MinimalLayoutComponent.html +56 -2
- package/docs/html/classes/NavigationComponent.html +156 -12
- package/docs/html/classes/NavigationItemComponent.html +172 -14
- package/docs/html/classes/NavigationProgressBarComponent.html +76 -4
- package/docs/html/classes/NavigationService.html +197 -12
- package/docs/html/classes/ReleaseInfoComponent.html +100 -6
- package/docs/html/classes/SettingsButtonComponent.html +242 -19
- package/docs/html/classes/SidenavComponent.html +190 -19
- package/docs/html/classes/SidenavFooterDirective.html +70 -3
- package/docs/html/classes/SidenavHeaderDirective.html +70 -3
- package/docs/html/classes/SidenavToggleButtonComponent.html +94 -5
- package/docs/html/classes/UserProfileIconComponent.html +106 -7
- package/docs/html/functions/IsNavigationDividerItem.html +42 -1
- package/docs/html/functions/IsNavigationInsertItem.html +42 -1
- package/docs/html/functions/IsNavigationItem.html +42 -1
- package/docs/html/functions/provideExternalApps.html +42 -1
- package/docs/html/functions/provideLayout.html +42 -1
- package/docs/html/functions/withDefaultHeaderComponent.html +38 -1
- package/docs/html/functions/withDefaultHeaderItems.html +42 -1
- package/docs/html/functions/withFooterComponents.html +42 -1
- package/docs/html/functions/withHeaderComponents.html +42 -1
- package/docs/html/functions/withNavigationConfig.html +42 -1
- package/docs/html/functions/withNavigationInserts.html +42 -1
- package/docs/html/functions/withReleaseInfoModules.html +42 -1
- package/docs/html/functions/withSettingsMenuItems.html +42 -1
- package/docs/html/functions/withUserProfileDataSource.html +43 -1
- package/docs/html/hierarchy.html +29 -0
- package/docs/html/index.html +96 -21
- package/docs/html/interfaces/NavigationDividerItem.html +61 -3
- package/docs/html/interfaces/NavigationInsertItem.html +55 -2
- package/docs/html/interfaces/NavigationItem.html +94 -6
- package/docs/html/interfaces/NavigationStatus.html +63 -2
- package/docs/html/interfaces/ReleaseInfoModule.html +67 -4
- package/docs/html/interfaces/SettingsMenuItem.html +67 -4
- package/docs/html/modules.html +52 -1
- package/docs/html/types/DefaultHeaderItemComponent.html +33 -1
- package/docs/html/types/ExternalApp.html +33 -1
- package/docs/html/types/ExtractUsernameFromProfileFn.html +49 -1
- package/docs/html/types/Navigation.html +33 -1
- package/docs/html/types/NavigationWithInserts.html +33 -1
- package/docs/html/types/SettingsMenuItemComponent.html +33 -1
- package/docs/html/variables/EXTRACT_USERNAME_FROM_PROFILE.html +33 -1
- package/docs/html/variables/RXAP_DEFAULT_HEADER_ITEM_COMPONENT.html +33 -1
- package/docs/html/variables/RXAP_EXTERNAL_APP.html +33 -1
- package/docs/html/variables/RXAP_EXTERNAL_APP_FILTER.html +33 -1
- package/docs/html/variables/RXAP_FOOTER_COMPONENT.html +33 -1
- package/docs/html/variables/RXAP_HEADER_COMPONENT.html +33 -1
- package/docs/html/variables/RXAP_LAYOUT_APPS_GRID.html +33 -1
- package/docs/html/variables/RXAP_LOGO_CONFIG.html +33 -1
- package/docs/html/variables/RXAP_LOGO_CONFIG_DEFAULTS.html +33 -1
- package/docs/html/variables/RXAP_NAVIGATION_CONFIG.html +33 -1
- package/docs/html/variables/RXAP_NAVIGATION_CONFIG_INSERTS.html +33 -1
- package/docs/html/variables/RXAP_NAVIGATION_LAYOUT_CONFIG_DEFAULTS.html +33 -1
- package/docs/html/variables/RXAP_RELEASE_INFO_MODULE.html +33 -1
- package/docs/html/variables/RXAP_SETTINGS_MENU_ITEM.html +33 -1
- package/docs/html/variables/RXAP_SETTINGS_MENU_ITEM_COMPONENT.html +33 -1
- package/docs/html/variables/RXAP_USER_PROFILE_DATA_SOURCE.html +33 -1
- package/docs/markdown/README.md +6 -4
- package/docs/markdown/classes/AppsButtonComponent.md +11 -11
- package/docs/markdown/classes/BaseLayoutComponent.md +5 -5
- package/docs/markdown/classes/DefaultHeaderComponent.md +13 -13
- package/docs/markdown/classes/DefaultHeaderService.md +9 -9
- package/docs/markdown/classes/ExternalAppsService.md +29 -29
- package/docs/markdown/classes/FooterComponent.md +8 -8
- package/docs/markdown/classes/FooterDirective.md +7 -7
- package/docs/markdown/classes/FooterService.md +9 -9
- package/docs/markdown/classes/HeaderComponent.md +9 -9
- package/docs/markdown/classes/HeaderDirective.md +7 -7
- package/docs/markdown/classes/HeaderService.md +9 -9
- package/docs/markdown/classes/LayoutComponent.md +9 -9
- package/docs/markdown/classes/LayoutService.md +21 -21
- package/docs/markdown/classes/LogoService.md +9 -9
- package/docs/markdown/classes/MinimalLayoutComponent.md +5 -5
- package/docs/markdown/classes/NavigationComponent.md +19 -19
- package/docs/markdown/classes/NavigationItemComponent.md +21 -21
- package/docs/markdown/classes/NavigationProgressBarComponent.md +7 -7
- package/docs/markdown/classes/NavigationService.md +26 -26
- package/docs/markdown/classes/ReleaseInfoComponent.md +9 -9
- package/docs/markdown/classes/SettingsButtonComponent.md +24 -24
- package/docs/markdown/classes/SidenavComponent.md +24 -24
- package/docs/markdown/classes/SidenavFooterDirective.md +6 -6
- package/docs/markdown/classes/SidenavHeaderDirective.md +6 -6
- package/docs/markdown/classes/SidenavToggleButtonComponent.md +8 -8
- package/docs/markdown/classes/UserProfileIconComponent.md +11 -11
- package/docs/markdown/functions/IsNavigationDividerItem.md +2 -2
- package/docs/markdown/functions/IsNavigationInsertItem.md +2 -2
- package/docs/markdown/functions/IsNavigationItem.md +2 -2
- package/docs/markdown/functions/provideExternalApps.md +2 -2
- package/docs/markdown/functions/provideLayout.md +2 -2
- package/docs/markdown/functions/withDefaultHeaderComponent.md +2 -2
- package/docs/markdown/functions/withDefaultHeaderItems.md +3 -3
- package/docs/markdown/functions/withFooterComponents.md +2 -2
- package/docs/markdown/functions/withHeaderComponents.md +2 -2
- package/docs/markdown/functions/withNavigationConfig.md +3 -3
- package/docs/markdown/functions/withNavigationInserts.md +2 -2
- package/docs/markdown/functions/withReleaseInfoModules.md +2 -2
- package/docs/markdown/functions/withSettingsMenuItems.md +3 -3
- package/docs/markdown/functions/withUserProfileDataSource.md +4 -4
- package/docs/markdown/globals.md +2 -2
- package/docs/markdown/interfaces/NavigationDividerItem.md +5 -5
- package/docs/markdown/interfaces/NavigationInsertItem.md +3 -3
- package/docs/markdown/interfaces/NavigationItem.md +14 -12
- package/docs/markdown/interfaces/NavigationStatus.md +3 -3
- package/docs/markdown/interfaces/ReleaseInfoModule.md +6 -6
- package/docs/markdown/interfaces/SettingsMenuItem.md +7 -7
- package/docs/markdown/type-aliases/DefaultHeaderItemComponent.md +3 -3
- package/docs/markdown/type-aliases/ExternalApp.md +3 -3
- package/docs/markdown/type-aliases/ExtractUsernameFromProfileFn.md +7 -5
- package/docs/markdown/type-aliases/Navigation.md +3 -3
- package/docs/markdown/type-aliases/NavigationWithInserts.md +3 -3
- package/docs/markdown/type-aliases/SettingsMenuItemComponent.md +3 -3
- package/docs/markdown/variables/EXTRACT_USERNAME_FROM_PROFILE.md +2 -2
- package/docs/markdown/variables/RXAP_DEFAULT_HEADER_ITEM_COMPONENT.md +3 -3
- package/docs/markdown/variables/RXAP_EXTERNAL_APP.md +2 -2
- package/docs/markdown/variables/RXAP_EXTERNAL_APP_FILTER.md +2 -2
- package/docs/markdown/variables/RXAP_FOOTER_COMPONENT.md +2 -2
- package/docs/markdown/variables/RXAP_HEADER_COMPONENT.md +2 -2
- package/docs/markdown/variables/RXAP_LAYOUT_APPS_GRID.md +2 -2
- package/docs/markdown/variables/RXAP_LOGO_CONFIG.md +2 -2
- package/docs/markdown/variables/RXAP_LOGO_CONFIG_DEFAULTS.md +2 -2
- package/docs/markdown/variables/RXAP_NAVIGATION_CONFIG.md +3 -3
- package/docs/markdown/variables/RXAP_NAVIGATION_CONFIG_INSERTS.md +2 -2
- package/docs/markdown/variables/RXAP_NAVIGATION_LAYOUT_CONFIG_DEFAULTS.md +2 -2
- package/docs/markdown/variables/RXAP_RELEASE_INFO_MODULE.md +2 -2
- package/docs/markdown/variables/RXAP_SETTINGS_MENU_ITEM.md +2 -2
- package/docs/markdown/variables/RXAP_SETTINGS_MENU_ITEM_COMPONENT.md +3 -3
- package/docs/markdown/variables/RXAP_USER_PROFILE_DATA_SOURCE.md +2 -2
- package/docs/wiki/Class.AppsButtonComponent.md +10 -10
- package/docs/wiki/Class.BaseLayoutComponent.md +4 -4
- package/docs/wiki/Class.DefaultHeaderComponent.md +12 -12
- package/docs/wiki/Class.DefaultHeaderService.md +8 -8
- package/docs/wiki/Class.ExternalAppsService.md +28 -28
- package/docs/wiki/Class.FooterComponent.md +7 -7
- package/docs/wiki/Class.FooterDirective.md +6 -6
- package/docs/wiki/Class.FooterService.md +8 -8
- package/docs/wiki/Class.HeaderComponent.md +8 -8
- package/docs/wiki/Class.HeaderDirective.md +6 -6
- package/docs/wiki/Class.HeaderService.md +8 -8
- package/docs/wiki/Class.LayoutComponent.md +8 -8
- package/docs/wiki/Class.LayoutService.md +20 -20
- package/docs/wiki/Class.LogoService.md +8 -8
- package/docs/wiki/Class.MinimalLayoutComponent.md +4 -4
- package/docs/wiki/Class.NavigationComponent.md +18 -18
- package/docs/wiki/Class.NavigationItemComponent.md +20 -20
- package/docs/wiki/Class.NavigationProgressBarComponent.md +6 -6
- package/docs/wiki/Class.NavigationService.md +25 -25
- package/docs/wiki/Class.ReleaseInfoComponent.md +8 -8
- package/docs/wiki/Class.SettingsButtonComponent.md +23 -23
- package/docs/wiki/Class.SidenavComponent.md +23 -23
- package/docs/wiki/Class.SidenavFooterDirective.md +5 -5
- package/docs/wiki/Class.SidenavHeaderDirective.md +5 -5
- package/docs/wiki/Class.SidenavToggleButtonComponent.md +7 -7
- package/docs/wiki/Class.UserProfileIconComponent.md +10 -10
- package/docs/wiki/Function.IsNavigationDividerItem.md +1 -1
- package/docs/wiki/Function.IsNavigationInsertItem.md +1 -1
- package/docs/wiki/Function.IsNavigationItem.md +1 -1
- package/docs/wiki/Function.provideExternalApps.md +1 -1
- package/docs/wiki/Function.provideLayout.md +1 -1
- package/docs/wiki/Function.withDefaultHeaderComponent.md +1 -1
- package/docs/wiki/Function.withDefaultHeaderItems.md +2 -2
- package/docs/wiki/Function.withFooterComponents.md +1 -1
- package/docs/wiki/Function.withHeaderComponents.md +1 -1
- package/docs/wiki/Function.withNavigationConfig.md +2 -2
- package/docs/wiki/Function.withNavigationInserts.md +1 -1
- package/docs/wiki/Function.withReleaseInfoModules.md +1 -1
- package/docs/wiki/Function.withSettingsMenuItems.md +2 -2
- package/docs/wiki/Function.withUserProfileDataSource.md +3 -3
- package/docs/wiki/Home.md +5 -3
- package/docs/wiki/Interface.NavigationDividerItem.md +4 -4
- package/docs/wiki/Interface.NavigationInsertItem.md +2 -2
- package/docs/wiki/Interface.NavigationItem.md +13 -11
- package/docs/wiki/Interface.NavigationStatus.md +2 -2
- package/docs/wiki/Interface.ReleaseInfoModule.md +5 -5
- package/docs/wiki/Interface.SettingsMenuItem.md +6 -6
- package/docs/wiki/TypeAlias.DefaultHeaderItemComponent.md +2 -2
- package/docs/wiki/TypeAlias.ExternalApp.md +2 -2
- package/docs/wiki/TypeAlias.ExtractUsernameFromProfileFn.md +6 -4
- package/docs/wiki/TypeAlias.Navigation.md +2 -2
- package/docs/wiki/TypeAlias.NavigationWithInserts.md +2 -2
- package/docs/wiki/TypeAlias.SettingsMenuItemComponent.md +2 -2
- package/docs/wiki/Variable.EXTRACT_USERNAME_FROM_PROFILE.md +1 -1
- package/docs/wiki/Variable.RXAP_DEFAULT_HEADER_ITEM_COMPONENT.md +2 -2
- package/docs/wiki/Variable.RXAP_EXTERNAL_APP.md +1 -1
- package/docs/wiki/Variable.RXAP_EXTERNAL_APP_FILTER.md +1 -1
- package/docs/wiki/Variable.RXAP_FOOTER_COMPONENT.md +1 -1
- package/docs/wiki/Variable.RXAP_HEADER_COMPONENT.md +1 -1
- package/docs/wiki/Variable.RXAP_LAYOUT_APPS_GRID.md +1 -1
- package/docs/wiki/Variable.RXAP_LOGO_CONFIG.md +1 -1
- package/docs/wiki/Variable.RXAP_LOGO_CONFIG_DEFAULTS.md +1 -1
- package/docs/wiki/Variable.RXAP_NAVIGATION_CONFIG.md +2 -2
- package/docs/wiki/Variable.RXAP_NAVIGATION_CONFIG_INSERTS.md +1 -1
- package/docs/wiki/Variable.RXAP_NAVIGATION_LAYOUT_CONFIG_DEFAULTS.md +1 -1
- package/docs/wiki/Variable.RXAP_RELEASE_INFO_MODULE.md +1 -1
- package/docs/wiki/Variable.RXAP_SETTINGS_MENU_ITEM.md +1 -1
- package/docs/wiki/Variable.RXAP_SETTINGS_MENU_ITEM_COMPONENT.md +2 -2
- package/docs/wiki/Variable.RXAP_USER_PROFILE_DATA_SOURCE.md +1 -1
- package/docs/wiki/globals.md +1 -1
- package/fesm2022/rxap-layout.mjs +19 -17
- package/fesm2022/rxap-layout.mjs.map +1 -1
- package/package.json +38 -40
- package/src/generators/init/generator.js +120 -0
- package/src/generators/init/index.js +6 -0
- package/src/generators/package.json +3 -0
- package/src/migrations/18.0.0/add-user-theme-provider-to-layout-providers/add-user-theme-provider-to-layout-providers.spec.ts +9 -0
- package/src/migrations/18.0.0/add-with-user-profile-provider/add-with-user-profile-provider.spec.ts +9 -0
- package/src/test-setup.ts +4 -17
- package/compodoc/components/LanguageSelectorComponent.html +0 -478
- package/compodoc/components/ResetButtonComponent.html +0 -486
- package/compodoc/components/SignOutComponent.html +0 -440
- package/compodoc/components/ToggleWindowSidenavButtonComponent.html +0 -549
- package/compodoc/components/VersionComponent.html +0 -524
- package/compodoc/components/WindowContainerSidenavComponent.html +0 -687
- package/compodoc/injectables/AppUrlService.html +0 -829
- package/compodoc/injectables/AuthenticationServiceMock.html +0 -303
- package/compodoc/injectables/LayoutComponentService.html +0 -848
- package/compodoc/injectables/ReplaceRouterPathsService.html +0 -337
- package/compodoc/injectables/SidenavComponentService.html +0 -408
- package/compodoc/interfaces/ExternalApps.html +0 -634
- package/compodoc/interfaces/LogoConfig.html +0 -381
- package/compodoc/js/libs/vis.min.js +0 -47
- package/compodoc/js/menu-wc_es5.js +0 -40
- package/compodoc/pipes/ReplaceRouterPathsPipe.html +0 -363
- package/src/generators/init/generator.spec.ts +0 -228
- package/src/generators/init/generator.ts +0 -139
- package/src/generators/init/index.ts +0 -5
- package/src/generators/init/schema.d.ts +0 -2
- package/theme.css +0 -425
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
(function (compodoc) {
|
|
2
2
|
var usePushState = typeof history.pushState !== 'undefined',
|
|
3
3
|
// DOM Elements
|
|
4
|
-
$body =
|
|
4
|
+
$body = document.querySelector('body'),
|
|
5
5
|
$searchResults,
|
|
6
6
|
$searchInput,
|
|
7
7
|
$searchList,
|
|
8
8
|
$searchTitle,
|
|
9
9
|
$searchResultsCount,
|
|
10
10
|
$searchQuery,
|
|
11
|
+
$searchInputs,
|
|
12
|
+
$searchClearButtons,
|
|
11
13
|
$mainContainer,
|
|
12
14
|
$xsMenu;
|
|
13
15
|
|
|
@@ -30,14 +32,18 @@
|
|
|
30
32
|
function displayResults(res) {
|
|
31
33
|
var noResults = res.count == 0;
|
|
32
34
|
var groups = {};
|
|
33
|
-
|
|
35
|
+
if (noResults) {
|
|
36
|
+
$searchResults.classList.add('no-results');
|
|
37
|
+
} else {
|
|
38
|
+
$searchResults.classList.remove('no-results');
|
|
39
|
+
}
|
|
34
40
|
|
|
35
41
|
// Clear old results
|
|
36
|
-
$searchList.
|
|
42
|
+
$searchList.innerText = '';
|
|
37
43
|
|
|
38
44
|
// Display title for research
|
|
39
|
-
$searchResultsCount.
|
|
40
|
-
$searchQuery.
|
|
45
|
+
$searchResultsCount.innerText = res.count;
|
|
46
|
+
$searchQuery.innerText = res.query;
|
|
41
47
|
|
|
42
48
|
// Group result by context
|
|
43
49
|
res.results.forEach(function (res) {
|
|
@@ -56,9 +62,8 @@
|
|
|
56
62
|
for (var i = 0; i < sortedGroups.length; i++) {
|
|
57
63
|
var property = sortedGroups[i];
|
|
58
64
|
|
|
59
|
-
var $li =
|
|
60
|
-
|
|
61
|
-
});
|
|
65
|
+
var $li = document.createElement('li');
|
|
66
|
+
$li.classList.add('search-results-group');
|
|
62
67
|
var finalPropertyLabel = '';
|
|
63
68
|
var propertyLabels = property.split('-');
|
|
64
69
|
|
|
@@ -87,20 +92,17 @@
|
|
|
87
92
|
groups[property].results.length +
|
|
88
93
|
')';
|
|
89
94
|
}
|
|
90
|
-
var $groupTitle =
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
$groupTitle.appendTo($li);
|
|
95
|
+
var $groupTitle = document.createElement('h3');
|
|
96
|
+
$groupTitle.innerText = finalPropertyLabel;
|
|
97
|
+
$li.appendChild($groupTitle);
|
|
94
98
|
|
|
95
|
-
var $ulResults =
|
|
96
|
-
|
|
97
|
-
});
|
|
99
|
+
var $ulResults = document.createElement('ul');
|
|
100
|
+
$ulResults.classList.add('search-results-list');
|
|
98
101
|
|
|
99
102
|
groups[property].results.forEach(function (res) {
|
|
100
103
|
var link = '';
|
|
101
|
-
var $liResult =
|
|
102
|
-
|
|
103
|
-
});
|
|
104
|
+
var $liResult = document.createElement('li');
|
|
105
|
+
$liResult.classList.add('search-results-item');
|
|
104
106
|
switch (COMPODOC_CURRENT_PAGE_DEPTH) {
|
|
105
107
|
case 0:
|
|
106
108
|
link = './';
|
|
@@ -116,25 +118,24 @@
|
|
|
116
118
|
var finalResLabel =
|
|
117
119
|
res.title.split(' - ')[1].charAt(0).toUpperCase() +
|
|
118
120
|
res.title.split(' - ')[1].substring(1);
|
|
119
|
-
var $link =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
$
|
|
124
|
-
$liResult.appendTo($ulResults);
|
|
121
|
+
var $link = document.createElement('a');
|
|
122
|
+
$link.innerText = finalResLabel;
|
|
123
|
+
$link.href = link + res.url;
|
|
124
|
+
$liResult.appendChild($link);
|
|
125
|
+
$ulResults.appendChild($liResult);
|
|
125
126
|
});
|
|
126
|
-
$
|
|
127
|
+
$li.appendChild($ulResults);
|
|
127
128
|
|
|
128
|
-
$
|
|
129
|
+
$searchList.appendChild($li);
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
|
|
132
133
|
function launchSearch(q) {
|
|
133
|
-
$body.
|
|
134
|
+
$body.classList.add('with-search');
|
|
134
135
|
|
|
135
|
-
if ($xsMenu.
|
|
136
|
-
$mainContainer.
|
|
137
|
-
$mainContainer.
|
|
136
|
+
if ($xsMenu.style.display === 'block') {
|
|
137
|
+
$mainContainer.style.height = 'calc(100% - 100px)';
|
|
138
|
+
$mainContainer.style.marginTop = '100px';
|
|
138
139
|
}
|
|
139
140
|
|
|
140
141
|
throttle(
|
|
@@ -146,40 +147,71 @@
|
|
|
146
147
|
}
|
|
147
148
|
|
|
148
149
|
function closeSearch() {
|
|
149
|
-
$body.
|
|
150
|
-
if ($xsMenu.
|
|
151
|
-
$mainContainer.
|
|
150
|
+
$body.classList.remove('with-search');
|
|
151
|
+
if ($xsMenu.style.display === 'block') {
|
|
152
|
+
$mainContainer.style.height = 'calc(100% - 50px)';
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
function bindMenuButton() {
|
|
156
157
|
document.getElementById('btn-menu').addEventListener('click', function () {
|
|
157
|
-
if ($xsMenu.
|
|
158
|
-
$body.
|
|
159
|
-
$mainContainer.
|
|
158
|
+
if ($xsMenu.style.display === 'none') {
|
|
159
|
+
$body.classList.remove('with-search');
|
|
160
|
+
$mainContainer.style.height = 'calc(100% - 50px)';
|
|
160
161
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
item.val('');
|
|
162
|
+
$searchInputs.forEach((item, index) => {
|
|
163
|
+
item.value = '';
|
|
164
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);
|
|
165
194
|
});
|
|
166
195
|
}
|
|
167
196
|
|
|
168
197
|
function bindSearch() {
|
|
169
198
|
// Bind DOM
|
|
170
|
-
$searchInputs =
|
|
199
|
+
$searchInputs = document.querySelectorAll('#book-search-input input');
|
|
200
|
+
$searchClearButtons = document.querySelectorAll(
|
|
201
|
+
'#book-search-input [data-search-input-clear]'
|
|
202
|
+
);
|
|
171
203
|
|
|
172
|
-
$searchResults =
|
|
173
|
-
$searchList = $searchResults.
|
|
174
|
-
$searchTitle = $searchResults.
|
|
175
|
-
$searchResultsCount = $searchTitle.
|
|
176
|
-
$searchQuery = $searchTitle.
|
|
177
|
-
$mainContainer =
|
|
178
|
-
$xsMenu =
|
|
204
|
+
$searchResults = document.querySelector('.search-results');
|
|
205
|
+
$searchList = $searchResults.querySelector('.search-results-list');
|
|
206
|
+
$searchTitle = $searchResults.querySelector('.search-results-title');
|
|
207
|
+
$searchResultsCount = $searchTitle.querySelector('.search-results-count');
|
|
208
|
+
$searchQuery = $searchTitle.querySelector('.search-query');
|
|
209
|
+
$mainContainer = document.querySelector('.container-fluid');
|
|
210
|
+
$xsMenu = document.querySelector('.xs-menu');
|
|
179
211
|
|
|
180
212
|
// Launch query based on input content
|
|
181
213
|
function handleUpdate(item) {
|
|
182
|
-
var q = item.
|
|
214
|
+
var q = item.value;
|
|
183
215
|
|
|
184
216
|
if (q.length == 0) {
|
|
185
217
|
closeSearch();
|
|
@@ -192,45 +224,65 @@
|
|
|
192
224
|
// Detect true content change in search input
|
|
193
225
|
var propertyChangeUnbound = false;
|
|
194
226
|
|
|
195
|
-
|
|
196
|
-
var item = $(item);
|
|
227
|
+
$searchInputs.forEach((item, index) => {
|
|
197
228
|
// HTML5 (IE9 & others)
|
|
198
|
-
item.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
$(this).unbind('propertychange');
|
|
202
|
-
propertyChangeUnbound = true;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
handleUpdate($(this));
|
|
229
|
+
item.addEventListener('input', function (e) {
|
|
230
|
+
handleUpdate(this);
|
|
231
|
+
syncSearchClearButtons();
|
|
206
232
|
});
|
|
207
233
|
// Workaround for IE < 9
|
|
208
|
-
item.
|
|
234
|
+
item.addEventListener('propertychange', function (e) {
|
|
209
235
|
if (e.originalEvent.propertyName == 'value') {
|
|
210
|
-
handleUpdate(
|
|
236
|
+
handleUpdate(this);
|
|
237
|
+
syncSearchClearButtons();
|
|
211
238
|
}
|
|
212
239
|
});
|
|
213
240
|
// Push to history on blur
|
|
214
|
-
item.
|
|
241
|
+
item.addEventListener('blur', function (e) {
|
|
215
242
|
// Update history state
|
|
216
243
|
if (usePushState) {
|
|
217
|
-
var uri = updateQueryString('q',
|
|
218
|
-
if (
|
|
244
|
+
var uri = updateQueryString('q', this.value);
|
|
245
|
+
if (this.value !== '') {
|
|
219
246
|
history.pushState({ path: uri }, null, uri);
|
|
220
247
|
}
|
|
221
248
|
}
|
|
222
249
|
});
|
|
223
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();
|
|
224
276
|
}
|
|
225
277
|
|
|
226
278
|
function launchSearchFromQueryString() {
|
|
227
279
|
var q = getParameterByName('q');
|
|
228
280
|
if (q && q.length > 0) {
|
|
229
281
|
// Update search inputs
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
item.val(q);
|
|
282
|
+
$searchInputs.forEach((item, index) => {
|
|
283
|
+
item.value = q;
|
|
233
284
|
});
|
|
285
|
+
syncSearchClearButtons();
|
|
234
286
|
// Launch search
|
|
235
287
|
launchSearch(q);
|
|
236
288
|
}
|