@rxap/layout 21.0.1-dev.0 → 21.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/compodoc/changelog.html +59 -0
- package/compodoc/components/AppsButtonComponent.html +26 -15
- package/compodoc/components/NavigationComponent.html +33 -70
- package/compodoc/components/NavigationItemComponent.html +88 -199
- package/compodoc/components/SidenavToggleButtonComponent.html +15 -5
- package/compodoc/dependencies.html +12 -12
- package/compodoc/directives/SidenavFooterDirective.html +4 -74
- package/compodoc/directives/SidenavHeaderDirective.html +4 -74
- package/compodoc/injectables/LayoutService.html +24 -67
- package/compodoc/injectables/NavigationService.html +20 -72
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +2034 -2785
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/AppsButtonComponent.html +4 -10
- package/docs/html/classes/BaseLayoutComponent.html +2 -2
- package/docs/html/classes/DefaultHeaderComponent.html +2 -2
- package/docs/html/classes/DefaultHeaderService.html +5 -5
- package/docs/html/classes/ExternalAppsService.html +2 -2
- package/docs/html/classes/FooterComponent.html +2 -2
- package/docs/html/classes/FooterDirective.html +3 -3
- package/docs/html/classes/FooterService.html +5 -5
- package/docs/html/classes/HeaderComponent.html +2 -2
- package/docs/html/classes/HeaderDirective.html +3 -3
- package/docs/html/classes/HeaderService.html +5 -5
- package/docs/html/classes/LayoutComponent.html +2 -2
- package/docs/html/classes/LayoutService.html +2 -2
- package/docs/html/classes/LogoService.html +2 -2
- package/docs/html/classes/MinimalLayoutComponent.html +2 -2
- package/docs/html/classes/NavigationComponent.html +2 -9
- package/docs/html/classes/NavigationItemComponent.html +3 -19
- package/docs/html/classes/NavigationProgressBarComponent.html +2 -2
- package/docs/html/classes/NavigationService.html +3 -3
- package/docs/html/classes/ReleaseInfoComponent.html +2 -2
- package/docs/html/classes/SettingsButtonComponent.html +2 -2
- package/docs/html/classes/SidenavComponent.html +3 -3
- package/docs/html/classes/SidenavFooterDirective.html +2 -2
- package/docs/html/classes/SidenavHeaderDirective.html +2 -2
- package/docs/html/classes/SidenavToggleButtonComponent.html +2 -2
- package/docs/html/classes/UserProfileIconComponent.html +2 -2
- package/docs/html/functions/IsNavigationDividerItem.html +1 -1
- package/docs/html/functions/IsNavigationInsertItem.html +1 -1
- package/docs/html/functions/IsNavigationItem.html +1 -1
- package/docs/html/functions/provideExternalApps.html +1 -1
- package/docs/html/functions/provideLayout.html +1 -1
- package/docs/html/functions/withDefaultHeaderComponent.html +1 -1
- package/docs/html/functions/withDefaultHeaderItems.html +1 -1
- package/docs/html/functions/withFooterComponents.html +1 -1
- package/docs/html/functions/withHeaderComponents.html +1 -1
- package/docs/html/functions/withNavigationConfig.html +1 -1
- package/docs/html/functions/withNavigationInserts.html +1 -1
- package/docs/html/functions/withReleaseInfoModules.html +1 -1
- package/docs/html/functions/withSettingsMenuItems.html +1 -1
- package/docs/html/functions/withUserProfileDataSource.html +1 -1
- package/docs/html/index.html +2 -2
- package/docs/html/interfaces/NavigationDividerItem.html +2 -2
- package/docs/html/interfaces/NavigationInsertItem.html +2 -2
- package/docs/html/interfaces/NavigationItem.html +2 -2
- package/docs/html/interfaces/NavigationStatus.html +2 -2
- package/docs/html/interfaces/ReleaseInfoModule.html +2 -2
- package/docs/html/interfaces/SettingsMenuItem.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/html/types/DefaultHeaderItemComponent.html +1 -1
- package/docs/html/types/ExternalApp.html +1 -1
- package/docs/html/types/ExtractUsernameFromProfileFn.html +1 -1
- package/docs/html/types/Navigation.html +1 -1
- package/docs/html/types/NavigationWithInserts.html +1 -1
- package/docs/html/types/SettingsMenuItemComponent.html +1 -1
- package/docs/html/variables/EXTRACT_USERNAME_FROM_PROFILE.html +1 -1
- package/docs/html/variables/RXAP_DEFAULT_HEADER_ITEM_COMPONENT.html +1 -1
- package/docs/html/variables/RXAP_EXTERNAL_APP.html +1 -1
- package/docs/html/variables/RXAP_EXTERNAL_APP_FILTER.html +1 -1
- package/docs/html/variables/RXAP_FOOTER_COMPONENT.html +1 -1
- package/docs/html/variables/RXAP_HEADER_COMPONENT.html +1 -1
- package/docs/html/variables/RXAP_LAYOUT_APPS_GRID.html +1 -1
- package/docs/html/variables/RXAP_LOGO_CONFIG.html +1 -1
- package/docs/html/variables/RXAP_LOGO_CONFIG_DEFAULTS.html +1 -1
- package/docs/html/variables/RXAP_NAVIGATION_CONFIG.html +1 -1
- package/docs/html/variables/RXAP_NAVIGATION_CONFIG_INSERTS.html +1 -1
- package/docs/html/variables/RXAP_NAVIGATION_LAYOUT_CONFIG_DEFAULTS.html +1 -1
- package/docs/html/variables/RXAP_RELEASE_INFO_MODULE.html +1 -1
- package/docs/html/variables/RXAP_SETTINGS_MENU_ITEM.html +1 -1
- package/docs/html/variables/RXAP_SETTINGS_MENU_ITEM_COMPONENT.html +1 -1
- package/docs/html/variables/RXAP_USER_PROFILE_DATA_SOURCE.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/AppsButtonComponent.md +9 -33
- package/docs/markdown/classes/BaseLayoutComponent.md +2 -2
- package/docs/markdown/classes/DefaultHeaderComponent.md +10 -10
- package/docs/markdown/classes/DefaultHeaderService.md +6 -6
- package/docs/markdown/classes/ExternalAppsService.md +18 -18
- package/docs/markdown/classes/FooterComponent.md +5 -5
- package/docs/markdown/classes/FooterDirective.md +4 -4
- package/docs/markdown/classes/FooterService.md +6 -6
- package/docs/markdown/classes/HeaderComponent.md +6 -6
- package/docs/markdown/classes/HeaderDirective.md +4 -4
- package/docs/markdown/classes/HeaderService.md +6 -6
- package/docs/markdown/classes/LayoutComponent.md +6 -6
- package/docs/markdown/classes/LayoutService.md +18 -24
- package/docs/markdown/classes/LogoService.md +6 -6
- package/docs/markdown/classes/MinimalLayoutComponent.md +2 -2
- package/docs/markdown/classes/NavigationComponent.md +16 -50
- package/docs/markdown/classes/NavigationItemComponent.md +19 -115
- package/docs/markdown/classes/NavigationProgressBarComponent.md +4 -4
- package/docs/markdown/classes/NavigationService.md +16 -26
- package/docs/markdown/classes/ReleaseInfoComponent.md +6 -6
- package/docs/markdown/classes/SettingsButtonComponent.md +19 -19
- package/docs/markdown/classes/SidenavComponent.md +18 -18
- package/docs/markdown/classes/SidenavFooterDirective.md +4 -12
- package/docs/markdown/classes/SidenavHeaderDirective.md +4 -12
- package/docs/markdown/classes/SidenavToggleButtonComponent.md +5 -5
- package/docs/markdown/classes/UserProfileIconComponent.md +7 -7
- 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 +2 -2
- package/docs/markdown/functions/withFooterComponents.md +2 -2
- package/docs/markdown/functions/withHeaderComponents.md +2 -2
- package/docs/markdown/functions/withNavigationConfig.md +2 -2
- package/docs/markdown/functions/withNavigationInserts.md +2 -2
- package/docs/markdown/functions/withReleaseInfoModules.md +2 -2
- package/docs/markdown/functions/withSettingsMenuItems.md +2 -2
- package/docs/markdown/functions/withUserProfileDataSource.md +2 -2
- package/docs/markdown/globals.md +2 -2
- package/docs/markdown/interfaces/NavigationDividerItem.md +4 -4
- package/docs/markdown/interfaces/NavigationInsertItem.md +3 -3
- package/docs/markdown/interfaces/NavigationItem.md +7 -7
- package/docs/markdown/interfaces/NavigationStatus.md +3 -3
- package/docs/markdown/interfaces/ReleaseInfoModule.md +5 -5
- package/docs/markdown/interfaces/SettingsMenuItem.md +5 -5
- package/docs/markdown/type-aliases/DefaultHeaderItemComponent.md +2 -2
- package/docs/markdown/type-aliases/ExternalApp.md +2 -2
- package/docs/markdown/type-aliases/ExtractUsernameFromProfileFn.md +2 -2
- package/docs/markdown/type-aliases/Navigation.md +2 -2
- package/docs/markdown/type-aliases/NavigationWithInserts.md +2 -2
- package/docs/markdown/type-aliases/SettingsMenuItemComponent.md +2 -2
- package/docs/markdown/variables/EXTRACT_USERNAME_FROM_PROFILE.md +2 -2
- package/docs/markdown/variables/RXAP_DEFAULT_HEADER_ITEM_COMPONENT.md +2 -2
- 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 +2 -2
- 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 +2 -2
- package/docs/markdown/variables/RXAP_USER_PROFILE_DATA_SOURCE.md +2 -2
- package/docs/wiki/Class.AppsButtonComponent.md +8 -32
- package/docs/wiki/Class.BaseLayoutComponent.md +1 -1
- package/docs/wiki/Class.DefaultHeaderComponent.md +9 -9
- package/docs/wiki/Class.DefaultHeaderService.md +5 -5
- package/docs/wiki/Class.ExternalAppsService.md +17 -17
- package/docs/wiki/Class.FooterComponent.md +4 -4
- package/docs/wiki/Class.FooterDirective.md +3 -3
- package/docs/wiki/Class.FooterService.md +5 -5
- package/docs/wiki/Class.HeaderComponent.md +5 -5
- package/docs/wiki/Class.HeaderDirective.md +3 -3
- package/docs/wiki/Class.HeaderService.md +5 -5
- package/docs/wiki/Class.LayoutComponent.md +5 -5
- package/docs/wiki/Class.LayoutService.md +17 -23
- package/docs/wiki/Class.LogoService.md +5 -5
- package/docs/wiki/Class.MinimalLayoutComponent.md +1 -1
- package/docs/wiki/Class.NavigationComponent.md +15 -49
- package/docs/wiki/Class.NavigationItemComponent.md +18 -114
- package/docs/wiki/Class.NavigationProgressBarComponent.md +3 -3
- package/docs/wiki/Class.NavigationService.md +15 -25
- package/docs/wiki/Class.ReleaseInfoComponent.md +5 -5
- package/docs/wiki/Class.SettingsButtonComponent.md +18 -18
- package/docs/wiki/Class.SidenavComponent.md +17 -17
- package/docs/wiki/Class.SidenavFooterDirective.md +3 -11
- package/docs/wiki/Class.SidenavHeaderDirective.md +3 -11
- package/docs/wiki/Class.SidenavToggleButtonComponent.md +4 -4
- package/docs/wiki/Class.UserProfileIconComponent.md +6 -6
- 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 +1 -1
- package/docs/wiki/Function.withFooterComponents.md +1 -1
- package/docs/wiki/Function.withHeaderComponents.md +1 -1
- package/docs/wiki/Function.withNavigationConfig.md +1 -1
- package/docs/wiki/Function.withNavigationInserts.md +1 -1
- package/docs/wiki/Function.withReleaseInfoModules.md +1 -1
- package/docs/wiki/Function.withSettingsMenuItems.md +1 -1
- package/docs/wiki/Function.withUserProfileDataSource.md +1 -1
- package/docs/wiki/Interface.NavigationDividerItem.md +3 -3
- package/docs/wiki/Interface.NavigationInsertItem.md +2 -2
- package/docs/wiki/Interface.NavigationItem.md +6 -6
- package/docs/wiki/Interface.NavigationStatus.md +2 -2
- package/docs/wiki/Interface.ReleaseInfoModule.md +4 -4
- package/docs/wiki/Interface.SettingsMenuItem.md +4 -4
- package/docs/wiki/TypeAlias.DefaultHeaderItemComponent.md +1 -1
- package/docs/wiki/TypeAlias.ExternalApp.md +1 -1
- package/docs/wiki/TypeAlias.ExtractUsernameFromProfileFn.md +1 -1
- package/docs/wiki/TypeAlias.Navigation.md +1 -1
- package/docs/wiki/TypeAlias.NavigationWithInserts.md +1 -1
- package/docs/wiki/TypeAlias.SettingsMenuItemComponent.md +1 -1
- package/docs/wiki/Variable.EXTRACT_USERNAME_FROM_PROFILE.md +1 -1
- package/docs/wiki/Variable.RXAP_DEFAULT_HEADER_ITEM_COMPONENT.md +1 -1
- 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 +1 -1
- 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 +1 -1
- package/docs/wiki/Variable.RXAP_USER_PROFILE_DATA_SOURCE.md +1 -1
- package/docs/wiki/globals.md +1 -1
- package/fesm2022/rxap-layout.mjs +72 -141
- package/fesm2022/rxap-layout.mjs.map +1 -1
- package/package.json +27 -27
- package/src/generators/init/generator.spec.ts +228 -0
- package/types/rxap-layout.d.ts +23 -25
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "21.0.1
|
|
2
|
+
"version": "21.0.1",
|
|
3
3
|
"name": "@rxap/layout",
|
|
4
4
|
"description": "This library provides a set of Angular components and services for creating consistent and configurable application layouts, including headers, footers, side navigation, and content areas. It offers features such as dynamic navigation, external application integration, and customizable themes. The library also includes directives for extending header and footer areas with custom content.\n",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@nx/devkit": "22.7.5",
|
|
8
|
-
"@rxap/ts-morph": "^1.7.1
|
|
9
|
-
"@rxap/workspace-ts-morph": "^22.0.1
|
|
10
|
-
"@rxap/workspace-utilities": "^22.0.1
|
|
8
|
+
"@rxap/ts-morph": "^1.7.1",
|
|
9
|
+
"@rxap/workspace-ts-morph": "^22.0.1",
|
|
10
|
+
"@rxap/workspace-utilities": "^22.0.1",
|
|
11
11
|
"tslib": "2.6.2"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"@angular/core": "^21.2.9",
|
|
18
18
|
"@angular/material": "^21.2.9",
|
|
19
19
|
"@angular/router": "^21.2.9",
|
|
20
|
-
"@rxap/browser-utilities": "^1.1.15
|
|
21
|
-
"@rxap/config": "^21.0.1
|
|
22
|
-
"@rxap/data-source": "^21.0.1
|
|
23
|
-
"@rxap/environment": "^21.0.1
|
|
24
|
-
"@rxap/material-directives": "^21.0.1
|
|
25
|
-
"@rxap/ngx-pub-sub": "^21.0.1
|
|
26
|
-
"@rxap/ngx-theme": "^21.0.1
|
|
27
|
-
"@rxap/pattern": "^1.1.16
|
|
28
|
-
"@rxap/utilities": "^16.5.2
|
|
20
|
+
"@rxap/browser-utilities": "^1.1.15",
|
|
21
|
+
"@rxap/config": "^21.0.1",
|
|
22
|
+
"@rxap/data-source": "^21.0.1",
|
|
23
|
+
"@rxap/environment": "^21.0.1",
|
|
24
|
+
"@rxap/material-directives": "^21.0.1",
|
|
25
|
+
"@rxap/ngx-pub-sub": "^21.0.1",
|
|
26
|
+
"@rxap/ngx-theme": "^21.0.1",
|
|
27
|
+
"@rxap/pattern": "^1.1.16",
|
|
28
|
+
"@rxap/utilities": "^16.5.2",
|
|
29
29
|
"rxjs": "^7.8.2"
|
|
30
30
|
},
|
|
31
31
|
"author": {
|
|
@@ -86,59 +86,59 @@
|
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"package": "@rxap/browser-utilities",
|
|
89
|
-
"version": "1.1.15
|
|
89
|
+
"version": "1.1.15"
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
"package": "@rxap/config",
|
|
93
|
-
"version": "21.0.1
|
|
93
|
+
"version": "21.0.1"
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
"package": "@rxap/data-source",
|
|
97
|
-
"version": "21.0.1
|
|
97
|
+
"version": "21.0.1"
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
"package": "@rxap/data-structure-tree",
|
|
101
|
-
"version": "1.1.19
|
|
101
|
+
"version": "1.1.19"
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
"package": "@rxap/definition",
|
|
105
|
-
"version": "21.0.1
|
|
105
|
+
"version": "21.0.1"
|
|
106
106
|
},
|
|
107
107
|
{
|
|
108
108
|
"package": "@rxap/environment",
|
|
109
|
-
"version": "21.0.1
|
|
109
|
+
"version": "21.0.1"
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
112
|
"package": "@rxap/material-directives",
|
|
113
|
-
"version": "21.0.1
|
|
113
|
+
"version": "21.0.1"
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
"package": "@rxap/ngx-memory",
|
|
117
|
-
"version": "21.0.1
|
|
117
|
+
"version": "21.0.1"
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
"package": "@rxap/ngx-pub-sub",
|
|
121
|
-
"version": "21.0.1
|
|
121
|
+
"version": "21.0.1"
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
"package": "@rxap/ngx-theme",
|
|
125
|
-
"version": "21.0.1
|
|
125
|
+
"version": "21.0.1"
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
"package": "@rxap/pattern",
|
|
129
|
-
"version": "1.1.16
|
|
129
|
+
"version": "1.1.16"
|
|
130
130
|
},
|
|
131
131
|
{
|
|
132
132
|
"package": "@rxap/reflect-metadata",
|
|
133
|
-
"version": "1.0.18
|
|
133
|
+
"version": "1.0.18"
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
136
|
"package": "@rxap/rxjs",
|
|
137
|
-
"version": "1.1.18
|
|
137
|
+
"version": "1.1.18"
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
"package": "@rxap/utilities",
|
|
141
|
-
"version": "16.5.2
|
|
141
|
+
"version": "16.5.2"
|
|
142
142
|
}
|
|
143
143
|
]
|
|
144
144
|
},
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { readJson, Tree, writeJson } from '@nx/devkit';
|
|
2
|
+
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
|
|
3
|
+
import { readFileSync } from 'fs';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
import initGenerator from './generator';
|
|
6
|
+
|
|
7
|
+
const mockFiles: Record<string, string> = ((globalThis as any).__mockFiles = {});
|
|
8
|
+
|
|
9
|
+
jest.mock('fs', () => {
|
|
10
|
+
const actual = jest.requireActual('fs');
|
|
11
|
+
const mockFiles = (): Record<string, string> => (globalThis as any).__mockFiles ?? {};
|
|
12
|
+
return {
|
|
13
|
+
...actual,
|
|
14
|
+
existsSync: (p: string) => p in mockFiles() || actual.existsSync(p),
|
|
15
|
+
readFileSync: (p: string, ...rest: any[]) =>
|
|
16
|
+
p in mockFiles() ? mockFiles()[p] : actual.readFileSync(p, ...rest),
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
jest.mock('@nx/devkit', () => ({
|
|
21
|
+
...jest.requireActual('@nx/devkit'),
|
|
22
|
+
installPackagesTask: jest.fn(),
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
const pkg = JSON.parse(
|
|
26
|
+
readFileSync(join(__dirname, '..', '..', '..', 'package.json'), 'utf-8'),
|
|
27
|
+
);
|
|
28
|
+
const peers: Record<string, string> = pkg.peerDependencies ?? {};
|
|
29
|
+
const peerNames = Object.keys(peers);
|
|
30
|
+
|
|
31
|
+
describe('initGenerator', () => {
|
|
32
|
+
let tree: Tree;
|
|
33
|
+
|
|
34
|
+
beforeEach(() => {
|
|
35
|
+
tree = createTreeWithEmptyWorkspace();
|
|
36
|
+
jest.spyOn(console, 'log').mockImplementation(() => undefined);
|
|
37
|
+
jest.spyOn(console, 'warn').mockImplementation(() => undefined);
|
|
38
|
+
jest.spyOn(console, 'error').mockImplementation(() => undefined);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
afterEach(() => jest.restoreAllMocks());
|
|
42
|
+
|
|
43
|
+
it('is a function exported as default', () => {
|
|
44
|
+
expect(typeof initGenerator).toBe('function');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
if (peerNames.length) {
|
|
48
|
+
it('adds missing peer dependencies to the root package.json', async () => {
|
|
49
|
+
writeJson(tree, 'package.json', {
|
|
50
|
+
name: 'root',
|
|
51
|
+
dependencies: { [pkg.name]: '1.0.0' },
|
|
52
|
+
devDependencies: {},
|
|
53
|
+
});
|
|
54
|
+
await initGenerator(tree, {} as any);
|
|
55
|
+
const json = readJson(tree, 'package.json');
|
|
56
|
+
for (const [dep, version] of Object.entries(peers)) {
|
|
57
|
+
expect(json.dependencies[dep] ?? json.devDependencies[dep]).toBe(
|
|
58
|
+
version,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('does not change package.json when all peers exist', async () => {
|
|
64
|
+
const deps = { [pkg.name]: '1.0.0', ...peers };
|
|
65
|
+
writeJson(tree, 'package.json', {
|
|
66
|
+
name: 'root',
|
|
67
|
+
dependencies: deps,
|
|
68
|
+
devDependencies: {},
|
|
69
|
+
});
|
|
70
|
+
await initGenerator(tree, {} as any);
|
|
71
|
+
expect(readJson(tree, 'package.json').dependencies).toEqual(deps);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('adds peers to devDependencies when the package is a dev dependency', async () => {
|
|
75
|
+
writeJson(tree, 'package.json', {
|
|
76
|
+
name: 'root',
|
|
77
|
+
dependencies: {},
|
|
78
|
+
devDependencies: { [pkg.name]: '1.0.0' },
|
|
79
|
+
});
|
|
80
|
+
await initGenerator(tree, {} as any);
|
|
81
|
+
const json = readJson(tree, 'package.json');
|
|
82
|
+
if (/^@rxap\/(ngx|nest)/.test(pkg.name)) {
|
|
83
|
+
// runtime packages are moved to dependencies
|
|
84
|
+
expect(json.dependencies[pkg.name]).toBe('1.0.0');
|
|
85
|
+
expect(json.devDependencies[pkg.name]).toBeUndefined();
|
|
86
|
+
expect(json.dependencies[peerNames[0]]).toBe(peers[peerNames[0]]);
|
|
87
|
+
} else {
|
|
88
|
+
expect(json.devDependencies[peerNames[0]]).toBe(peers[peerNames[0]]);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
} else {
|
|
92
|
+
it('does nothing when the package declares no peer dependencies', async () => {
|
|
93
|
+
writeJson(tree, 'package.json', { name: 'root', dependencies: {} });
|
|
94
|
+
const before = tree.read('package.json', 'utf-8');
|
|
95
|
+
await initGenerator(tree, {} as any);
|
|
96
|
+
expect(tree.read('package.json', 'utf-8')).toBe(before);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
describe('initGenerator with mocked package metadata', () => {
|
|
102
|
+
const ownPkg = join(__dirname, '..', '..', '..', 'package.json');
|
|
103
|
+
const peerPkg = (name: string) =>
|
|
104
|
+
join('/virtual', 'node_modules', ...name.split('/'), 'package.json');
|
|
105
|
+
let tree: Tree;
|
|
106
|
+
let logs: string[];
|
|
107
|
+
|
|
108
|
+
const setOwn = (json: object) => {
|
|
109
|
+
mockFiles[ownPkg] = JSON.stringify(json);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
beforeEach(() => {
|
|
113
|
+
for (const k of Object.keys(mockFiles)) delete mockFiles[k];
|
|
114
|
+
tree = createTreeWithEmptyWorkspace();
|
|
115
|
+
logs = [];
|
|
116
|
+
jest.spyOn(console, 'log').mockImplementation((m) => void logs.push(String(m)));
|
|
117
|
+
jest.spyOn(console, 'warn').mockImplementation(() => undefined);
|
|
118
|
+
jest.spyOn(console, 'error').mockImplementation(() => undefined);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
afterEach(() => jest.restoreAllMocks());
|
|
122
|
+
|
|
123
|
+
it('logs and returns when package.json is missing', async () => {
|
|
124
|
+
const spy = jest.spyOn(require('fs'), 'existsSync');
|
|
125
|
+
spy.mockImplementation(() => false);
|
|
126
|
+
await initGenerator(tree, {} as any);
|
|
127
|
+
expect(console.error).toHaveBeenCalledWith(
|
|
128
|
+
expect.stringContaining('package.json not found'),
|
|
129
|
+
);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('returns early without peer dependencies', async () => {
|
|
133
|
+
setOwn({ name: '@rxap/x' });
|
|
134
|
+
await initGenerator(tree, {} as any);
|
|
135
|
+
expect(logs).toContain('No peer dependencies found');
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('returns early when no peers are missing', async () => {
|
|
139
|
+
setOwn({ name: '@rxap/x', peerDependencies: { a: '1' } });
|
|
140
|
+
writeJson(tree, 'package.json', { dependencies: { a: '1' } });
|
|
141
|
+
await initGenerator(tree, {} as any);
|
|
142
|
+
expect(logs).toContain('No missing peer dependencies');
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('moves a plugin package from dependencies to devDependencies', async () => {
|
|
146
|
+
setOwn({ name: '@rxap/plugin-x', peerDependencies: { a: '1' } });
|
|
147
|
+
writeJson(tree, 'package.json', {
|
|
148
|
+
dependencies: { '@rxap/plugin-x': '2.0.0' },
|
|
149
|
+
});
|
|
150
|
+
await initGenerator(tree, {} as any);
|
|
151
|
+
const json = readJson(tree, 'package.json');
|
|
152
|
+
expect(json.dependencies['@rxap/plugin-x']).toBeUndefined();
|
|
153
|
+
expect(json.devDependencies['@rxap/plugin-x']).toBe('2.0.0');
|
|
154
|
+
expect(json.devDependencies['a']).toBe('1');
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it('moves a nest package from devDependencies to dependencies', async () => {
|
|
158
|
+
setOwn({ name: '@rxap/nest-x', peerDependencies: { a: '1' } });
|
|
159
|
+
writeJson(tree, 'package.json', {
|
|
160
|
+
devDependencies: { '@rxap/nest-x': '2.0.0' },
|
|
161
|
+
});
|
|
162
|
+
await initGenerator(tree, {} as any);
|
|
163
|
+
const json = readJson(tree, 'package.json');
|
|
164
|
+
expect(json.dependencies['@rxap/nest-x']).toBe('2.0.0');
|
|
165
|
+
expect(json.dependencies['a']).toBe('1');
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
describe('peer init generators', () => {
|
|
169
|
+
const run = async (peerJson?: object, extra: Record<string, string> = {}) => {
|
|
170
|
+
setOwn({ name: '@rxap/nest-x', peerDependencies: { 'peer-a': '1' } });
|
|
171
|
+
writeJson(tree, 'package.json', { dependencies: { '@rxap/nest-x': '1' } });
|
|
172
|
+
if (peerJson) mockFiles[peerPkg('peer-a')] = JSON.stringify(peerJson);
|
|
173
|
+
Object.assign(mockFiles, extra);
|
|
174
|
+
await initGenerator(tree, { project: 'p' } as any);
|
|
175
|
+
};
|
|
176
|
+
const dir = join('/virtual', 'node_modules', 'peer-a');
|
|
177
|
+
|
|
178
|
+
it('skips peers without package.json', async () => {
|
|
179
|
+
await run();
|
|
180
|
+
expect(logs).toContain('Peer dependency peer-a has no package.json');
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
it('skips peers without generators', async () => {
|
|
184
|
+
await run({ name: 'peer-a' });
|
|
185
|
+
expect(logs).toContain('Peer dependency peer-a has no generators or schematics');
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it('skips peers with missing generators file', async () => {
|
|
189
|
+
await run({ generators: './generators.json' });
|
|
190
|
+
expect(logs).toContain('Peer dependency peer-a has no generators or schematics file');
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it('skips peers without init generator', async () => {
|
|
194
|
+
await run({ generators: './generators.json' }, {
|
|
195
|
+
[join(dir, 'generators.json')]: JSON.stringify({ generators: {} }),
|
|
196
|
+
});
|
|
197
|
+
expect(logs).toContain('Peer dependency peer-a has no init generator');
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it('skips peers whose init generator file is missing', async () => {
|
|
201
|
+
await run({ generators: './generators.json' }, {
|
|
202
|
+
[join(dir, 'generators.json')]: JSON.stringify({ generators: { init: { factory: './gen' } } }),
|
|
203
|
+
});
|
|
204
|
+
expect(logs.some((l) => l.includes('has no init generator file'))).toBe(true);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it('skips peers whose init export is not a function', async () => {
|
|
208
|
+
jest.resetModules();
|
|
209
|
+
jest.doMock(join(dir, 'gen'), () => ({ default: 1 }), { virtual: true });
|
|
210
|
+
await run({ generators: './generators.json' }, {
|
|
211
|
+
[join(dir, 'generators.json')]: JSON.stringify({ generators: { init: { factory: './gen' } } }),
|
|
212
|
+
[join(dir, 'gen.js')]: '',
|
|
213
|
+
});
|
|
214
|
+
expect(logs).toContain('Peer dependency peer-a has no init generator function');
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
it('runs the init generator of a peer', async () => {
|
|
218
|
+
const peerInit = jest.fn();
|
|
219
|
+
jest.resetModules();
|
|
220
|
+
jest.doMock(join(dir, 'gen'), () => ({ default: peerInit }), { virtual: true });
|
|
221
|
+
await run({ schematics: './generators.json' }, {
|
|
222
|
+
[join(dir, 'generators.json')]: JSON.stringify({ generators: { init: { factory: './gen' } } }),
|
|
223
|
+
[join(dir, 'gen.js')]: '',
|
|
224
|
+
});
|
|
225
|
+
expect(peerInit).toHaveBeenCalledWith(tree, { project: 'p' });
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
});
|
package/types/rxap-layout.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { TemplateRef, WritableSignal, Signal, Type, InjectionToken, AbstractType,
|
|
2
|
+
import { TemplateRef, WritableSignal, Signal, Type, InjectionToken, AbstractType, OnInit, OnDestroy, Injector, Provider } from '@angular/core';
|
|
3
3
|
import { MatDrawerMode, MatSidenav } from '@angular/material/sidenav';
|
|
4
4
|
import * as dist_packages_utilities_src from 'dist/packages/utilities/src';
|
|
5
|
-
import * as _rxap_config from '@rxap/config';
|
|
6
|
-
import { NavigationConfig, AppsNavigationConfig, ConfigService, LogoConfig } from '@rxap/config';
|
|
7
5
|
import * as _rxap_layout from '@rxap/layout';
|
|
8
6
|
import { MatDialog } from '@angular/material/dialog';
|
|
9
7
|
import { Router } from '@angular/router';
|
|
10
|
-
import { Observable, Subscription } from 'rxjs';
|
|
11
8
|
import { IconConfig, ThemeDensity, Constructor } from '@rxap/utilities';
|
|
9
|
+
import { Observable } from 'rxjs';
|
|
12
10
|
import * as _angular_cdk_portal from '@angular/cdk/portal';
|
|
13
11
|
import { Portal, ComponentType, ComponentPortal } from '@angular/cdk/portal';
|
|
14
12
|
import { ThemePalette } from '@angular/material/core';
|
|
15
13
|
import { PubSubService } from '@rxap/ngx-pub-sub';
|
|
14
|
+
import * as _rxap_config from '@rxap/config';
|
|
15
|
+
import { AppsNavigationConfig, ConfigService, LogoConfig, NavigationConfig } from '@rxap/config';
|
|
16
16
|
import { ThemeService } from '@rxap/ngx-theme';
|
|
17
17
|
import * as dist_packages_angular_config_types_rxap_config from 'dist/packages/angular/config/types/rxap-config';
|
|
18
18
|
import * as _rxap_environment from '@rxap/environment';
|
|
@@ -22,14 +22,12 @@ import { DataSource, MethodWithParameters } from '@rxap/pattern';
|
|
|
22
22
|
|
|
23
23
|
declare class SidenavFooterDirective {
|
|
24
24
|
readonly template: TemplateRef<void>;
|
|
25
|
-
constructor(template: TemplateRef<void>);
|
|
26
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<SidenavFooterDirective, never>;
|
|
27
26
|
static ɵdir: i0.ɵɵDirectiveDeclaration<SidenavFooterDirective, "[rxapSidenavFooter]", never, {}, {}, never, never, true, never>;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
declare class SidenavHeaderDirective {
|
|
31
30
|
readonly template: TemplateRef<void>;
|
|
32
|
-
constructor(template: TemplateRef<void>);
|
|
33
31
|
static ɵfac: i0.ɵɵFactoryDeclaration<SidenavHeaderDirective, never>;
|
|
34
32
|
static ɵdir: i0.ɵɵDirectiveDeclaration<SidenavHeaderDirective, "[rxapSidenavHeader]", never, {}, {}, never, never, true, never>;
|
|
35
33
|
}
|
|
@@ -49,12 +47,12 @@ declare class LayoutService {
|
|
|
49
47
|
private readonly headerService;
|
|
50
48
|
private readonly config;
|
|
51
49
|
private readonly mediaMatcher;
|
|
52
|
-
constructor(
|
|
50
|
+
constructor();
|
|
53
51
|
toggleOpened(): void;
|
|
54
52
|
togglePinned(): void;
|
|
55
53
|
openSidenav(): void;
|
|
56
54
|
closeSidenav(): void;
|
|
57
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LayoutService,
|
|
55
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LayoutService, never>;
|
|
58
56
|
static ɵprov: i0.ɵɵInjectableDeclaration<LayoutService>;
|
|
59
57
|
}
|
|
60
58
|
|
|
@@ -116,22 +114,20 @@ interface NavigationItem<Children = Navigation> extends Record<string, unknown>
|
|
|
116
114
|
}
|
|
117
115
|
declare function IsNavigationItem(item: any): item is NavigationItem;
|
|
118
116
|
|
|
119
|
-
declare class NavigationItemComponent
|
|
117
|
+
declare class NavigationItemComponent {
|
|
120
118
|
readonly level: i0.InputSignal<number>;
|
|
121
|
-
children: Navigation | null
|
|
119
|
+
readonly children: i0.Signal<Navigation | null>;
|
|
122
120
|
readonly item: i0.InputSignal<NavigationItem<Navigation>>;
|
|
123
|
-
readonly active: i0.WritableSignal<boolean>;
|
|
124
121
|
readonly itemClasses: i0.Signal<string>;
|
|
125
122
|
protected readonly layoutService: LayoutService;
|
|
126
123
|
readonly collapsed: i0.Signal<boolean>;
|
|
127
|
-
protected readonly _subscription: Subscription;
|
|
128
124
|
protected readonly router: Router;
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
/**
|
|
126
|
+
* The current router url. Updated (debounced) after each navigation.
|
|
127
|
+
*/
|
|
128
|
+
private readonly currentUrl;
|
|
129
|
+
readonly active: i0.Signal<boolean>;
|
|
131
130
|
onClick(): void;
|
|
132
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
133
|
-
ngAfterViewInit(): void;
|
|
134
|
-
ngOnDestroy(): void;
|
|
135
131
|
isNavigationDividerItem(item: NavigationItem | NavigationDividerItem): item is NavigationDividerItem;
|
|
136
132
|
isNavigationItem(item: NavigationItem | NavigationDividerItem): item is NavigationItem;
|
|
137
133
|
asNavigationItem(item: NavigationItem | NavigationDividerItem): NavigationItem;
|
|
@@ -152,7 +148,7 @@ declare class NavigationService {
|
|
|
152
148
|
private readonly navigation;
|
|
153
149
|
private readonly navigation$;
|
|
154
150
|
private readonly injector;
|
|
155
|
-
constructor(
|
|
151
|
+
constructor();
|
|
156
152
|
/**
|
|
157
153
|
* @deprecated use add instead
|
|
158
154
|
* @param id
|
|
@@ -176,20 +172,22 @@ declare class NavigationService {
|
|
|
176
172
|
*/
|
|
177
173
|
checkNavigationStatusProviders(navigation: Navigation): Observable<Navigation>;
|
|
178
174
|
private replaceInserts;
|
|
179
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NavigationService,
|
|
175
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavigationService, never>;
|
|
180
176
|
static ɵprov: i0.ɵɵInjectableDeclaration<NavigationService>;
|
|
181
177
|
}
|
|
182
178
|
|
|
183
|
-
declare class NavigationComponent
|
|
179
|
+
declare class NavigationComponent {
|
|
184
180
|
items: i0.InputSignal<Navigation | undefined>;
|
|
185
181
|
level: i0.InputSignal<number>;
|
|
186
182
|
protected readonly navigationService: NavigationService;
|
|
187
183
|
protected readonly layoutService: LayoutService;
|
|
188
184
|
readonly collapsed: i0.Signal<boolean>;
|
|
189
|
-
navigationItems: i0.Signal<Navigation>;
|
|
190
185
|
readonly root: i0.InputSignal<boolean>;
|
|
191
|
-
|
|
192
|
-
|
|
186
|
+
/**
|
|
187
|
+
* the navigation items of the configured navigation. Only subscribed if the component is the root navigation
|
|
188
|
+
*/
|
|
189
|
+
private readonly rootItems;
|
|
190
|
+
readonly navigationItems: i0.Signal<Navigation>;
|
|
193
191
|
isNavigationDividerItem(item: NavigationItem | NavigationDividerItem): item is NavigationDividerItem;
|
|
194
192
|
isNavigationItem(item: NavigationItem | NavigationDividerItem): item is NavigationItem;
|
|
195
193
|
asNavigationItem(item: NavigationItem | NavigationDividerItem): NavigationItem;
|
|
@@ -409,7 +407,7 @@ declare class ExternalAppsService {
|
|
|
409
407
|
static ɵprov: i0.ɵɵInjectableDeclaration<ExternalAppsService>;
|
|
410
408
|
}
|
|
411
409
|
|
|
412
|
-
declare class AppsButtonComponent
|
|
410
|
+
declare class AppsButtonComponent {
|
|
413
411
|
/**
|
|
414
412
|
* The signal that indicates if the app list is open
|
|
415
413
|
*/
|
|
@@ -418,7 +416,7 @@ declare class AppsButtonComponent implements OnInit {
|
|
|
418
416
|
readonly appList: i0.Signal<dist_packages_angular_config_types_rxap_config.AppsNavigationConfig[]>;
|
|
419
417
|
readonly hasApps: i0.Signal<boolean>;
|
|
420
418
|
toggle(): void;
|
|
421
|
-
|
|
419
|
+
constructor();
|
|
422
420
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppsButtonComponent, never>;
|
|
423
421
|
static ɵcmp: i0.ɵɵComponentDeclaration<AppsButtonComponent, "rxap-apps-button", never, {}, {}, never, never, true, never>;
|
|
424
422
|
}
|