@worktile/planet 12.1.1 → 14.0.0-next.0
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 +26 -0
- package/application/planet-application-loader.d.ts +73 -0
- package/application/planet-application-loader.d.ts.map +1 -0
- package/application/planet-application-ref.d.ts +36 -0
- package/application/planet-application-ref.d.ts.map +1 -0
- package/application/planet-application.service.d.ts +22 -0
- package/application/planet-application.service.d.ts.map +1 -0
- package/{packages/planet/src/application/portal-application.ts → application/portal-application.d.ts} +5 -18
- package/application/portal-application.d.ts.map +1 -0
- package/assets-loader.d.ts +36 -0
- package/assets-loader.d.ts.map +1 -0
- package/component/planet-component-loader.d.ts +31 -0
- package/component/planet-component-loader.d.ts.map +1 -0
- package/component/planet-component-ref.d.ts +8 -0
- package/component/planet-component-ref.d.ts.map +1 -0
- package/{packages/planet/src/component/plant-component.config.ts → component/plant-component.config.d.ts} +4 -4
- package/component/plant-component.config.d.ts.map +1 -0
- package/debug.d.ts +22 -0
- package/debug.d.ts.map +1 -0
- package/empty/empty.component.d.ts +6 -0
- package/empty/empty.component.d.ts.map +1 -0
- package/esm2020/application/planet-application-loader.mjs +454 -0
- package/esm2020/application/planet-application-ref.mjs +94 -0
- package/esm2020/application/planet-application.service.mjs +85 -0
- package/esm2020/application/portal-application.mjs +16 -0
- package/esm2020/assets-loader.mjs +216 -0
- package/esm2020/component/planet-component-loader.mjs +153 -0
- package/esm2020/component/planet-component-ref.mjs +3 -0
- package/esm2020/component/plant-component.config.mjs +7 -0
- package/esm2020/debug.mjs +33 -0
- package/esm2020/empty/empty.component.mjs +15 -0
- package/esm2020/global-event-dispatcher.mjs +70 -0
- package/esm2020/global-planet.mjs +53 -0
- package/esm2020/helpers.mjs +119 -0
- package/esm2020/module.mjs +31 -0
- package/esm2020/planet.class.mjs +9 -0
- package/esm2020/planet.mjs +91 -0
- package/esm2020/public-api.mjs +18 -0
- package/esm2020/sandbox/constants.mjs +7 -0
- package/esm2020/sandbox/exec.mjs +15 -0
- package/esm2020/sandbox/index.mjs +20 -0
- package/esm2020/sandbox/proxy/patches/document.mjs +12 -0
- package/esm2020/sandbox/proxy/patches/eventListener.mjs +41 -0
- package/esm2020/sandbox/proxy/patches/index.mjs +11 -0
- package/esm2020/sandbox/proxy/patches/storage.mjs +40 -0
- package/esm2020/sandbox/proxy/patches/timer.mjs +43 -0
- package/esm2020/sandbox/proxy/proxies/common.mjs +132 -0
- package/esm2020/sandbox/proxy/proxies/document.mjs +126 -0
- package/esm2020/sandbox/proxy/proxies/window.mjs +158 -0
- package/esm2020/sandbox/proxy/proxy-sandbox.mjs +49 -0
- package/esm2020/sandbox/proxy/types.mjs +2 -0
- package/esm2020/sandbox/sandbox.mjs +7 -0
- package/esm2020/sandbox/snapshot/snapshot-sandbox.mjs +12 -0
- package/esm2020/sandbox/types.mjs +2 -0
- package/esm2020/worktile-planet.mjs +5 -0
- package/fesm2015/worktile-planet.mjs +2049 -0
- package/fesm2015/worktile-planet.mjs.map +1 -0
- package/fesm2020/worktile-planet.mjs +2046 -0
- package/fesm2020/worktile-planet.mjs.map +1 -0
- package/global-event-dispatcher.d.ts +23 -0
- package/global-event-dispatcher.d.ts.map +1 -0
- package/global-planet.d.ts +23 -0
- package/global-planet.d.ts.map +1 -0
- package/helpers.d.ts +39 -0
- package/helpers.d.ts.map +1 -0
- package/index.d.ts +6 -0
- package/module.d.ts +12 -0
- package/module.d.ts.map +1 -0
- package/package.json +27 -120
- package/{packages/planet/src/planet.class.ts → planet.class.d.ts} +5 -26
- package/planet.class.d.ts.map +1 -0
- package/planet.d.ts +28 -0
- package/planet.d.ts.map +1 -0
- package/{packages/planet/src/public-api.ts → public-api.d.ts} +1 -4
- package/public-api.d.ts.map +1 -0
- package/sandbox/constants.d.ts +7 -0
- package/sandbox/constants.d.ts.map +1 -0
- package/sandbox/exec.d.ts +3 -0
- package/sandbox/exec.d.ts.map +1 -0
- package/sandbox/index.d.ts +7 -0
- package/sandbox/index.d.ts.map +1 -0
- package/sandbox/proxy/patches/document.d.ts +3 -0
- package/sandbox/proxy/patches/document.d.ts.map +1 -0
- package/sandbox/proxy/patches/eventListener.d.ts +3 -0
- package/sandbox/proxy/patches/eventListener.d.ts.map +1 -0
- package/sandbox/proxy/patches/index.d.ts +3 -0
- package/sandbox/proxy/patches/index.d.ts.map +1 -0
- package/sandbox/proxy/patches/storage.d.ts +15 -0
- package/sandbox/proxy/patches/storage.d.ts.map +1 -0
- package/sandbox/proxy/patches/timer.d.ts +3 -0
- package/sandbox/proxy/patches/timer.d.ts.map +1 -0
- package/sandbox/proxy/proxies/common.d.ts +13 -0
- package/sandbox/proxy/proxies/common.d.ts.map +1 -0
- package/sandbox/proxy/proxies/document.d.ts +14 -0
- package/sandbox/proxy/proxies/document.d.ts.map +1 -0
- package/sandbox/proxy/proxies/window.d.ts +13 -0
- package/sandbox/proxy/proxies/window.d.ts.map +1 -0
- package/sandbox/proxy/proxy-sandbox.d.ts +16 -0
- package/sandbox/proxy/proxy-sandbox.d.ts.map +1 -0
- package/{packages/planet/src/sandbox/proxy/types.ts → sandbox/proxy/types.d.ts} +2 -8
- package/sandbox/proxy/types.d.ts.map +1 -0
- package/sandbox/sandbox.d.ts +12 -0
- package/sandbox/sandbox.d.ts.map +1 -0
- package/sandbox/snapshot/snapshot-sandbox.d.ts +9 -0
- package/sandbox/snapshot/snapshot-sandbox.d.ts.map +1 -0
- package/sandbox/types.d.ts +2 -0
- package/sandbox/types.d.ts.map +1 -0
- package/worktile-planet.d.ts.map +1 -0
- package/.all-contributorsrc +0 -84
- package/.circleci/config.yml +0 -17
- package/.coveralls.yml +0 -1
- package/.docgeni/public/assets/favicon.ico +0 -0
- package/.docgeni/public/index.html +0 -13
- package/.docgenirc.js +0 -35
- package/.dockerignore +0 -1
- package/.editorconfig +0 -22
- package/.github/FUNDING.yml +0 -12
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.prettierignore +0 -7
- package/.prettierrc +0 -28
- package/.travis.yml +0 -26
- package/.wpmrc.js +0 -11
- package/CODE_OF_CONDUCT.md +0 -76
- package/Dockerfile +0 -11
- package/README.zh-CN.md +0 -307
- package/SECURITY.md +0 -21
- package/angular.json +0 -373
- package/commitlint.config.js +0 -6
- package/docs/api/defineApplication.md +0 -46
- package/docs/api/globalEventDispatcher.md +0 -51
- package/docs/api/index.md +0 -5
- package/docs/api/planet.md +0 -117
- package/docs/guides/getting-started.md +0 -174
- package/docs/guides/index.md +0 -5
- package/docs/guides/intro.md +0 -216
- package/examples/app1/browserslist +0 -11
- package/examples/app1/extra-webpack.config.js +0 -33
- package/examples/app1/karma.conf.js +0 -31
- package/examples/app1/postcss.config.js +0 -1
- package/examples/app1/src/app/app.module.ts +0 -44
- package/examples/app1/src/app/app.routing.ts +0 -49
- package/examples/app1/src/app/counter.service.ts +0 -16
- package/examples/app1/src/app/dashboard/dashboard.component.html +0 -51
- package/examples/app1/src/app/dashboard/dashboard.component.ts +0 -70
- package/examples/app1/src/app/detail/detail.component.html +0 -8
- package/examples/app1/src/app/detail/detail.component.ts +0 -18
- package/examples/app1/src/app/overlay.ts +0 -26
- package/examples/app1/src/app/projects/dialog/projects-dialog.component.html +0 -10
- package/examples/app1/src/app/projects/dialog/projects-dialog.component.ts +0 -41
- package/examples/app1/src/app/projects/projects.component.ts +0 -33
- package/examples/app1/src/app/root/root.component.css +0 -3
- package/examples/app1/src/app/root/root.component.html +0 -16
- package/examples/app1/src/app/root/root.component.ts +0 -35
- package/examples/app1/src/app/services/initialized-data.resolver.ts +0 -15
- package/examples/app1/src/app/shared.module.ts +0 -57
- package/examples/app1/src/app/user/detail/user-detail.component.html +0 -5
- package/examples/app1/src/app/user/detail/user-detail.component.ts +0 -20
- package/examples/app1/src/app/user/user-list.component.html +0 -7
- package/examples/app1/src/app/user/user-list.component.ts +0 -20
- package/examples/app1/src/app/user/user.module.ts +0 -31
- package/examples/app1/src/assets/.gitkeep +0 -0
- package/examples/app1/src/assets/github.png +0 -0
- package/examples/app1/src/assets/main.css +0 -3
- package/examples/app1/src/environments/environment.prod.ts +0 -3
- package/examples/app1/src/environments/environment.ts +0 -16
- package/examples/app1/src/favicon.ico +0 -0
- package/examples/app1/src/index.html +0 -14
- package/examples/app1/src/main.ts +0 -35
- package/examples/app1/src/polyfills.ts +0 -84
- package/examples/app1/src/styles.scss +0 -35
- package/examples/app1/src/test.ts +0 -14
- package/examples/app1/temp.js +0 -221
- package/examples/app1/tsconfig.app.json +0 -10
- package/examples/app1/tsconfig.spec.json +0 -18
- package/examples/app1/tslint.json +0 -17
- package/examples/app1/webpack.config.js +0 -127
- package/examples/app2/browserslist +0 -11
- package/examples/app2/extra-webpack.config.js +0 -32
- package/examples/app2/karma.conf.js +0 -31
- package/examples/app2/src/app/app.module.ts +0 -90
- package/examples/app2/src/app/dashboard/dashboard.component.html +0 -21
- package/examples/app2/src/app/dashboard/dashboard.component.ts +0 -27
- package/examples/app2/src/app/overlay.ts +0 -26
- package/examples/app2/src/app/projects/detail/detail.component.html +0 -16
- package/examples/app2/src/app/projects/detail/detail.component.ts +0 -21
- package/examples/app2/src/app/projects/project-list.component.html +0 -29
- package/examples/app2/src/app/projects/project-list.component.ts +0 -58
- package/examples/app2/src/app/projects/project.resolver.ts +0 -15
- package/examples/app2/src/app/projects/projects.service.ts +0 -28
- package/examples/app2/src/app/projects/tasks/tasks.component.html +0 -10
- package/examples/app2/src/app/projects/tasks/tasks.component.ts +0 -16
- package/examples/app2/src/app/projects/view/view.component.html +0 -1
- package/examples/app2/src/app/projects/view/view.component.ts +0 -20
- package/examples/app2/src/app/root/root.component.html +0 -14
- package/examples/app2/src/app/root/root.component.scss +0 -12
- package/examples/app2/src/app/root/root.component.ts +0 -28
- package/examples/app2/src/app/shared.module.ts +0 -59
- package/examples/app2/src/assets/.gitkeep +0 -0
- package/examples/app2/src/environments/environment.prod.ts +0 -3
- package/examples/app2/src/environments/environment.ts +0 -16
- package/examples/app2/src/favicon.ico +0 -0
- package/examples/app2/src/index.html +0 -14
- package/examples/app2/src/main.ts +0 -36
- package/examples/app2/src/polyfills.ts +0 -84
- package/examples/app2/src/styles.scss +0 -28
- package/examples/app2/src/test.ts +0 -14
- package/examples/app2/tsconfig.app.json +0 -10
- package/examples/app2/tsconfig.spec.json +0 -18
- package/examples/app2/tslint.json +0 -7
- package/examples/app2/webpack.config.js +0 -92
- package/examples/common/app-root-context.ts +0 -10
- package/examples/common/cache.ts +0 -82
- package/examples/common/index.ts +0 -13
- package/examples/common/module.ts +0 -10
- package/examples/common/overlay-container.service.ts +0 -28
- package/examples/common/section-card/section-card.component.html +0 -5
- package/examples/common/section-card/section-card.component.scss +0 -15
- package/examples/common/section-card/section-card.component.ts +0 -11
- package/examples/common/utils.ts +0 -0
- package/examples/portal/src/app/a-detail/a-detail.component.html +0 -8
- package/examples/portal/src/app/a-detail/a-detail.component.ts +0 -18
- package/examples/portal/src/app/about/about.component.html +0 -27
- package/examples/portal/src/app/about/about.component.scss +0 -0
- package/examples/portal/src/app/about/about.component.spec.ts +0 -26
- package/examples/portal/src/app/about/about.component.ts +0 -26
- package/examples/portal/src/app/app-routing.module.ts +0 -57
- package/examples/portal/src/app/app.component.html +0 -73
- package/examples/portal/src/app/app.component.scss +0 -58
- package/examples/portal/src/app/app.component.spec.ts +0 -33
- package/examples/portal/src/app/app.component.ts +0 -111
- package/examples/portal/src/app/app.module.ts +0 -64
- package/examples/portal/src/app/custom-settings.service.ts +0 -44
- package/examples/portal/src/app/overlay.ts +0 -26
- package/examples/portal/src/app/settings/settings.component.html +0 -31
- package/examples/portal/src/app/settings/settings.component.scss +0 -3
- package/examples/portal/src/app/settings/settings.component.ts +0 -43
- package/examples/portal/src/assets/.gitkeep +0 -0
- package/examples/portal/src/assets/apps.json +0 -29
- package/examples/portal/src/assets/icons/sprite.defs.svg +0 -1
- package/examples/portal/src/assets/images/logo.svg +0 -16
- package/examples/portal/src/assets/ngx-planet-micro-front-end.gif +0 -0
- package/examples/portal/src/browserslist +0 -11
- package/examples/portal/src/environments/environment.prod.ts +0 -3
- package/examples/portal/src/environments/environment.ts +0 -16
- package/examples/portal/src/extra-webpack.config.js +0 -32
- package/examples/portal/src/favicon.ico +0 -0
- package/examples/portal/src/index.html +0 -14
- package/examples/portal/src/karma.conf.js +0 -31
- package/examples/portal/src/main.ts +0 -18
- package/examples/portal/src/polyfills.ts +0 -84
- package/examples/portal/src/reboot.scss +0 -14
- package/examples/portal/src/styles.scss +0 -14
- package/examples/portal/src/test.ts +0 -14
- package/examples/portal/src/tsconfig.app.json +0 -10
- package/examples/portal/src/tsconfig.spec.json +0 -9
- package/examples/portal/src/tslint.json +0 -7
- package/extra-webpack.config.js +0 -5
- package/nginx.conf +0 -17
- package/packages/planet/karma.conf.js +0 -37
- package/packages/planet/ng-package.json +0 -7
- package/packages/planet/package.json +0 -10
- package/packages/planet/src/application/planet-application-loader.spec.ts +0 -1102
- package/packages/planet/src/application/planet-application-loader.ts +0 -549
- package/packages/planet/src/application/planet-application-ref.spec.ts +0 -233
- package/packages/planet/src/application/planet-application-ref.ts +0 -131
- package/packages/planet/src/application/planet-application.service.spec.ts +0 -145
- package/packages/planet/src/application/planet-application.service.ts +0 -88
- package/packages/planet/src/application/portal-application.spec.ts +0 -53
- package/packages/planet/src/assets-loader.spec.ts +0 -689
- package/packages/planet/src/assets-loader.ts +0 -247
- package/packages/planet/src/component/planet-component-loader.spec.ts +0 -187
- package/packages/planet/src/component/planet-component-loader.ts +0 -173
- package/packages/planet/src/component/planet-component-ref.ts +0 -8
- package/packages/planet/src/debug.spec.ts +0 -58
- package/packages/planet/src/debug.ts +0 -66
- package/packages/planet/src/empty/empty.component.spec.ts +0 -34
- package/packages/planet/src/empty/empty.component.ts +0 -7
- package/packages/planet/src/global-event-dispatcher.spec.ts +0 -81
- package/packages/planet/src/global-event-dispatcher.ts +0 -82
- package/packages/planet/src/global-planet.spec.ts +0 -39
- package/packages/planet/src/global-planet.ts +0 -73
- package/packages/planet/src/helpers.spec.ts +0 -242
- package/packages/planet/src/helpers.ts +0 -125
- package/packages/planet/src/module.spec.ts +0 -79
- package/packages/planet/src/module.ts +0 -25
- package/packages/planet/src/planet.spec.ts +0 -226
- package/packages/planet/src/planet.ts +0 -113
- package/packages/planet/src/sandbox/constants.ts +0 -6
- package/packages/planet/src/sandbox/exec.ts +0 -22
- package/packages/planet/src/sandbox/index.ts +0 -24
- package/packages/planet/src/sandbox/proxy/patches/document.ts +0 -13
- package/packages/planet/src/sandbox/proxy/patches/eventListener.ts +0 -49
- package/packages/planet/src/sandbox/proxy/patches/index.ts +0 -13
- package/packages/planet/src/sandbox/proxy/patches/storage.ts +0 -53
- package/packages/planet/src/sandbox/proxy/patches/timer.ts +0 -50
- package/packages/planet/src/sandbox/proxy/proxies/common.ts +0 -137
- package/packages/planet/src/sandbox/proxy/proxies/document.ts +0 -140
- package/packages/planet/src/sandbox/proxy/proxies/window.ts +0 -176
- package/packages/planet/src/sandbox/proxy/proxy-sandbox.ts +0 -59
- package/packages/planet/src/sandbox/sandbox.ts +0 -20
- package/packages/planet/src/sandbox/snapshot/snapshot-sandbox.ts +0 -12
- package/packages/planet/src/sandbox/types.ts +0 -1
- package/packages/planet/src/test.ts +0 -16
- package/packages/planet/src/testing/app1.module.ts +0 -34
- package/packages/planet/src/testing/app2.module.ts +0 -24
- package/packages/planet/src/testing/applications.ts +0 -58
- package/packages/planet/src/testing/index.ts +0 -2
- package/packages/planet/src/testing/utils.ts +0 -31
- package/packages/planet/tsconfig.lib.json +0 -27
- package/packages/planet/tsconfig.lib.prod.json +0 -9
- package/packages/planet/tsconfig.spec.json +0 -17
- package/packages/planet/tslint.json +0 -7
- package/postcss.config.js +0 -3
- package/proxy.conf.js +0 -15
- package/tsconfig.json +0 -23
- package/tslint.json +0 -80
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { Component, OnInit, ChangeDetectorRef, ApplicationRef, NgZone, HostBinding } from '@angular/core';
|
|
2
|
-
import { Planet, SwitchModes, GlobalEventDispatcher, ApplicationStatus, PlanetApplication } from 'ngx-planet';
|
|
3
|
-
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
|
|
4
|
-
import { ThyDialog } from 'ngx-tethys/dialog';
|
|
5
|
-
import { ADetailComponent } from './a-detail/a-detail.component';
|
|
6
|
-
import { ThyNotifyService } from 'ngx-tethys/notify';
|
|
7
|
-
import { AppRootContext } from '@demo/common';
|
|
8
|
-
import { CustomSettingsService } from './custom-settings.service';
|
|
9
|
-
import { debug } from 'debug';
|
|
10
|
-
|
|
11
|
-
@Component({
|
|
12
|
-
selector: 'app-root',
|
|
13
|
-
templateUrl: './app.component.html'
|
|
14
|
-
})
|
|
15
|
-
export class AppComponent implements OnInit {
|
|
16
|
-
// @HostBinding('class.portal') class = true;
|
|
17
|
-
|
|
18
|
-
title = 'ngx-planet';
|
|
19
|
-
|
|
20
|
-
activeAppNames: string[] = [];
|
|
21
|
-
|
|
22
|
-
get loadingDone() {
|
|
23
|
-
return this.planet.loadingDone;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
constructor(
|
|
27
|
-
private customSettingsService: CustomSettingsService,
|
|
28
|
-
private planet: Planet,
|
|
29
|
-
private globalEventDispatcher: GlobalEventDispatcher,
|
|
30
|
-
private thyDialog: ThyDialog,
|
|
31
|
-
private thyNotify: ThyNotifyService,
|
|
32
|
-
public appRootContext: AppRootContext
|
|
33
|
-
) {}
|
|
34
|
-
|
|
35
|
-
ngOnInit() {
|
|
36
|
-
this.planet.setOptions({
|
|
37
|
-
switchMode: SwitchModes.coexist,
|
|
38
|
-
errorHandler: error => {
|
|
39
|
-
this.thyNotify.error(`错误`, '加载资源失败');
|
|
40
|
-
console.error(error);
|
|
41
|
-
},
|
|
42
|
-
debugFactory: debug
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
this.appRootContext.setName(`my name is app root context`);
|
|
46
|
-
|
|
47
|
-
this.planet.setPortalAppData({
|
|
48
|
-
appRootContext: this.appRootContext
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const appHostClass = 'thy-layout';
|
|
52
|
-
|
|
53
|
-
const settings = this.customSettingsService.get();
|
|
54
|
-
this.planet.registerApps([
|
|
55
|
-
{
|
|
56
|
-
name: 'app1',
|
|
57
|
-
hostParent: '#app-host-container',
|
|
58
|
-
hostClass: appHostClass,
|
|
59
|
-
routerPathPrefix: /\/app1|app4/, // '/app1',
|
|
60
|
-
resourcePathPrefix: '/static/app1/',
|
|
61
|
-
preload: settings.app1.preload,
|
|
62
|
-
switchMode: settings.app1.switchMode,
|
|
63
|
-
loadSerial: true,
|
|
64
|
-
stylePrefix: 'app1',
|
|
65
|
-
// prettier-ignore
|
|
66
|
-
scripts: [
|
|
67
|
-
'main.js',
|
|
68
|
-
// 'polyfills.js'
|
|
69
|
-
],
|
|
70
|
-
styles: ['styles.css'],
|
|
71
|
-
manifest: '/static/app1/assets-manifest.json',
|
|
72
|
-
extra: {
|
|
73
|
-
name: '应用1',
|
|
74
|
-
color: '#ffa415'
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: 'app2',
|
|
79
|
-
hostParent: '#app-host-container',
|
|
80
|
-
hostClass: appHostClass,
|
|
81
|
-
routerPathPrefix: '/app2',
|
|
82
|
-
resourcePathPrefix: '/static/app2/',
|
|
83
|
-
preload: settings.app2.preload,
|
|
84
|
-
switchMode: settings.app2.switchMode,
|
|
85
|
-
sandbox: true,
|
|
86
|
-
stylePrefix: 'app2',
|
|
87
|
-
// prettier-ignore
|
|
88
|
-
scripts: [
|
|
89
|
-
'main.js'
|
|
90
|
-
],
|
|
91
|
-
styles: ['styles.css'],
|
|
92
|
-
manifest: '/static/app2/assets-manifest.json',
|
|
93
|
-
extra: {
|
|
94
|
-
name: '应用2',
|
|
95
|
-
color: '#66c060'
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
]);
|
|
99
|
-
|
|
100
|
-
this.planet.start();
|
|
101
|
-
|
|
102
|
-
this.globalEventDispatcher.register('openADetail').subscribe(event => {
|
|
103
|
-
this.thyDialog.open(ADetailComponent);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
this.planet.appsLoadingStart.subscribe(event => {
|
|
107
|
-
this.activeAppNames = event.shouldLoadApps.map(item => item.name);
|
|
108
|
-
console.log(`active app names: ${this.activeAppNames.join(',')}`);
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { BrowserModule, DomSanitizer } from '@angular/platform-browser';
|
|
3
|
-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
4
|
-
import { NgModule } from '@angular/core';
|
|
5
|
-
|
|
6
|
-
import { AppRoutingModule } from './app-routing.module';
|
|
7
|
-
import { AppComponent } from './app.component';
|
|
8
|
-
import { AboutComponent } from './about/about.component';
|
|
9
|
-
import { NgxPlanetModule } from 'ngx-planet';
|
|
10
|
-
import { ThyIconModule, ThyIconRegistry } from 'ngx-tethys/icon';
|
|
11
|
-
import { ThyButtonModule } from 'ngx-tethys/button';
|
|
12
|
-
import { ThyDialogModule } from 'ngx-tethys/dialog';
|
|
13
|
-
import { ThyLayoutModule } from 'ngx-tethys/layout';
|
|
14
|
-
import { ThyTableModule } from 'ngx-tethys/table';
|
|
15
|
-
import { ThyNotifyModule } from 'ngx-tethys/notify';
|
|
16
|
-
import { ThyLoadingModule } from 'ngx-tethys/loading';
|
|
17
|
-
import { ThyNavModule } from 'ngx-tethys/nav';
|
|
18
|
-
import { ThyActionMenuModule } from 'ngx-tethys/action-menu';
|
|
19
|
-
import { ThyTooltipModule } from 'ngx-tethys/tooltip';
|
|
20
|
-
import { ThyPopoverModule } from 'ngx-tethys/popover';
|
|
21
|
-
import { ThyFormModule } from 'ngx-tethys/form';
|
|
22
|
-
import { ThyRadioModule } from 'ngx-tethys/radio';
|
|
23
|
-
import { ThyCheckboxModule } from 'ngx-tethys/checkbox';
|
|
24
|
-
import { ADetailComponent } from './a-detail/a-detail.component';
|
|
25
|
-
import { SettingsComponent } from './settings/settings.component';
|
|
26
|
-
import { AppRootContext, DemoCommonModule, OVERLAY_PROVIDER } from '@demo/common';
|
|
27
|
-
import { FormsModule } from '@angular/forms';
|
|
28
|
-
import { Overlay } from '@angular/cdk/overlay';
|
|
29
|
-
import { AppOverlay } from './overlay';
|
|
30
|
-
|
|
31
|
-
@NgModule({
|
|
32
|
-
declarations: [AppComponent, AboutComponent, SettingsComponent, ADetailComponent],
|
|
33
|
-
imports: [
|
|
34
|
-
BrowserModule,
|
|
35
|
-
BrowserAnimationsModule,
|
|
36
|
-
FormsModule,
|
|
37
|
-
CommonModule,
|
|
38
|
-
ThyIconModule,
|
|
39
|
-
ThyButtonModule,
|
|
40
|
-
ThyDialogModule,
|
|
41
|
-
ThyTableModule,
|
|
42
|
-
ThyLayoutModule,
|
|
43
|
-
ThyNotifyModule,
|
|
44
|
-
ThyLoadingModule,
|
|
45
|
-
ThyNavModule,
|
|
46
|
-
ThyActionMenuModule,
|
|
47
|
-
ThyTooltipModule,
|
|
48
|
-
ThyPopoverModule,
|
|
49
|
-
ThyFormModule,
|
|
50
|
-
ThyRadioModule,
|
|
51
|
-
ThyCheckboxModule,
|
|
52
|
-
AppRoutingModule,
|
|
53
|
-
NgxPlanetModule,
|
|
54
|
-
DemoCommonModule
|
|
55
|
-
],
|
|
56
|
-
providers: [AppRootContext, OVERLAY_PROVIDER, { provide: Overlay, useClass: AppOverlay }],
|
|
57
|
-
bootstrap: [AppComponent],
|
|
58
|
-
entryComponents: [ADetailComponent]
|
|
59
|
-
})
|
|
60
|
-
export class AppModule {
|
|
61
|
-
constructor(iconRegistry: ThyIconRegistry, domSanitizer: DomSanitizer) {
|
|
62
|
-
iconRegistry.addSvgIconSet(domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/sprite.defs.svg'));
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { cache } from '@demo/common';
|
|
3
|
-
import { SwitchModes } from 'ngx-planet';
|
|
4
|
-
const SETTINGS_KEY = 'custom-settings';
|
|
5
|
-
|
|
6
|
-
export interface CustomSettingsInfo {
|
|
7
|
-
app1: {
|
|
8
|
-
preload: boolean;
|
|
9
|
-
switchMode?: SwitchModes;
|
|
10
|
-
};
|
|
11
|
-
app2: {
|
|
12
|
-
preload: boolean;
|
|
13
|
-
switchMode?: SwitchModes;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const DEFAULT_SETTINGS: CustomSettingsInfo = {
|
|
18
|
-
app1: {
|
|
19
|
-
preload: true,
|
|
20
|
-
switchMode: SwitchModes.coexist
|
|
21
|
-
},
|
|
22
|
-
app2: {
|
|
23
|
-
preload: true,
|
|
24
|
-
switchMode: SwitchModes.coexist
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
@Injectable({
|
|
29
|
-
providedIn: 'root'
|
|
30
|
-
})
|
|
31
|
-
export class CustomSettingsService {
|
|
32
|
-
get(): CustomSettingsInfo {
|
|
33
|
-
const settings = cache.get<CustomSettingsInfo>(SETTINGS_KEY);
|
|
34
|
-
return settings || JSON.parse(JSON.stringify(DEFAULT_SETTINGS));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
save(settings: CustomSettingsInfo) {
|
|
38
|
-
cache.set<CustomSettingsInfo>(SETTINGS_KEY, settings);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
restore() {
|
|
42
|
-
cache.set<CustomSettingsInfo>(SETTINGS_KEY, DEFAULT_SETTINGS);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Directionality } from '@angular/cdk/bidi';
|
|
2
|
-
import {
|
|
3
|
-
Overlay,
|
|
4
|
-
OverlayConfig,
|
|
5
|
-
OverlayContainer,
|
|
6
|
-
OverlayKeyboardDispatcher,
|
|
7
|
-
OverlayPositionBuilder,
|
|
8
|
-
OverlayRef,
|
|
9
|
-
ScrollStrategyOptions
|
|
10
|
-
} from '@angular/cdk/overlay';
|
|
11
|
-
import { DOCUMENT, Location } from '@angular/common';
|
|
12
|
-
import { ComponentFactoryResolver, Inject, Injectable, Injector, NgZone } from '@angular/core';
|
|
13
|
-
import { isArray, concatArray } from 'ngx-tethys/util';
|
|
14
|
-
|
|
15
|
-
@Injectable({ providedIn: 'root' })
|
|
16
|
-
export class AppOverlay extends Overlay {
|
|
17
|
-
create(config?: OverlayConfig): OverlayRef {
|
|
18
|
-
const overlayConfig: OverlayConfig = {
|
|
19
|
-
...config,
|
|
20
|
-
panelClass: concatArray(config.panelClass, 'portal')
|
|
21
|
-
};
|
|
22
|
-
const overlayRef = super.create(overlayConfig);
|
|
23
|
-
overlayRef.addPanelClass(overlayConfig.panelClass);
|
|
24
|
-
return overlayRef;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<section-card title="Settings">
|
|
2
|
-
<form thyForm name="settings">
|
|
3
|
-
<thy-form-group thyLabelText="Preload" thyLabelPaddingTopClear="true">
|
|
4
|
-
<label thyCheckbox name="app1-preload" thyLabelText="App1 Preload" [(ngModel)]="settings.app1.preload"></label>
|
|
5
|
-
<label thyCheckbox name="app2-preload" thyLabelText="App2 Preload" [(ngModel)]="settings.app2.preload"></label>
|
|
6
|
-
</thy-form-group>
|
|
7
|
-
|
|
8
|
-
<thy-form-group thyLabelText="App1 Switch Mode" thyLabelPaddingTopClear="true">
|
|
9
|
-
<thy-radio-group name="app1SwitchMode" [(ngModel)]="settings.app1.switchMode" thyLayout="flex" required>
|
|
10
|
-
<label thyRadio thyLabelText="Default (Destroy App when not active)" thyValue="default"></label>
|
|
11
|
-
<label thyRadio thyLabelText="Coexist (Hide App when when not active)" thyValue="coexist"></label>
|
|
12
|
-
</thy-radio-group>
|
|
13
|
-
</thy-form-group>
|
|
14
|
-
|
|
15
|
-
<thy-form-group thyLabelText="App2 Switch Mode" thyLabelPaddingTopClear="true">
|
|
16
|
-
<thy-radio-group name="app2SwitchMode" [(ngModel)]="settings.app2.switchMode" thyLayout="flex" required>
|
|
17
|
-
<label thyRadio thyLabelText="Default (Destroy App when not active)" thyValue="default"></label>
|
|
18
|
-
<label thyRadio thyLabelText="Coexist (Hide App when when not active)" thyValue="coexist"></label>
|
|
19
|
-
</thy-radio-group>
|
|
20
|
-
</thy-form-group>
|
|
21
|
-
|
|
22
|
-
<thy-form-group-footer>
|
|
23
|
-
<button thyButton="primary" (thyFormSubmit)="save()">Save</button>
|
|
24
|
-
<button thyButton="link-secondary" (click)="reset()">Reset</button>
|
|
25
|
-
<button thyButton="outline-info" (click)="restore()">Restore to default</button>
|
|
26
|
-
</thy-form-group-footer>
|
|
27
|
-
<!-- <thy-form-group>
|
|
28
|
-
{{ settings | json }}
|
|
29
|
-
</thy-form-group> -->
|
|
30
|
-
</form>
|
|
31
|
-
</section-card>
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Component, OnInit, HostBinding } from '@angular/core';
|
|
2
|
-
import { Router } from '@angular/router';
|
|
3
|
-
import { ThyNotifyService } from 'ngx-tethys/notify';
|
|
4
|
-
import { ADetailComponent } from '../a-detail/a-detail.component';
|
|
5
|
-
import { AppRootContext } from '@demo/common';
|
|
6
|
-
import { CustomSettingsService, CustomSettingsInfo } from '../custom-settings.service';
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'app-settings',
|
|
10
|
-
templateUrl: './settings.component.html',
|
|
11
|
-
styleUrls: ['./settings.component.scss']
|
|
12
|
-
})
|
|
13
|
-
export class SettingsComponent implements OnInit {
|
|
14
|
-
@HostBinding(`class.thy-layout-content`) isThyLayoutContent = true;
|
|
15
|
-
|
|
16
|
-
settings: CustomSettingsInfo;
|
|
17
|
-
|
|
18
|
-
constructor(
|
|
19
|
-
public appRootContext: AppRootContext,
|
|
20
|
-
private customSettingsService: CustomSettingsService,
|
|
21
|
-
private thyNotifyService: ThyNotifyService
|
|
22
|
-
) {}
|
|
23
|
-
|
|
24
|
-
ngOnInit() {
|
|
25
|
-
this.reset();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
save() {
|
|
29
|
-
this.customSettingsService.save(this.settings);
|
|
30
|
-
this.thyNotifyService.success(`Save success`);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
reset() {
|
|
34
|
-
this.settings = {
|
|
35
|
-
...this.customSettingsService.get()
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
restore() {
|
|
40
|
-
this.customSettingsService.restore();
|
|
41
|
-
this.reset();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
File without changes
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"name": "app1",
|
|
4
|
-
"host": "#app-host-container",
|
|
5
|
-
"selector": "app1-root-container",
|
|
6
|
-
"routerPathPrefix": "/app1",
|
|
7
|
-
"hostClass": "thy-layout",
|
|
8
|
-
"preload": false,
|
|
9
|
-
"switchMode": "default",
|
|
10
|
-
"assetsUrl": "/app1/assets/app.json",
|
|
11
|
-
"stylePathPrefix": "",
|
|
12
|
-
"styles": [],
|
|
13
|
-
"scriptPathPrefix": "/app1/assets/",
|
|
14
|
-
"scripts": ["main.js"]
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"name": "app2",
|
|
18
|
-
"host": "#app-host-container",
|
|
19
|
-
"selector": "app2-root-container",
|
|
20
|
-
"routerPathPrefix": "/app2",
|
|
21
|
-
"hostClass": "thy-layout",
|
|
22
|
-
"preload": false,
|
|
23
|
-
"switchMode": "default",
|
|
24
|
-
"stylePathPrefix": "",
|
|
25
|
-
"styles": [],
|
|
26
|
-
"scriptPathPrefix": "/app2/assets/",
|
|
27
|
-
"scripts": ["main.js"]
|
|
28
|
-
}
|
|
29
|
-
]
|