@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.
Files changed (317) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/application/planet-application-loader.d.ts +73 -0
  3. package/application/planet-application-loader.d.ts.map +1 -0
  4. package/application/planet-application-ref.d.ts +36 -0
  5. package/application/planet-application-ref.d.ts.map +1 -0
  6. package/application/planet-application.service.d.ts +22 -0
  7. package/application/planet-application.service.d.ts.map +1 -0
  8. package/{packages/planet/src/application/portal-application.ts → application/portal-application.d.ts} +5 -18
  9. package/application/portal-application.d.ts.map +1 -0
  10. package/assets-loader.d.ts +36 -0
  11. package/assets-loader.d.ts.map +1 -0
  12. package/component/planet-component-loader.d.ts +31 -0
  13. package/component/planet-component-loader.d.ts.map +1 -0
  14. package/component/planet-component-ref.d.ts +8 -0
  15. package/component/planet-component-ref.d.ts.map +1 -0
  16. package/{packages/planet/src/component/plant-component.config.ts → component/plant-component.config.d.ts} +4 -4
  17. package/component/plant-component.config.d.ts.map +1 -0
  18. package/debug.d.ts +22 -0
  19. package/debug.d.ts.map +1 -0
  20. package/empty/empty.component.d.ts +6 -0
  21. package/empty/empty.component.d.ts.map +1 -0
  22. package/esm2020/application/planet-application-loader.mjs +454 -0
  23. package/esm2020/application/planet-application-ref.mjs +94 -0
  24. package/esm2020/application/planet-application.service.mjs +85 -0
  25. package/esm2020/application/portal-application.mjs +16 -0
  26. package/esm2020/assets-loader.mjs +216 -0
  27. package/esm2020/component/planet-component-loader.mjs +153 -0
  28. package/esm2020/component/planet-component-ref.mjs +3 -0
  29. package/esm2020/component/plant-component.config.mjs +7 -0
  30. package/esm2020/debug.mjs +33 -0
  31. package/esm2020/empty/empty.component.mjs +15 -0
  32. package/esm2020/global-event-dispatcher.mjs +70 -0
  33. package/esm2020/global-planet.mjs +53 -0
  34. package/esm2020/helpers.mjs +119 -0
  35. package/esm2020/module.mjs +31 -0
  36. package/esm2020/planet.class.mjs +9 -0
  37. package/esm2020/planet.mjs +91 -0
  38. package/esm2020/public-api.mjs +18 -0
  39. package/esm2020/sandbox/constants.mjs +7 -0
  40. package/esm2020/sandbox/exec.mjs +15 -0
  41. package/esm2020/sandbox/index.mjs +20 -0
  42. package/esm2020/sandbox/proxy/patches/document.mjs +12 -0
  43. package/esm2020/sandbox/proxy/patches/eventListener.mjs +41 -0
  44. package/esm2020/sandbox/proxy/patches/index.mjs +11 -0
  45. package/esm2020/sandbox/proxy/patches/storage.mjs +40 -0
  46. package/esm2020/sandbox/proxy/patches/timer.mjs +43 -0
  47. package/esm2020/sandbox/proxy/proxies/common.mjs +132 -0
  48. package/esm2020/sandbox/proxy/proxies/document.mjs +126 -0
  49. package/esm2020/sandbox/proxy/proxies/window.mjs +158 -0
  50. package/esm2020/sandbox/proxy/proxy-sandbox.mjs +49 -0
  51. package/esm2020/sandbox/proxy/types.mjs +2 -0
  52. package/esm2020/sandbox/sandbox.mjs +7 -0
  53. package/esm2020/sandbox/snapshot/snapshot-sandbox.mjs +12 -0
  54. package/esm2020/sandbox/types.mjs +2 -0
  55. package/esm2020/worktile-planet.mjs +5 -0
  56. package/fesm2015/worktile-planet.mjs +2049 -0
  57. package/fesm2015/worktile-planet.mjs.map +1 -0
  58. package/fesm2020/worktile-planet.mjs +2046 -0
  59. package/fesm2020/worktile-planet.mjs.map +1 -0
  60. package/global-event-dispatcher.d.ts +23 -0
  61. package/global-event-dispatcher.d.ts.map +1 -0
  62. package/global-planet.d.ts +23 -0
  63. package/global-planet.d.ts.map +1 -0
  64. package/helpers.d.ts +39 -0
  65. package/helpers.d.ts.map +1 -0
  66. package/index.d.ts +6 -0
  67. package/module.d.ts +12 -0
  68. package/module.d.ts.map +1 -0
  69. package/package.json +27 -120
  70. package/{packages/planet/src/planet.class.ts → planet.class.d.ts} +5 -26
  71. package/planet.class.d.ts.map +1 -0
  72. package/planet.d.ts +28 -0
  73. package/planet.d.ts.map +1 -0
  74. package/{packages/planet/src/public-api.ts → public-api.d.ts} +1 -4
  75. package/public-api.d.ts.map +1 -0
  76. package/sandbox/constants.d.ts +7 -0
  77. package/sandbox/constants.d.ts.map +1 -0
  78. package/sandbox/exec.d.ts +3 -0
  79. package/sandbox/exec.d.ts.map +1 -0
  80. package/sandbox/index.d.ts +7 -0
  81. package/sandbox/index.d.ts.map +1 -0
  82. package/sandbox/proxy/patches/document.d.ts +3 -0
  83. package/sandbox/proxy/patches/document.d.ts.map +1 -0
  84. package/sandbox/proxy/patches/eventListener.d.ts +3 -0
  85. package/sandbox/proxy/patches/eventListener.d.ts.map +1 -0
  86. package/sandbox/proxy/patches/index.d.ts +3 -0
  87. package/sandbox/proxy/patches/index.d.ts.map +1 -0
  88. package/sandbox/proxy/patches/storage.d.ts +15 -0
  89. package/sandbox/proxy/patches/storage.d.ts.map +1 -0
  90. package/sandbox/proxy/patches/timer.d.ts +3 -0
  91. package/sandbox/proxy/patches/timer.d.ts.map +1 -0
  92. package/sandbox/proxy/proxies/common.d.ts +13 -0
  93. package/sandbox/proxy/proxies/common.d.ts.map +1 -0
  94. package/sandbox/proxy/proxies/document.d.ts +14 -0
  95. package/sandbox/proxy/proxies/document.d.ts.map +1 -0
  96. package/sandbox/proxy/proxies/window.d.ts +13 -0
  97. package/sandbox/proxy/proxies/window.d.ts.map +1 -0
  98. package/sandbox/proxy/proxy-sandbox.d.ts +16 -0
  99. package/sandbox/proxy/proxy-sandbox.d.ts.map +1 -0
  100. package/{packages/planet/src/sandbox/proxy/types.ts → sandbox/proxy/types.d.ts} +2 -8
  101. package/sandbox/proxy/types.d.ts.map +1 -0
  102. package/sandbox/sandbox.d.ts +12 -0
  103. package/sandbox/sandbox.d.ts.map +1 -0
  104. package/sandbox/snapshot/snapshot-sandbox.d.ts +9 -0
  105. package/sandbox/snapshot/snapshot-sandbox.d.ts.map +1 -0
  106. package/sandbox/types.d.ts +2 -0
  107. package/sandbox/types.d.ts.map +1 -0
  108. package/worktile-planet.d.ts.map +1 -0
  109. package/.all-contributorsrc +0 -84
  110. package/.circleci/config.yml +0 -17
  111. package/.coveralls.yml +0 -1
  112. package/.docgeni/public/assets/favicon.ico +0 -0
  113. package/.docgeni/public/index.html +0 -13
  114. package/.docgenirc.js +0 -35
  115. package/.dockerignore +0 -1
  116. package/.editorconfig +0 -22
  117. package/.github/FUNDING.yml +0 -12
  118. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
  119. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  120. package/.prettierignore +0 -7
  121. package/.prettierrc +0 -28
  122. package/.travis.yml +0 -26
  123. package/.wpmrc.js +0 -11
  124. package/CODE_OF_CONDUCT.md +0 -76
  125. package/Dockerfile +0 -11
  126. package/README.zh-CN.md +0 -307
  127. package/SECURITY.md +0 -21
  128. package/angular.json +0 -373
  129. package/commitlint.config.js +0 -6
  130. package/docs/api/defineApplication.md +0 -46
  131. package/docs/api/globalEventDispatcher.md +0 -51
  132. package/docs/api/index.md +0 -5
  133. package/docs/api/planet.md +0 -117
  134. package/docs/guides/getting-started.md +0 -174
  135. package/docs/guides/index.md +0 -5
  136. package/docs/guides/intro.md +0 -216
  137. package/examples/app1/browserslist +0 -11
  138. package/examples/app1/extra-webpack.config.js +0 -33
  139. package/examples/app1/karma.conf.js +0 -31
  140. package/examples/app1/postcss.config.js +0 -1
  141. package/examples/app1/src/app/app.module.ts +0 -44
  142. package/examples/app1/src/app/app.routing.ts +0 -49
  143. package/examples/app1/src/app/counter.service.ts +0 -16
  144. package/examples/app1/src/app/dashboard/dashboard.component.html +0 -51
  145. package/examples/app1/src/app/dashboard/dashboard.component.ts +0 -70
  146. package/examples/app1/src/app/detail/detail.component.html +0 -8
  147. package/examples/app1/src/app/detail/detail.component.ts +0 -18
  148. package/examples/app1/src/app/overlay.ts +0 -26
  149. package/examples/app1/src/app/projects/dialog/projects-dialog.component.html +0 -10
  150. package/examples/app1/src/app/projects/dialog/projects-dialog.component.ts +0 -41
  151. package/examples/app1/src/app/projects/projects.component.ts +0 -33
  152. package/examples/app1/src/app/root/root.component.css +0 -3
  153. package/examples/app1/src/app/root/root.component.html +0 -16
  154. package/examples/app1/src/app/root/root.component.ts +0 -35
  155. package/examples/app1/src/app/services/initialized-data.resolver.ts +0 -15
  156. package/examples/app1/src/app/shared.module.ts +0 -57
  157. package/examples/app1/src/app/user/detail/user-detail.component.html +0 -5
  158. package/examples/app1/src/app/user/detail/user-detail.component.ts +0 -20
  159. package/examples/app1/src/app/user/user-list.component.html +0 -7
  160. package/examples/app1/src/app/user/user-list.component.ts +0 -20
  161. package/examples/app1/src/app/user/user.module.ts +0 -31
  162. package/examples/app1/src/assets/.gitkeep +0 -0
  163. package/examples/app1/src/assets/github.png +0 -0
  164. package/examples/app1/src/assets/main.css +0 -3
  165. package/examples/app1/src/environments/environment.prod.ts +0 -3
  166. package/examples/app1/src/environments/environment.ts +0 -16
  167. package/examples/app1/src/favicon.ico +0 -0
  168. package/examples/app1/src/index.html +0 -14
  169. package/examples/app1/src/main.ts +0 -35
  170. package/examples/app1/src/polyfills.ts +0 -84
  171. package/examples/app1/src/styles.scss +0 -35
  172. package/examples/app1/src/test.ts +0 -14
  173. package/examples/app1/temp.js +0 -221
  174. package/examples/app1/tsconfig.app.json +0 -10
  175. package/examples/app1/tsconfig.spec.json +0 -18
  176. package/examples/app1/tslint.json +0 -17
  177. package/examples/app1/webpack.config.js +0 -127
  178. package/examples/app2/browserslist +0 -11
  179. package/examples/app2/extra-webpack.config.js +0 -32
  180. package/examples/app2/karma.conf.js +0 -31
  181. package/examples/app2/src/app/app.module.ts +0 -90
  182. package/examples/app2/src/app/dashboard/dashboard.component.html +0 -21
  183. package/examples/app2/src/app/dashboard/dashboard.component.ts +0 -27
  184. package/examples/app2/src/app/overlay.ts +0 -26
  185. package/examples/app2/src/app/projects/detail/detail.component.html +0 -16
  186. package/examples/app2/src/app/projects/detail/detail.component.ts +0 -21
  187. package/examples/app2/src/app/projects/project-list.component.html +0 -29
  188. package/examples/app2/src/app/projects/project-list.component.ts +0 -58
  189. package/examples/app2/src/app/projects/project.resolver.ts +0 -15
  190. package/examples/app2/src/app/projects/projects.service.ts +0 -28
  191. package/examples/app2/src/app/projects/tasks/tasks.component.html +0 -10
  192. package/examples/app2/src/app/projects/tasks/tasks.component.ts +0 -16
  193. package/examples/app2/src/app/projects/view/view.component.html +0 -1
  194. package/examples/app2/src/app/projects/view/view.component.ts +0 -20
  195. package/examples/app2/src/app/root/root.component.html +0 -14
  196. package/examples/app2/src/app/root/root.component.scss +0 -12
  197. package/examples/app2/src/app/root/root.component.ts +0 -28
  198. package/examples/app2/src/app/shared.module.ts +0 -59
  199. package/examples/app2/src/assets/.gitkeep +0 -0
  200. package/examples/app2/src/environments/environment.prod.ts +0 -3
  201. package/examples/app2/src/environments/environment.ts +0 -16
  202. package/examples/app2/src/favicon.ico +0 -0
  203. package/examples/app2/src/index.html +0 -14
  204. package/examples/app2/src/main.ts +0 -36
  205. package/examples/app2/src/polyfills.ts +0 -84
  206. package/examples/app2/src/styles.scss +0 -28
  207. package/examples/app2/src/test.ts +0 -14
  208. package/examples/app2/tsconfig.app.json +0 -10
  209. package/examples/app2/tsconfig.spec.json +0 -18
  210. package/examples/app2/tslint.json +0 -7
  211. package/examples/app2/webpack.config.js +0 -92
  212. package/examples/common/app-root-context.ts +0 -10
  213. package/examples/common/cache.ts +0 -82
  214. package/examples/common/index.ts +0 -13
  215. package/examples/common/module.ts +0 -10
  216. package/examples/common/overlay-container.service.ts +0 -28
  217. package/examples/common/section-card/section-card.component.html +0 -5
  218. package/examples/common/section-card/section-card.component.scss +0 -15
  219. package/examples/common/section-card/section-card.component.ts +0 -11
  220. package/examples/common/utils.ts +0 -0
  221. package/examples/portal/src/app/a-detail/a-detail.component.html +0 -8
  222. package/examples/portal/src/app/a-detail/a-detail.component.ts +0 -18
  223. package/examples/portal/src/app/about/about.component.html +0 -27
  224. package/examples/portal/src/app/about/about.component.scss +0 -0
  225. package/examples/portal/src/app/about/about.component.spec.ts +0 -26
  226. package/examples/portal/src/app/about/about.component.ts +0 -26
  227. package/examples/portal/src/app/app-routing.module.ts +0 -57
  228. package/examples/portal/src/app/app.component.html +0 -73
  229. package/examples/portal/src/app/app.component.scss +0 -58
  230. package/examples/portal/src/app/app.component.spec.ts +0 -33
  231. package/examples/portal/src/app/app.component.ts +0 -111
  232. package/examples/portal/src/app/app.module.ts +0 -64
  233. package/examples/portal/src/app/custom-settings.service.ts +0 -44
  234. package/examples/portal/src/app/overlay.ts +0 -26
  235. package/examples/portal/src/app/settings/settings.component.html +0 -31
  236. package/examples/portal/src/app/settings/settings.component.scss +0 -3
  237. package/examples/portal/src/app/settings/settings.component.ts +0 -43
  238. package/examples/portal/src/assets/.gitkeep +0 -0
  239. package/examples/portal/src/assets/apps.json +0 -29
  240. package/examples/portal/src/assets/icons/sprite.defs.svg +0 -1
  241. package/examples/portal/src/assets/images/logo.svg +0 -16
  242. package/examples/portal/src/assets/ngx-planet-micro-front-end.gif +0 -0
  243. package/examples/portal/src/browserslist +0 -11
  244. package/examples/portal/src/environments/environment.prod.ts +0 -3
  245. package/examples/portal/src/environments/environment.ts +0 -16
  246. package/examples/portal/src/extra-webpack.config.js +0 -32
  247. package/examples/portal/src/favicon.ico +0 -0
  248. package/examples/portal/src/index.html +0 -14
  249. package/examples/portal/src/karma.conf.js +0 -31
  250. package/examples/portal/src/main.ts +0 -18
  251. package/examples/portal/src/polyfills.ts +0 -84
  252. package/examples/portal/src/reboot.scss +0 -14
  253. package/examples/portal/src/styles.scss +0 -14
  254. package/examples/portal/src/test.ts +0 -14
  255. package/examples/portal/src/tsconfig.app.json +0 -10
  256. package/examples/portal/src/tsconfig.spec.json +0 -9
  257. package/examples/portal/src/tslint.json +0 -7
  258. package/extra-webpack.config.js +0 -5
  259. package/nginx.conf +0 -17
  260. package/packages/planet/karma.conf.js +0 -37
  261. package/packages/planet/ng-package.json +0 -7
  262. package/packages/planet/package.json +0 -10
  263. package/packages/planet/src/application/planet-application-loader.spec.ts +0 -1102
  264. package/packages/planet/src/application/planet-application-loader.ts +0 -549
  265. package/packages/planet/src/application/planet-application-ref.spec.ts +0 -233
  266. package/packages/planet/src/application/planet-application-ref.ts +0 -131
  267. package/packages/planet/src/application/planet-application.service.spec.ts +0 -145
  268. package/packages/planet/src/application/planet-application.service.ts +0 -88
  269. package/packages/planet/src/application/portal-application.spec.ts +0 -53
  270. package/packages/planet/src/assets-loader.spec.ts +0 -689
  271. package/packages/planet/src/assets-loader.ts +0 -247
  272. package/packages/planet/src/component/planet-component-loader.spec.ts +0 -187
  273. package/packages/planet/src/component/planet-component-loader.ts +0 -173
  274. package/packages/planet/src/component/planet-component-ref.ts +0 -8
  275. package/packages/planet/src/debug.spec.ts +0 -58
  276. package/packages/planet/src/debug.ts +0 -66
  277. package/packages/planet/src/empty/empty.component.spec.ts +0 -34
  278. package/packages/planet/src/empty/empty.component.ts +0 -7
  279. package/packages/planet/src/global-event-dispatcher.spec.ts +0 -81
  280. package/packages/planet/src/global-event-dispatcher.ts +0 -82
  281. package/packages/planet/src/global-planet.spec.ts +0 -39
  282. package/packages/planet/src/global-planet.ts +0 -73
  283. package/packages/planet/src/helpers.spec.ts +0 -242
  284. package/packages/planet/src/helpers.ts +0 -125
  285. package/packages/planet/src/module.spec.ts +0 -79
  286. package/packages/planet/src/module.ts +0 -25
  287. package/packages/planet/src/planet.spec.ts +0 -226
  288. package/packages/planet/src/planet.ts +0 -113
  289. package/packages/planet/src/sandbox/constants.ts +0 -6
  290. package/packages/planet/src/sandbox/exec.ts +0 -22
  291. package/packages/planet/src/sandbox/index.ts +0 -24
  292. package/packages/planet/src/sandbox/proxy/patches/document.ts +0 -13
  293. package/packages/planet/src/sandbox/proxy/patches/eventListener.ts +0 -49
  294. package/packages/planet/src/sandbox/proxy/patches/index.ts +0 -13
  295. package/packages/planet/src/sandbox/proxy/patches/storage.ts +0 -53
  296. package/packages/planet/src/sandbox/proxy/patches/timer.ts +0 -50
  297. package/packages/planet/src/sandbox/proxy/proxies/common.ts +0 -137
  298. package/packages/planet/src/sandbox/proxy/proxies/document.ts +0 -140
  299. package/packages/planet/src/sandbox/proxy/proxies/window.ts +0 -176
  300. package/packages/planet/src/sandbox/proxy/proxy-sandbox.ts +0 -59
  301. package/packages/planet/src/sandbox/sandbox.ts +0 -20
  302. package/packages/planet/src/sandbox/snapshot/snapshot-sandbox.ts +0 -12
  303. package/packages/planet/src/sandbox/types.ts +0 -1
  304. package/packages/planet/src/test.ts +0 -16
  305. package/packages/planet/src/testing/app1.module.ts +0 -34
  306. package/packages/planet/src/testing/app2.module.ts +0 -24
  307. package/packages/planet/src/testing/applications.ts +0 -58
  308. package/packages/planet/src/testing/index.ts +0 -2
  309. package/packages/planet/src/testing/utils.ts +0 -31
  310. package/packages/planet/tsconfig.lib.json +0 -27
  311. package/packages/planet/tsconfig.lib.prod.json +0 -9
  312. package/packages/planet/tsconfig.spec.json +0 -17
  313. package/packages/planet/tslint.json +0 -7
  314. package/postcss.config.js +0 -3
  315. package/proxy.conf.js +0 -15
  316. package/tsconfig.json +0 -23
  317. package/tslint.json +0 -80
@@ -1,70 +0,0 @@
1
- import { Component, Inject, ViewChild, ElementRef, OnInit } from '@angular/core';
2
- import { Router } from '@angular/router';
3
- import { CounterService } from '../counter.service';
4
- import { AppRootContext } from '@demo/common';
5
- import { PlanetComponentRef, PlanetComponentLoader, PlanetPortalApplication, GlobalEventDispatcher } from 'ngx-planet';
6
- import { ThyDialog, ThyDialogSizes } from 'ngx-tethys/dialog';
7
- import { App1DetailComponent } from '../detail/detail.component';
8
- import { ProjectsDialogComponent } from '../projects/dialog/projects-dialog.component';
9
-
10
- @Component({
11
- selector: 'app-dashboard',
12
- templateUrl: './dashboard.component.html'
13
- })
14
- export class DashboardComponent implements OnInit {
15
- @ViewChild('container', { static: true }) containerElementRef: ElementRef<HTMLDivElement>;
16
-
17
- public size: ThyDialogSizes = ThyDialogSizes.md;
18
-
19
- private componentRef: PlanetComponentRef;
20
-
21
- constructor(
22
- private planetPortal: PlanetPortalApplication,
23
- private router: Router,
24
- public counter: CounterService,
25
- private globalEventDispatcher: GlobalEventDispatcher,
26
- public appRootContext: AppRootContext,
27
- private dialog: ThyDialog,
28
- private planetComponentLoader: PlanetComponentLoader
29
- ) {}
30
-
31
- ngOnInit() {}
32
-
33
- openADetail() {
34
- this.globalEventDispatcher.dispatch('openADetail');
35
- }
36
-
37
- openApp1Dialog() {
38
- this.dialog.open(App1DetailComponent, {
39
- size: this.size
40
- });
41
- }
42
-
43
- openApp2Dialog() {
44
- this.dialog.open(ProjectsDialogComponent, {
45
- size: ThyDialogSizes.supperLg
46
- });
47
- }
48
-
49
- openApp2Component() {
50
- this.planetComponentLoader
51
- .load('app2', 'project1', {
52
- container: this.containerElementRef,
53
- initialState: {}
54
- })
55
- .subscribe(componentRef => {
56
- this.componentRef = componentRef;
57
- });
58
- }
59
-
60
- disposeApp2Component() {
61
- if (this.componentRef) {
62
- this.componentRef.dispose();
63
- }
64
- }
65
-
66
- changeName(newName: string) {
67
- this.appRootContext.setName(newName);
68
- this.planetPortal.tick();
69
- }
70
- }
@@ -1,8 +0,0 @@
1
- <thy-dialog-header thyTitle="a Detail from App1"> </thy-dialog-header>
2
- <thy-dialog-body>
3
- <span class="same-name">This is Micro Front-end application example.</span>
4
- <div class="btn-pair mt-2">
5
- <button thyButton="primary-square" (click)="ok()">Ok</button>
6
- <button thyButton="link-secondary" (click)="close()">Cancel</button>
7
- </div>
8
- </thy-dialog-body>
@@ -1,18 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import { ThyDialogRef } from 'ngx-tethys/dialog';
3
-
4
- @Component({
5
- selector: 'app-detail',
6
- templateUrl: './detail.component.html'
7
- })
8
- export class App1DetailComponent {
9
- constructor(private dialogRef: ThyDialogRef<App1DetailComponent>) {}
10
-
11
- ok() {
12
- this.dialogRef.close();
13
- }
14
-
15
- close() {
16
- this.dialogRef.close();
17
- }
18
- }
@@ -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, 'app1')
21
- };
22
- const overlayRef = super.create(overlayConfig);
23
- overlayRef.addPanelClass(overlayConfig.panelClass);
24
- return overlayRef;
25
- }
26
- }
@@ -1,10 +0,0 @@
1
- <thy-dialog-header thyTitle="a Detail from App1"> </thy-dialog-header>
2
- <thy-dialog-body>
3
- <span class="same-name">this is a app2's component </span>
4
- <thy-loading [thyDone]="loadingDone"></thy-loading>
5
- <div #container></div>
6
- </thy-dialog-body>
7
- <thy-dialog-footer [thyDivided]="true">
8
- <button thyButton="primary-square" (click)="ok()">Ok</button>
9
- <button thyButton="link-secondary" (click)="close()">Cancel</button>
10
- </thy-dialog-footer>
@@ -1,41 +0,0 @@
1
- import { Component, ElementRef, EventEmitter, HostBinding, OnInit, ViewChild } from '@angular/core';
2
- import { PlanetComponentLoader } from 'ngx-planet';
3
- import { ThyDialogRef } from 'ngx-tethys/dialog';
4
-
5
- @Component({
6
- selector: 'app-projects-dialog',
7
- templateUrl: `./projects-dialog.component.html`
8
- })
9
- export class ProjectsDialogComponent implements OnInit {
10
- @HostBinding('class.thy-dialog-content') container = true;
11
-
12
- @ViewChild('container', { static: true }) elementRef: ElementRef<HTMLDivElement>;
13
-
14
- loadingDone = false;
15
-
16
- constructor(
17
- private planetComponentLoader: PlanetComponentLoader,
18
- private dialogRef: ThyDialogRef<ProjectsDialogComponent>
19
- ) {}
20
-
21
- ngOnInit() {
22
- this.planetComponentLoader
23
- .load<{ click: EventEmitter<any> }>('app2', 'project1', {
24
- container: this.elementRef
25
- })
26
- .subscribe(componentRef => {
27
- this.loadingDone = true;
28
- componentRef.componentInstance.click.subscribe(() => {
29
- console.log('project item clicked');
30
- });
31
- });
32
- }
33
-
34
- ok() {
35
- this.dialogRef.close();
36
- }
37
-
38
- close() {
39
- this.dialogRef.close();
40
- }
41
- }
@@ -1,33 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
3
- import { PlanetComponentLoader } from 'ngx-planet';
4
-
5
- @Component({
6
- selector: 'app-projects',
7
- template: `
8
- <section-card class="mt-2" title="App2's projects component">
9
- <thy-loading [thyDone]="loadingDone"></thy-loading>
10
- <div #container></div>
11
- </section-card>
12
- `
13
- })
14
- export class ProjectsComponent implements OnInit {
15
- @ViewChild('container', { static: true }) elementRef: ElementRef<HTMLDivElement>;
16
-
17
- loadingDone = false;
18
-
19
- constructor(private planetComponentLoader: PlanetComponentLoader) {}
20
-
21
- ngOnInit() {
22
- this.planetComponentLoader
23
- .load<{ click: Observable<unknown> }>('app2', 'project1', {
24
- container: this.elementRef
25
- })
26
- .subscribe(componentRef => {
27
- this.loadingDone = true;
28
- componentRef.componentInstance.click.subscribe(() => {
29
- console.log('project item clicked');
30
- });
31
- });
32
- }
33
- }
@@ -1,3 +0,0 @@
1
- .header {
2
- margin: 10px 20px;
3
- }
@@ -1,16 +0,0 @@
1
- <thy-layout>
2
- <thy-sidebar>
3
- <div class="sidebar-header">
4
- <span class="title cursor-pointer">App1</span>
5
- <!-- <button class="action" thyButtonIcon="wtf wtf-project-add-o" thyLight="true" thySize="lg"></button> -->
6
- </div>
7
- <div class="sidebar-content">
8
- <thy-menu>
9
- <a thyMenuItem [routerLink]="['/app1/dashboard']" routerLinkActive="active">App1 Dashboard</a>
10
- <a thyMenuItem [routerLink]="['/app1/users']" routerLinkActive="active">App1 Users</a>
11
- <a thyMenuItem [routerLink]="['/app1/projects']" routerLinkActive="active">App2 Projects</a>
12
- </thy-menu>
13
- </div>
14
- </thy-sidebar>
15
- <thy-content> <router-outlet></router-outlet> </thy-content>
16
- </thy-layout>
@@ -1,35 +0,0 @@
1
- import { Component, HostBinding, NgZone } from '@angular/core';
2
- import { GlobalEventDispatcher } from 'ngx-planet';
3
- import { ThyDialog } from 'ngx-tethys/dialog';
4
- import { UserDetailComponent } from '../user/detail/user-detail.component';
5
-
6
- @Component({
7
- selector: 'app1-root-actual',
8
- templateUrl: './root.component.html',
9
- styleUrls: ['./root.component.css']
10
- })
11
- export class AppActualRootComponent {
12
- @HostBinding(`class.thy-layout`) isLayout = true;
13
- }
14
-
15
- @Component({
16
- selector: 'app1-root',
17
- template: '<router-outlet></router-outlet>'
18
- })
19
- export class AppRootComponent {
20
- @HostBinding(`class.thy-layout`) isLayout = true;
21
-
22
- constructor(
23
- private globalEventDispatcher: GlobalEventDispatcher,
24
- private thyDialog: ThyDialog,
25
- private ngZone: NgZone
26
- ) {
27
- this.globalEventDispatcher.register('openUserDetail').subscribe((payload: number) => {
28
- thyDialog.open(UserDetailComponent, {
29
- initialState: {
30
- userId: payload
31
- }
32
- });
33
- });
34
- }
35
- }
@@ -1,15 +0,0 @@
1
- import { delay } from 'rxjs/operators';
2
- import { Injectable } from '@angular/core';
3
- import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
4
- import { of } from 'rxjs';
5
-
6
- @Injectable({
7
- providedIn: 'root'
8
- })
9
- export class InitializedDataResolver implements Resolve<unknown> {
10
- constructor() {}
11
-
12
- resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
13
- return of(null).pipe(delay(200));
14
- }
15
- }
@@ -1,57 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { RouterModule } from '@angular/router';
4
- import { ThyLayoutModule } from 'ngx-tethys/layout';
5
- import { ThyButtonModule } from 'ngx-tethys/button';
6
- import { ThyListModule } from 'ngx-tethys/list';
7
- import { ThyDialogModule } from 'ngx-tethys/dialog';
8
- import { ThyMenuModule } from 'ngx-tethys/menu';
9
- import { ThyCardModule } from 'ngx-tethys/card';
10
- import { ThyLoadingModule } from 'ngx-tethys/loading';
11
- import { ThyIconModule } from 'ngx-tethys/icon';
12
- import { ThyInputModule } from 'ngx-tethys/input';
13
- import { ThyFormModule } from 'ngx-tethys/form';
14
- import { ThySelectModule } from 'ngx-tethys/select';
15
-
16
- import { DemoCommonModule } from '@demo/common';
17
- import { NgxPlanetModule } from 'ngx-planet';
18
-
19
- @NgModule({
20
- declarations: [],
21
- imports: [
22
- CommonModule,
23
- RouterModule,
24
- ThyLayoutModule,
25
- ThyButtonModule,
26
- ThyListModule,
27
- ThyDialogModule,
28
- ThyMenuModule,
29
- ThyCardModule,
30
- ThyLoadingModule,
31
- ThyIconModule,
32
- ThyInputModule,
33
- ThyFormModule,
34
- ThySelectModule,
35
- DemoCommonModule,
36
- NgxPlanetModule
37
- ],
38
- exports: [
39
- CommonModule,
40
- RouterModule,
41
- ThyLayoutModule,
42
- ThyButtonModule,
43
- ThyListModule,
44
- ThyDialogModule,
45
- ThyMenuModule,
46
- ThyCardModule,
47
- ThyLoadingModule,
48
- ThyIconModule,
49
- ThyInputModule,
50
- ThyFormModule,
51
- ThySelectModule,
52
- DemoCommonModule,
53
- NgxPlanetModule
54
- ],
55
- providers: []
56
- })
57
- export class SharedModule {}
@@ -1,5 +0,0 @@
1
- <thy-dialog-header thyTitle="User Detail"></thy-dialog-header>
2
- <thy-dialog-body>
3
- <h5>User Detail</h5>
4
- <p>uid: {{ userId }}</p>
5
- </thy-dialog-body>
@@ -1,20 +0,0 @@
1
- import { Component, inject, InjectionToken, OnInit } from '@angular/core';
2
- import { GlobalEventDispatcher } from 'ngx-planet';
3
- import { ActivatedRoute } from '@angular/router';
4
-
5
- @Component({
6
- selector: 'app-user-detail',
7
- templateUrl: './user-detail.component.html'
8
- })
9
- export class UserDetailComponent implements OnInit {
10
- userId: string;
11
-
12
- constructor(private route: ActivatedRoute, private globalEventDispatcher: GlobalEventDispatcher) {}
13
-
14
- ngOnInit() {
15
- // this.route.paramMap.subscribe(params => {
16
- // const userId = params.get(`id`);
17
- // this.userId = userId;
18
- // });
19
- }
20
- }
@@ -1,7 +0,0 @@
1
- <p>This is user list page, <code>and this module is loaded lazy.</code></p>
2
- <thy-list>
3
- <thy-list-item class="thy-list-option" (click)="openUserDetail(1)"><span>Peter</span></thy-list-item>
4
- <thy-list-item class="thy-list-option" (click)="openUserDetail(2)"><span>Lily</span></thy-list-item>
5
- </thy-list>
6
-
7
- <router-outlet></router-outlet>
@@ -1,20 +0,0 @@
1
- import { Component, inject, InjectionToken } from '@angular/core';
2
- import { GlobalEventDispatcher } from 'ngx-planet';
3
- import { ThyDialog } from 'ngx-tethys/dialog';
4
- import { UserDetailComponent } from './detail/user-detail.component';
5
-
6
- @Component({
7
- selector: 'app-user-list',
8
- templateUrl: './user-list.component.html'
9
- })
10
- export class UserListComponent {
11
- constructor(private globalEventDispatcher: GlobalEventDispatcher, private thyDialog: ThyDialog) {}
12
-
13
- openUserDetail(id: number) {
14
- this.thyDialog.open(UserDetailComponent, {
15
- initialState: {
16
- userId: id
17
- }
18
- });
19
- }
20
- }
@@ -1,31 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { UserListComponent } from './user-list.component';
4
- import { UserDetailComponent } from './detail/user-detail.component';
5
- import { DemoCommonModule } from '@demo/common';
6
- import { NgxPlanetModule } from 'ngx-planet';
7
- import { RouterModule } from '@angular/router';
8
- import { SharedModule } from '../shared.module';
9
-
10
- @NgModule({
11
- declarations: [UserListComponent, UserDetailComponent],
12
- imports: [
13
- SharedModule,
14
- RouterModule.forChild([
15
- {
16
- path: '',
17
- component: UserListComponent,
18
- children: [
19
- {
20
- path: ':id',
21
- component: UserDetailComponent
22
- }
23
- ]
24
- }
25
- ])
26
- ],
27
- exports: [UserListComponent, UserDetailComponent],
28
- entryComponents: [UserDetailComponent],
29
- providers: []
30
- })
31
- export class UserModule {}
File without changes
Binary file
@@ -1,3 +0,0 @@
1
- .red {
2
- color: red;
3
- }
@@ -1,3 +0,0 @@
1
- export const environment = {
2
- production: true
3
- };
@@ -1,16 +0,0 @@
1
- // This file can be replaced during build by using the `fileReplacements` array.
2
- // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3
- // The list of file replacements can be found in `angular.json`.
4
-
5
- export const environment = {
6
- production: false
7
- };
8
-
9
- /*
10
- * For easier debugging in development mode, you can import the following file
11
- * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12
- *
13
- * This import should be commented out in production mode because it will have a negative impact
14
- * on performance if an error is thrown.
15
- */
16
- // import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
Binary file
@@ -1,14 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>App1</title>
6
- <base href="/">
7
-
8
- <meta name="viewport" content="width=device-width, initial-scale=1">
9
- <link rel="icon" type="image/x-icon" href="favicon.ico">
10
- </head>
11
- <body>
12
- <app1-root></app1-root>
13
- </body>
14
- </html>
@@ -1,35 +0,0 @@
1
- import { enableProdMode, NgModuleRef, Type, NgZone } from '@angular/core';
2
- import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3
-
4
- import { AppModule } from './app/app.module';
5
- import { environment } from './environments/environment';
6
- import { PlanetPortalApplication, defineApplication } from 'ngx-planet';
7
- import { AppRootContext } from '@demo/common';
8
-
9
- if (environment.production) {
10
- enableProdMode();
11
- }
12
-
13
- defineApplication('app1', {
14
- template: `<app1-root class="app1-root"></app1-root>`,
15
- bootstrap: (portalApp: PlanetPortalApplication) => {
16
- return platformBrowserDynamic([
17
- {
18
- provide: PlanetPortalApplication,
19
- useValue: portalApp
20
- },
21
- {
22
- provide: AppRootContext,
23
- useValue: portalApp.data.appRootContext
24
- }
25
- ])
26
- .bootstrapModule(AppModule)
27
- .then(appModule => {
28
- return appModule;
29
- })
30
- .catch(error => {
31
- console.error(error);
32
- return null;
33
- });
34
- }
35
- });
@@ -1,84 +0,0 @@
1
- /**
2
- * This file includes polyfills needed by Angular and is loaded before the app.
3
- * You can add your own extra polyfills to this file.
4
- *
5
- * This file is divided into 2 sections:
6
- * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7
- * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8
- * file.
9
- *
10
- * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11
- * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12
- * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13
- *
14
- * Learn more in https://angular.io/guide/browser-support
15
- */
16
-
17
- /***************************************************************************************************
18
- * BROWSER POLYFILLS
19
- */
20
-
21
- /** IE9, IE10, IE11, and Chrome <55 requires all of the following polyfills.
22
- * This also includes Android Emulators with older versions of Chrome and Google Search/Googlebot
23
- */
24
-
25
- // import 'core-js/es6/symbol';
26
- // import 'core-js/es6/object';
27
- // import 'core-js/es6/function';
28
- // import 'core-js/es6/parse-int';
29
- // import 'core-js/es6/parse-float';
30
- // import 'core-js/es6/number';
31
- // import 'core-js/es6/math';
32
- // import 'core-js/es6/string';
33
- // import 'core-js/es6/date';
34
- // import 'core-js/es6/array';
35
- // import 'core-js/es6/regexp';
36
- // import 'core-js/es6/map';
37
- // import 'core-js/es6/weak-map';
38
- // import 'core-js/es6/set';
39
-
40
- /** IE10 and IE11 requires the following for NgClass support on SVG elements */
41
- // import 'classlist.js'; // Run `npm install --save classlist.js`.
42
-
43
- /** IE10 and IE11 requires the following for the Reflect API. */
44
- // import 'core-js/es6/reflect';
45
-
46
- /**
47
- * Web Animations `@angular/platform-browser/animations`
48
- * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
49
- * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
50
- */
51
- // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
52
-
53
- /**
54
- * By default, zone.js will patch all possible macroTask and DomEvents
55
- * user can disable parts of macroTask/DomEvents patch by setting following flags
56
- * because those flags need to be set before `zone.js` being loaded, and webpack
57
- * will put import in the top of bundle, so user need to create a separate file
58
- * in this directory (for example: zone-flags.ts), and put the following flags
59
- * into that file, and then add the following code before importing zone.js.
60
- * import './zone-flags.ts';
61
- *
62
- * The flags allowed in zone-flags.ts are listed here.
63
- *
64
- * The following flags will work for all browsers.
65
- *
66
- * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
67
- * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
68
- * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
69
- *
70
- * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
71
- * with the following flag, it will bypass `zone.js` patch for IE/Edge
72
- *
73
- * (window as any).__Zone_enable_cross_context_check = true;
74
- *
75
- */
76
-
77
- /***************************************************************************************************
78
- * Zone JS is required by default for Angular itself.
79
- */
80
- import 'zone.js'; // Included with Angular CLI.
81
-
82
- /***************************************************************************************************
83
- * APPLICATION IMPORTS
84
- */
@@ -1,35 +0,0 @@
1
- /* You can add global styles to this file, and also import other style files */
2
- $layout-content-background: #fff;
3
- $primary: #348fe4;
4
-
5
- $btn-border-radius: 4px;
6
- $btn-border-radius-lg: 4px;
7
- $btn-border-radius-sm: 4px;
8
- $btn-border-radius-xs: 4px;
9
-
10
- @import 'ngx-tethys/styles/variables.scss';
11
- @import 'ngx-tethys/styles/index.scss';
12
-
13
- .section-card {
14
- display: block;
15
- position: relative;
16
- padding: 15px;
17
- border: 2px $gray-300 dashed;
18
-
19
- .section-card-header {
20
- position: absolute;
21
- padding: 0 10px;
22
- background: $white;
23
- top: -10px;
24
- left: 5px;
25
- color: $gray-600; // $gray-500;
26
- }
27
- }
28
-
29
- .app1-dashboard {
30
- display: inline;
31
- }
32
-
33
- .same-name {
34
- color: red;
35
- }
@@ -1,14 +0,0 @@
1
- // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
-
3
- import 'zone.js/testing';
4
- import { getTestBed } from '@angular/core/testing';
5
- import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
6
-
7
- declare const require: any;
8
-
9
- // First, initialize the Angular testing environment.
10
- getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
11
- // Then we find all the tests.
12
- const context = require.context('./', true, /\.spec\.ts$/);
13
- // And load the modules.
14
- context.keys().map(context);