@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,21 +0,0 @@
1
- import { Component, OnInit, HostBinding } from '@angular/core';
2
- import { ActivatedRoute, Router } from '@angular/router';
3
-
4
- @Component({
5
- selector: 'app2-project-detail',
6
- templateUrl: './detail.component.html'
7
- })
8
- export class ProjectDetailComponent implements OnInit {
9
- @HostBinding('class') class = 'thy-layout';
10
-
11
- projectId: string;
12
-
13
- constructor(private route: ActivatedRoute, router: Router) {
14
- this.route.paramMap.subscribe(params => {
15
- this.projectId = params.get('id');
16
- router.navigateByUrl(`/app2/projects/${this.projectId}/tasks`);
17
- });
18
- }
19
-
20
- ngOnInit() {}
21
- }
@@ -1,29 +0,0 @@
1
- <thy-content>
2
- <input
3
- thyInput
4
- class="mt-2 mb-2"
5
- [(ngModel)]="search"
6
- placeholder="搜索项目"
7
- [style.width.px]="300"
8
- (thyEnter)="getProjects()"
9
- />
10
- <thy-table
11
- thyClassName="table-hover"
12
- [thyModel]="projects"
13
- [thyLoadingDone]="loadingDone"
14
- (thyOnRowClick)="openDetail($event)"
15
- thyTheme="bordered"
16
- thyRowKey="id"
17
- >
18
- <thy-table-column thyTitle="名称" thyModelKey="name" thyClassName="same-name"></thy-table-column>
19
- <thy-table-column thyTitle="描述" thyModelKey="desc"></thy-table-column>
20
- <thy-table-column thyTitle="操作" thyClassName="thy-operation-links text-center">
21
- <ng-template #cell let-row>
22
- <a href="javascript:;">设置</a>
23
- <a class="link-secondary" href="javascript:;">
24
- <i class="wtf wtf-trash-o"></i>
25
- </a>
26
- </ng-template>
27
- </thy-table-column>
28
- </thy-table>
29
- </thy-content>
@@ -1,58 +0,0 @@
1
- import { Component, EventEmitter, OnInit, DoCheck, ApplicationRef, HostBinding } from '@angular/core';
2
- import { GlobalEventDispatcher } from 'ngx-planet';
3
- import { ProjectService } from './projects.service';
4
- import { ThyDialog } from 'ngx-tethys/dialog';
5
- import { ProjectDetailComponent } from './detail/detail.component';
6
- import { Router } from '@angular/router';
7
- import { ThyTableRowEvent } from 'ngx-tethys/table';
8
-
9
- @Component({
10
- selector: 'app-project-list',
11
- templateUrl: './project-list.component.html'
12
- })
13
- export class ProjectListComponent implements OnInit, DoCheck {
14
- @HostBinding('class') class = 'thy-layout';
15
-
16
- constructor(
17
- private router: Router,
18
- private globalEventDispatcher: GlobalEventDispatcher,
19
- private projectService: ProjectService,
20
- private dialog: ThyDialog,
21
- private applicationRef: ApplicationRef
22
- ) {}
23
-
24
- click = new EventEmitter<any>();
25
-
26
- projects: any[];
27
-
28
- loadingDone: boolean;
29
-
30
- search: string;
31
-
32
- ngOnInit() {
33
- this.getProjects();
34
- }
35
-
36
- getProjects() {
37
- this.loadingDone = false;
38
- setTimeout(() => {
39
- this.projects = this.projectService.getProjects();
40
- this.loadingDone = true;
41
- }, 500);
42
- }
43
-
44
- openDetail(event: ThyTableRowEvent) {
45
- this.router.navigateByUrl(`/app2/projects/${event.row.id}`);
46
- this.click.emit();
47
- // this.dialog.open(ProjectDetailComponent, {
48
- // hasBackdrop: true,
49
- // backdropClosable: true,
50
- // closeOnNavigation: true
51
- // });
52
- }
53
-
54
- ngDoCheck() {
55
- // this.applicationRef.tick();
56
- // console.log(window['appRef'] === this.applicationRef);
57
- }
58
- }
@@ -1,15 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { Resolve, Router, ActivatedRouteSnapshot } from '@angular/router';
3
- import { ProjectService } from './projects.service';
4
-
5
- @Injectable({
6
- providedIn: 'root'
7
- })
8
- export class ProjectResolver implements Resolve<any> {
9
- constructor(private projectService: ProjectService, private router: Router) {}
10
-
11
- resolve(route: ActivatedRouteSnapshot) {
12
- const projectId = route.params.id;
13
- return this.projectService.fetchProject(projectId);
14
- }
15
- }
@@ -1,28 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { of } from 'rxjs';
3
- import { delay } from 'rxjs/operators';
4
-
5
- @Injectable({
6
- providedIn: 'root'
7
- })
8
- export class ProjectService {
9
- constructor() {}
10
-
11
- getProjects() {
12
- return Array.from({ length: 10 }).map((item, index) => {
13
- return {
14
- id: index,
15
- name: `Data ${index}`,
16
- desc: 'This is test data'
17
- };
18
- });
19
- }
20
-
21
- fetchProject(projectId: string) {
22
- return of({
23
- id: projectId,
24
- name: `Data ${projectId}`,
25
- desc: 'This is test data'
26
- }).pipe(delay(100));
27
- }
28
- }
@@ -1,10 +0,0 @@
1
- <thy-header thySize="sm">
2
- <ng-template #headerContent>
3
- <thy-nav thyType="thirdly" thyHorizontal="left">
4
- <a thyNavLink [routerLink]="['./view-1']" routerLinkActive="active">View1</a>
5
- <a thyNavLink [routerLink]="['./view-2']" routerLinkActive="active">View2</a>
6
- <a thyNavLink [routerLink]="['./view-3']" routerLinkActive="active">View3</a>
7
- </thy-nav>
8
- </ng-template>
9
- </thy-header>
10
- <router-outlet></router-outlet>
@@ -1,16 +0,0 @@
1
- import { Component, OnInit, HostBinding } from '@angular/core';
2
- import { Router, ActivatedRoute } from '@angular/router';
3
-
4
- @Component({
5
- selector: 'app2-tasks',
6
- templateUrl: './tasks.component.html'
7
- })
8
- export class TasksComponent implements OnInit {
9
- @HostBinding('class') class = 'thy-layout';
10
-
11
- constructor(router: Router, route: ActivatedRoute) {
12
- router.navigate(['./view-1'], { relativeTo: route });
13
- }
14
-
15
- ngOnInit(): void {}
16
- }
@@ -1 +0,0 @@
1
- viewId: {{ viewId }}
@@ -1,20 +0,0 @@
1
- import { Component, OnInit, HostBinding } from '@angular/core';
2
- import { ActivatedRoute } from '@angular/router';
3
-
4
- @Component({
5
- selector: 'app2-view',
6
- templateUrl: './view.component.html'
7
- })
8
- export class ViewComponent implements OnInit {
9
- @HostBinding('class') class = 'thy-layout-content';
10
-
11
- viewId: string;
12
-
13
- constructor(private route: ActivatedRoute) {
14
- route.paramMap.subscribe(param => {
15
- this.viewId = param.get('viewId');
16
- });
17
- }
18
-
19
- ngOnInit(): void {}
20
- }
@@ -1,14 +0,0 @@
1
- <thy-layout>
2
- <thy-sidebar>
3
- <div class="sidebar-header">
4
- <span class="title cursor-pointer same-name">App2</span>
5
- </div>
6
- <div class="sidebar-content">
7
- <thy-menu>
8
- <a thyMenuItem [routerLink]="['/app2/dashboard']" routerLinkActive="active">App2 Dashboard</a>
9
- <a thyMenuItem [routerLink]="['/app2/projects']" routerLinkActive="active">App2 Projects</a>
10
- </thy-menu>
11
- </div>
12
- </thy-sidebar>
13
- <router-outlet></router-outlet>
14
- </thy-layout>
@@ -1,12 +0,0 @@
1
- .header {
2
- margin: 10px 20px;
3
- }
4
-
5
- .same-name {
6
- color: green;
7
- :not([planet]) {
8
- .aa {
9
- color: #aaa;
10
- }
11
- }
12
- }
@@ -1,28 +0,0 @@
1
- import { PlanetComponentLoader } from 'ngx-planet';
2
- import { Component, HostBinding, ComponentFactoryResolver, Injector, ApplicationRef, OnInit } from '@angular/core';
3
- import { ProjectListComponent } from '../projects/project-list.component';
4
- @Component({
5
- selector: 'app2-root-actual',
6
- templateUrl: './root.component.html',
7
- styleUrls: ['./root.component.scss']
8
- })
9
- export class AppActualRootComponent {
10
- @HostBinding(`class.thy-layout`) isThyLayout = true;
11
- @HostBinding(`class.thy-layout--has-sidebar`) isThyHasSidebarLayout = true;
12
-
13
- constructor() {}
14
- }
15
-
16
- @Component({
17
- selector: 'app2-root',
18
- template: '<router-outlet></router-outlet>'
19
- })
20
- export class AppRootComponent implements OnInit {
21
- @HostBinding(`class.thy-layout`) isThyLayout = true;
22
-
23
- constructor(private planetComponentLoader: PlanetComponentLoader) {}
24
-
25
- ngOnInit() {
26
- this.planetComponentLoader.register([{ name: 'project1', component: ProjectListComponent }]);
27
- }
28
- }
@@ -1,59 +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 { ThyTableModule } from 'ngx-tethys/table';
12
- import { ThyNavModule } from 'ngx-tethys/nav';
13
- import { ThyInputModule } from 'ngx-tethys/input';
14
- import { ThyIconModule } from 'ngx-tethys/icon';
15
-
16
- import { DemoCommonModule } from '@demo/common';
17
- import { NgxPlanetModule } from 'ngx-planet';
18
- import { ThyLabelModule } from 'ngx-tethys';
19
-
20
- @NgModule({
21
- declarations: [],
22
- imports: [
23
- CommonModule,
24
- RouterModule,
25
- ThyLayoutModule,
26
- ThyButtonModule,
27
- ThyListModule,
28
- ThyDialogModule,
29
- ThyMenuModule,
30
- ThyCardModule,
31
- ThyLoadingModule,
32
- ThyTableModule,
33
- ThyNavModule,
34
- ThyInputModule,
35
- ThyIconModule,
36
- DemoCommonModule,
37
- NgxPlanetModule
38
- ],
39
- exports: [
40
- CommonModule,
41
- RouterModule,
42
- ThyLayoutModule,
43
- ThyButtonModule,
44
- ThyListModule,
45
- ThyDialogModule,
46
- ThyMenuModule,
47
- ThyCardModule,
48
- ThyLoadingModule,
49
- ThyTableModule,
50
- ThyNavModule,
51
- ThyInputModule,
52
- ThyIconModule,
53
- ThyLabelModule,
54
- DemoCommonModule,
55
- NgxPlanetModule
56
- ],
57
- providers: []
58
- })
59
- export class SharedModule {}
File without changes
@@ -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,36 +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 { Router } from '@angular/router';
7
- import { PlanetPortalApplication, PlanetRouterEvent, GlobalEventDispatcher, defineApplication } from 'ngx-planet';
8
-
9
- if (environment.production) {
10
- enableProdMode();
11
- }
12
-
13
- // 测试沙箱模拟APP2 引入低版本的 lodash
14
- window['lodash'] = {
15
- version: '1.0.0'
16
- };
17
-
18
- defineApplication('app2', {
19
- template: `<app2-root></app2-root>`,
20
- bootstrap: (portalApp: PlanetPortalApplication) => {
21
- return platformBrowserDynamic([
22
- {
23
- provide: PlanetPortalApplication,
24
- useValue: portalApp
25
- }
26
- ])
27
- .bootstrapModule(AppModule)
28
- .then(appModule => {
29
- return appModule;
30
- })
31
- .catch(error => {
32
- console.error(error);
33
- return null;
34
- });
35
- }
36
- });
@@ -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,28 +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
- @import './app/root/root.component.scss';
13
-
14
- .section-card {
15
- display: block;
16
- position: relative;
17
- padding: 15px;
18
- border: 2px $gray-300 dashed;
19
-
20
- .section-card-header {
21
- position: absolute;
22
- padding: 0 10px;
23
- background: $white;
24
- top: -10px;
25
- left: 5px;
26
- color: $gray-600; // $gray-500;
27
- }
28
- }
@@ -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);
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../out-tsc/app",
5
- "types": []
6
- },
7
- "files": ["src/main.ts"],
8
- "include": ["src/**/*.d.ts"],
9
- "exclude": ["test.ts", "**/*.spec.ts"]
10
- }
@@ -1,18 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../out-tsc/spec",
5
- "types": [
6
- "jasmine",
7
- "node"
8
- ]
9
- },
10
- "files": [
11
- "src/test.ts",
12
- "src/polyfills.ts"
13
- ],
14
- "include": [
15
- "**/*.spec.ts",
16
- "**/*.d.ts"
17
- ]
18
- }
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "../../tslint.json",
3
- "rules": {
4
- "directive-selector": [true, "attribute", "app", "camelCase"],
5
- "component-selector": [true, "element", "app2", "kebab-case"]
6
- }
7
- }