igniteui-cli 9.0.6 → 9.1.0-beta.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 (86) hide show
  1. package/lib/commands/start.js +11 -9
  2. package/lib/templates/IgniteUIForWebComponentsTemplate.js +3 -2
  3. package/package.json +3 -3
  4. package/templates/webcomponents/TypeScriptFileUpdate.js +1 -1
  5. package/templates/webcomponents/igc-ts/avatar/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  6. package/templates/webcomponents/igc-ts/avatar/default/files/src/app/__path__/__filePrefix__.ts +6 -5
  7. package/templates/webcomponents/igc-ts/badge/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -2
  8. package/templates/webcomponents/igc-ts/badge/default/files/src/app/__path__/__filePrefix__.ts +21 -19
  9. package/templates/webcomponents/igc-ts/button/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -2
  10. package/templates/webcomponents/igc-ts/button/default/files/src/app/__path__/__filePrefix__.ts +6 -5
  11. package/templates/webcomponents/igc-ts/calendar/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  12. package/templates/webcomponents/igc-ts/calendar/default/files/src/app/__path__/__filePrefix__.ts +6 -5
  13. package/templates/webcomponents/igc-ts/card/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  14. package/templates/webcomponents/igc-ts/card/default/files/src/app/__path__/__filePrefix__.ts +47 -45
  15. package/templates/webcomponents/igc-ts/checkbox/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  16. package/templates/webcomponents/igc-ts/checkbox/default/files/src/app/__path__/__filePrefix__.ts +11 -10
  17. package/templates/webcomponents/igc-ts/custom-templates/subscription-form/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  18. package/templates/webcomponents/igc-ts/custom-templates/subscription-form/files/src/app/__path__/__filePrefix__.ts +36 -36
  19. package/templates/webcomponents/igc-ts/dock-manager/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  20. package/templates/webcomponents/igc-ts/dock-manager/default/files/src/app/__path__/__filePrefix__.ts +53 -53
  21. package/templates/webcomponents/igc-ts/financial-chart/default/files/src/app/__path__/StockIndexData.ts +994 -126
  22. package/templates/webcomponents/igc-ts/financial-chart/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  23. package/templates/webcomponents/igc-ts/financial-chart/default/files/src/app/__path__/__filePrefix__.ts +19 -20
  24. package/templates/webcomponents/igc-ts/form/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  25. package/templates/webcomponents/igc-ts/form/default/files/src/app/__path__/__filePrefix__.ts +14 -13
  26. package/templates/webcomponents/igc-ts/grid/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  27. package/templates/webcomponents/igc-ts/grid/default/files/src/app/__path__/__filePrefix__.ts +34 -35
  28. package/templates/webcomponents/igc-ts/grid/grid-editing/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  29. package/templates/webcomponents/igc-ts/grid/grid-editing/files/src/app/__path__/__filePrefix__.ts +25 -26
  30. package/templates/webcomponents/igc-ts/grid/grid-summaries/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  31. package/templates/webcomponents/igc-ts/grid/grid-summaries/files/src/app/__path__/__filePrefix__.ts +17 -21
  32. package/templates/webcomponents/igc-ts/icon/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  33. package/templates/webcomponents/igc-ts/icon/default/files/src/app/__path__/__filePrefix__.ts +11 -10
  34. package/templates/webcomponents/igc-ts/icon-button/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  35. package/templates/webcomponents/igc-ts/icon-button/default/files/src/app/__path__/__filePrefix__.ts +10 -9
  36. package/templates/webcomponents/igc-ts/input/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  37. package/templates/webcomponents/igc-ts/input/default/files/src/app/__path__/__filePrefix__.ts +6 -5
  38. package/templates/webcomponents/igc-ts/linear-gauge/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  39. package/templates/webcomponents/igc-ts/linear-gauge/default/files/src/app/__path__/__filePrefix__.ts +26 -26
  40. package/templates/webcomponents/igc-ts/list/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  41. package/templates/webcomponents/igc-ts/list/default/files/src/app/__path__/__filePrefix__.ts +7 -6
  42. package/templates/webcomponents/igc-ts/navbar/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  43. package/templates/webcomponents/igc-ts/navbar/default/files/src/app/__path__/__filePrefix__.ts +17 -9
  44. package/templates/webcomponents/igc-ts/pie-chart/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  45. package/templates/webcomponents/igc-ts/pie-chart/default/files/src/app/__path__/__filePrefix__.ts +19 -19
  46. package/templates/webcomponents/igc-ts/pie-chart/default/files/src/app/__path__/sampleData.ts +28 -23
  47. package/templates/webcomponents/igc-ts/projects/{empty → _base}/files/__dot__editorconfig +0 -0
  48. package/templates/webcomponents/igc-ts/projects/{empty → _base}/files/__dot__gitignore +0 -0
  49. package/templates/webcomponents/igc-ts/projects/{empty → _base}/files/ignite-ui-cli.json +2 -1
  50. package/templates/webcomponents/igc-ts/projects/_base/files/index.html +17 -0
  51. package/templates/webcomponents/igc-ts/projects/{empty → _base}/files/package.json +22 -22
  52. package/templates/webcomponents/igc-ts/projects/_base/files/rollup.config.mjs +90 -0
  53. package/templates/webcomponents/igc-ts/projects/_base/files/src/app/app-routing.ts +11 -0
  54. package/templates/webcomponents/igc-ts/projects/_base/files/src/app/app.ts +32 -0
  55. package/templates/webcomponents/igc-ts/projects/{empty/files/src/app/home/home.component.test.ts → _base/files/src/app/home/home.test.ts} +1 -1
  56. package/templates/webcomponents/igc-ts/projects/{empty/files/src/app/home/home.component.ts → _base/files/src/app/home/home.ts} +17 -15
  57. package/templates/webcomponents/igc-ts/projects/_base/files/src/app/not-found/not-found.ts +11 -0
  58. package/templates/webcomponents/igc-ts/projects/{empty → _base}/files/src/assets/astronaut-components.svg +0 -0
  59. package/templates/webcomponents/igc-ts/projects/_base/files/src/index.ts +2 -0
  60. package/templates/webcomponents/igc-ts/projects/_base/files/styles.css +5 -0
  61. package/templates/webcomponents/igc-ts/projects/_base/files/tsconfig.json +31 -0
  62. package/templates/webcomponents/igc-ts/projects/{empty → _base}/files/web-dev-server.config.mjs +0 -0
  63. package/templates/webcomponents/igc-ts/projects/{empty → _base}/files/web-test-runner.config.mjs +0 -0
  64. package/templates/webcomponents/igc-ts/projects/_base/index.d.ts +19 -0
  65. package/templates/webcomponents/igc-ts/projects/_base/index.js +56 -0
  66. package/templates/webcomponents/igc-ts/projects/empty/index.d.ts +14 -1
  67. package/templates/webcomponents/igc-ts/projects/empty/index.js +10 -43
  68. package/templates/webcomponents/igc-ts/projects/side-nav/files/src/app/app.ts +57 -0
  69. package/templates/webcomponents/igc-ts/projects/side-nav/index.d.ts +14 -0
  70. package/templates/webcomponents/igc-ts/projects/side-nav/index.js +21 -0
  71. package/templates/webcomponents/igc-ts/radial-gauge/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  72. package/templates/webcomponents/igc-ts/radial-gauge/default/files/src/app/__path__/__filePrefix__.ts +13 -13
  73. package/templates/webcomponents/igc-ts/radio-group/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  74. package/templates/webcomponents/igc-ts/radio-group/default/files/src/app/__path__/__filePrefix__.ts +6 -5
  75. package/templates/webcomponents/igc-ts/ripple/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  76. package/templates/webcomponents/igc-ts/ripple/default/files/src/app/__path__/__filePrefix__.ts +6 -6
  77. package/templates/webcomponents/igc-ts/slider/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  78. package/templates/webcomponents/igc-ts/slider/default/files/src/app/__path__/__filePrefix__.ts +6 -5
  79. package/templates/webcomponents/igc-ts/switch/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  80. package/templates/webcomponents/igc-ts/switch/default/files/src/app/__path__/__filePrefix__.ts +6 -5
  81. package/templates/webcomponents/igc-ts/projects/empty/files/index.html +0 -43
  82. package/templates/webcomponents/igc-ts/projects/empty/files/src/app/not-found/not-found.component.ts +0 -9
  83. package/templates/webcomponents/igc-ts/projects/empty/files/src/app.ts +0 -46
  84. package/templates/webcomponents/igc-ts/projects/empty/files/src/index.ts +0 -16
  85. package/templates/webcomponents/igc-ts/projects/empty/files/tsconfig.json +0 -31
  86. package/templates/webcomponents/igc-ts/projects/empty/files/webpack.config.mjs +0 -67
@@ -13,6 +13,13 @@ const cli_core_1 = require("@igniteui/cli-core");
13
13
  const path = require("path");
14
14
  const resolve = require("resolve");
15
15
  const build_1 = require("./build");
16
+ const execSyncNpmStart = (port, options) => {
17
+ if (port) {
18
+ cli_core_1.Util.execSync(`npm start -- --port=${port}`, options);
19
+ return;
20
+ }
21
+ cli_core_1.Util.execSync(`npm start`, options);
22
+ };
16
23
  let command;
17
24
  // tslint:disable:object-literal-sort-keys
18
25
  command = {
@@ -57,6 +64,9 @@ command = {
57
64
  cd14: config.project.theme
58
65
  });
59
66
  let port = Number(argv.port) || defaultPort;
67
+ // TODO: consider piping the stdin so that we handle the cp's termination
68
+ // this may require additional logic to be implemented if the cp asks for input
69
+ const options = { stdio: "inherit", killSignal: "SIGINT" };
60
70
  switch (framework.toLowerCase()) {
61
71
  case "jquery":
62
72
  // browser-sync installed per project
@@ -80,16 +90,8 @@ command = {
80
90
  }
81
91
  /* falls through */
82
92
  case "angular":
83
- const options = { stdio: "inherit", killSignal: "SIGINT" };
84
- if (port) {
85
- cli_core_1.Util.execSync(`npm start -- --port=` + port, options);
86
- }
87
- else {
88
- cli_core_1.Util.execSync(`npm start`, options);
89
- }
90
- break;
91
93
  case "webcomponents":
92
- cli_core_1.Util.execSync(`npm start`);
94
+ execSyncNpmStart(port, options);
93
95
  default:
94
96
  break;
95
97
  }
@@ -28,8 +28,9 @@ class IgniteUIForWebComponentsTemplate {
28
28
  return Object.assign({}, options["extraConfig"], this.getBaseVariables(name));
29
29
  }
30
30
  registerInProject(projectPath, fullName, options) {
31
- if (!(options && options.skipRoute) && cli_core_1.App.container.get(cli_core_1.FS_TOKEN).fileExists("src/index.ts")) {
32
- const routingModule = new TypeScriptFileUpdate_1.TypeScriptFileUpdate(path.join(projectPath, "src/index.ts"));
31
+ if (!(options && options.skipRoute) && cli_core_1.App.container.get(cli_core_1.FS_TOKEN)
32
+ .fileExists("src/app/app-routing.ts")) {
33
+ const routingModule = new TypeScriptFileUpdate_1.TypeScriptFileUpdate(path.join(projectPath, "src/app/app-routing.ts"));
33
34
  routingModule.addRoute(path.join(projectPath, `src/app/${this.folderName(fullName)}/${this.fileName(fullName)}.component.ts`), this.fileName(fullName), cli_core_1.Util.nameFromPath(fullName));
34
35
  }
35
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-cli",
3
- "version": "9.0.6",
3
+ "version": "9.1.0-beta.0",
4
4
  "description": "CLI tool for creating Ignite UI projects",
5
5
  "keywords": [
6
6
  "CLI",
@@ -72,8 +72,8 @@
72
72
  "all": true
73
73
  },
74
74
  "dependencies": {
75
- "@igniteui/angular-templates": "~13.0.906",
76
- "@igniteui/cli-core": "~9.0.6",
75
+ "@igniteui/angular-templates": "~13.1.910-beta.0",
76
+ "@igniteui/cli-core": "~9.1.0-beta.0",
77
77
  "chalk": "^2.3.2",
78
78
  "fs-extra": "^3.0.1",
79
79
  "glob": "^7.1.2",
@@ -84,7 +84,7 @@ class TypeScriptFileUpdate {
84
84
  //#endregion File state
85
85
  addRouteModuleEntry(targetPath, filePath, linkText, linkPath, routesVariable = DEFAULT_ROUTES_VARIABLE, parentRoutePath) {
86
86
  let className;
87
- const relativePath = "./app/" + filePath + "/" + filePath;
87
+ const relativePath = "./" + filePath + "/" + filePath;
88
88
  className = "app-" + filePath;
89
89
  this.requestImport(relativePath);
90
90
  // https://github.com/Microsoft/TypeScript/issues/14419#issuecomment-307256171
@@ -1,5 +1,5 @@
1
1
  import { expect } from '@open-wc/testing';
2
- import $(ClassName) from './$(path)';
2
+ import $(ClassName) from './$(path).js';
3
3
 
4
4
  describe('IgcAvatarComponent', () => {
5
5
  it('<app-$(path)> is an instance of $(ClassName)', async () => {
@@ -1,3 +1,5 @@
1
+ import { html, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
1
3
  import {
2
4
  defineComponents,
3
5
  IgcAvatarComponent,
@@ -5,9 +7,10 @@ import {
5
7
 
6
8
  defineComponents(IgcAvatarComponent);
7
9
 
8
- export default class $(ClassName) extends HTMLElement {
9
- connectedCallback() {
10
- this.innerHTML = `
10
+ @customElement('app-$(path)')
11
+ export default class $(ClassName) extends LitElement {
12
+ render() {
13
+ return html`
11
14
  <igc-avatar
12
15
  size="large"
13
16
  shape="circle"
@@ -18,5 +21,3 @@ export default class $(ClassName) extends HTMLElement {
18
21
  `;
19
22
  }
20
23
  }
21
-
22
- customElements.define('app-$(path)', $(ClassName));
@@ -1,5 +1,5 @@
1
1
  import { expect } from '@open-wc/testing';
2
- import $(ClassName) from './$(path)';
2
+ import $(ClassName) from './$(path).js';
3
3
 
4
4
  describe('IgcBadgeComponent', () => {
5
5
  it('<app-$(path)> is an instance of $(ClassName)', async () => {
@@ -7,4 +7,3 @@ describe('IgcBadgeComponent', () => {
7
7
  expect(element).to.be.instanceOf($(ClassName));
8
8
  });
9
9
  });
10
-
@@ -1,3 +1,5 @@
1
+ import { html, css, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
1
3
  import {
2
4
  defineComponents,
3
5
  IgcBadgeComponent,
@@ -5,23 +7,25 @@ import {
5
7
 
6
8
  defineComponents(IgcBadgeComponent);
7
9
 
8
- export default class $(ClassName) extends HTMLElement {
9
- connectedCallback() {
10
- this.innerHTML = `
11
- <style>
12
- #labels {
13
- flex-grow: 1;
14
- display: flex;
15
- flex-direction: column;
16
- border-style: groove;
17
- }
18
- igc-badge {
19
- padding: 3px;
20
- }
21
- label {
22
- padding: 5px;
23
- }
24
- </style>
10
+ @customElement('app-$(path)')
11
+ export default class $(ClassName) extends LitElement {
12
+ static styles = css`
13
+ #labels {
14
+ flex-grow: 1;
15
+ display: flex;
16
+ flex-direction: column;
17
+ border-style: groove;
18
+ }
19
+ igc-badge {
20
+ padding: 3px;
21
+ }
22
+ label {
23
+ padding: 5px;
24
+ }
25
+ `;
26
+
27
+ render() {
28
+ return html`
25
29
  <div id='labels'>
26
30
  <label>Labels</label>
27
31
  <igc-badge
@@ -42,5 +46,3 @@ export default class $(ClassName) extends HTMLElement {
42
46
  `;
43
47
  }
44
48
  }
45
-
46
- customElements.define('app-$(path)', $(ClassName));
@@ -1,5 +1,5 @@
1
1
  import { expect } from '@open-wc/testing';
2
- import $(ClassName) from './$(path)';
2
+ import $(ClassName) from './$(path).js';
3
3
 
4
4
  describe('IgcButtonComponent', () => {
5
5
  it('<app-$(path)> is an instance of $(ClassName)', async () => {
@@ -7,4 +7,3 @@ describe('IgcButtonComponent', () => {
7
7
  expect(element).to.be.instanceOf($(ClassName));
8
8
  });
9
9
  });
10
-
@@ -1,3 +1,5 @@
1
+ import { html, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
1
3
  import {
2
4
  defineComponents,
3
5
  IgcButtonComponent,
@@ -5,9 +7,10 @@ import {
5
7
 
6
8
  defineComponents(IgcButtonComponent);
7
9
 
8
- export default class $(ClassName) extends HTMLElement {
9
- connectedCallback() {
10
- this.innerHTML = `
10
+ @customElement('app-$(path)')
11
+ export default class $(ClassName) extends LitElement {
12
+ render() {
13
+ return html`
11
14
  <igc-button
12
15
  size='large'>
13
16
  Large button
@@ -15,5 +18,3 @@ export default class $(ClassName) extends HTMLElement {
15
18
  `;
16
19
  }
17
20
  }
18
-
19
- customElements.define('app-$(path)', $(ClassName));
@@ -1,5 +1,5 @@
1
1
  import { expect } from '@open-wc/testing';
2
- import $(ClassName) from './$(path)';
2
+ import $(ClassName) from './$(path).js';
3
3
 
4
4
  describe('IgcCalendarComponent', () => {
5
5
  it('<app-$(path)> is an instance of $(ClassName)', async () => {
@@ -1,3 +1,5 @@
1
+ import { html, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
1
3
  import {
2
4
  defineComponents,
3
5
  IgcCalendarComponent,
@@ -5,9 +7,10 @@ import {
5
7
 
6
8
  defineComponents(IgcCalendarComponent);
7
9
 
8
- export default class $(ClassName) extends HTMLElement {
9
- connectedCallback() {
10
- this.innerHTML = `
10
+ @customElement('app-$(path)')
11
+ export default class $(ClassName) extends LitElement {
12
+ render() {
13
+ return html`
11
14
  <igc-calendar
12
15
  style="width:1300px"
13
16
  week-start="monday"
@@ -17,5 +20,3 @@ export default class $(ClassName) extends HTMLElement {
17
20
  `;
18
21
  }
19
22
  }
20
-
21
- customElements.define('app-$(path)', $(ClassName));
@@ -1,5 +1,5 @@
1
1
  import { expect } from '@open-wc/testing';
2
- import $(ClassName) from './$(path)';
2
+ import $(ClassName) from './$(path).js';
3
3
 
4
4
  describe('IgcCardComponent', () => {
5
5
  it('<app-$(path)> is an instance of $(ClassName)', async () => {
@@ -1,3 +1,5 @@
1
+ import { html, css, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
1
3
  import {
2
4
  defineComponents,
3
5
  IgcCardActionsComponent,
@@ -12,53 +14,53 @@ defineComponents(
12
14
  IgcCardActionsComponent,
13
15
  IgcCardContentComponent,
14
16
  IgcCardHeaderComponent,
15
- IgcCardMediaComponent
17
+ IgcCardMediaComponent,
16
18
  );
17
19
 
18
- export default class $(ClassName) extends HTMLElement {
19
- connectedCallback() {
20
- this.innerHTML = `
21
- <style>
22
- igc-card {
23
- width: 400px
24
- }
25
- </style>
26
- <igc-card>
27
- <igc-card-media style="max-height: 194px">
28
- <img
29
- src="https://images.unsplash.com/photo-1518235506717-e1ed3306a89b?ixlib=rb-1.2.1&auto=format&fit=crop&w=320&q=180"
30
- />
31
- </igc-card-media>
32
- <igc-card-header>
33
- <igc-avatar
34
- slot="thumbnail"
35
- size="small"
36
- shape="rounded"
37
- src="https://www.infragistics.com/angular-demos/assets/images/men/1.jpg"
38
- >
39
- </igc-avatar>
40
- <h3 slot="title">Title</h3>
41
- <h5 slot="subtitle">Subtitle</h5>
42
- </igc-card-header>
43
- <igc-card-content>
44
- <p>
45
- New York City comprises 5 boroughs sitting where the Hudson River
46
- meets the Atlantic Ocean. At its core is Manhattan, a densely
47
- populated borough that’s among the world’s major commercial,
48
- financial and cultural centers.
49
- </p>
50
- </igc-card-content>
51
- <hr
52
- style="height: 1px; margin: 0 0 8px 0; background-color: rgba(0,0,0, 0.2); border: 0px"
53
- />
54
- <igc-card-actions>
55
- <igc-button slot="start" variant="flat">Like</igc-button>
56
- <igc-button slot="start" variant="flat">Learn More</igc-button>
57
- <igc-icon slot="end" name="home" collection="default"></igc-icon>
58
- </igc-card-actions>
59
- </igc-card>
20
+ @customElement('app-$(path)')
21
+ export default class $(ClassName) extends LitElement {
22
+ static styles = css`
23
+ igc-card {
24
+ width: 400px;
25
+ }
26
+ `;
27
+
28
+ render() {
29
+ return html`
30
+ <igc-card>
31
+ <igc-card-media style="max-height: 194px">
32
+ <img
33
+ src="https://images.unsplash.com/photo-1518235506717-e1ed3306a89b?ixlib=rb-1.2.1&auto=format&fit=crop&w=320&q=180"
34
+ />
35
+ </igc-card-media>
36
+ <igc-card-header>
37
+ <igc-avatar
38
+ slot="thumbnail"
39
+ size="small"
40
+ shape="rounded"
41
+ src="https://www.infragistics.com/angular-demos/assets/images/men/1.jpg"
42
+ >
43
+ </igc-avatar>
44
+ <h3 slot="title">Title</h3>
45
+ <h5 slot="subtitle">Subtitle</h5>
46
+ </igc-card-header>
47
+ <igc-card-content>
48
+ <p>
49
+ New York City comprises 5 boroughs sitting where the Hudson River
50
+ meets the Atlantic Ocean. At its core is Manhattan, a densely
51
+ populated borough that’s among the world’s major commercial,
52
+ financial and cultural centers.
53
+ </p>
54
+ </igc-card-content>
55
+ <hr
56
+ style="height: 1px; margin: 0 0 8px 0; background-color: rgba(0,0,0, 0.2); border: 0px"
57
+ />
58
+ <igc-card-actions>
59
+ <igc-button slot="start" variant="flat">Like</igc-button>
60
+ <igc-button slot="start" variant="flat">Learn More</igc-button>
61
+ <igc-icon slot="end" name="home" collection="default"></igc-icon>
62
+ </igc-card-actions>
63
+ </igc-card>
60
64
  `;
61
65
  }
62
66
  }
63
-
64
- customElements.define('app-$(path)', $(ClassName));
@@ -1,5 +1,5 @@
1
1
  import { expect } from '@open-wc/testing';
2
- import $(ClassName) from './$(path)';
2
+ import $(ClassName) from './$(path).js';
3
3
 
4
4
  describe('IgcCheckboxComponent', () => {
5
5
  it('<app-$(path)> is an instance of $(ClassName)', async () => {
@@ -1,3 +1,5 @@
1
+ import { html, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
1
3
  import {
2
4
  defineComponents,
3
5
  IgcCheckboxComponent,
@@ -5,16 +7,15 @@ import {
5
7
 
6
8
  defineComponents(IgcCheckboxComponent);
7
9
 
8
- export default class $(ClassName) extends HTMLElement {
9
- connectedCallback() {
10
- this.innerHTML = `
11
- <igc-checkbox
12
- checked="true"
13
- >
14
- Label
15
- </igc-checkbox>
10
+ @customElement('app-$(path)')
11
+ export default class $(ClassName) extends LitElement {
12
+ render() {
13
+ return html`
14
+ <igc-checkbox
15
+ checked="true"
16
+ >
17
+ Label
18
+ </igc-checkbox>
16
19
  `;
17
20
  }
18
21
  }
19
-
20
- customElements.define('app-$(path)', $(ClassName));
@@ -1,5 +1,5 @@
1
1
  import { expect } from '@open-wc/testing';
2
- import $(ClassName) from './$(path)';
2
+ import $(ClassName) from './$(path).js';
3
3
 
4
4
  describe('IgcSubscriptionFormComponent', () => {
5
5
  it('<app-$(path)> is an instance of $(ClassName)', async () => {
@@ -1,32 +1,50 @@
1
+ import { html, css, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
1
3
  import {
2
4
  defineComponents,
3
5
  IgcFormComponent,
4
6
  IgcInputComponent,
5
7
  IgcCheckboxComponent,
6
- IgcButtonComponent
8
+ IgcButtonComponent,
7
9
  } from 'igniteui-webcomponents';
8
10
 
9
11
  defineComponents(IgcFormComponent, IgcInputComponent, IgcCheckboxComponent, IgcButtonComponent);
10
12
 
11
- export default class $(ClassName) extends HTMLElement {
12
- connectedCallback() {
13
- this.innerHTML = `
14
- <style>
15
- #form {
16
- flex-grow: 1;
17
- display: flex;
18
- flex-direction: column;
19
- }
20
- .buttonContainer {
21
- display: flex;
22
- }
23
- .buttonContainer > igc-button {
24
- flex: 1;
25
- }
26
- </style>
13
+ @customElement('app-$(path)')
14
+ export default class $(ClassName) extends LitElement {
15
+ static styles = css`
16
+ #form {
17
+ flex-grow: 1;
18
+ display: flex;
19
+ flex-direction: column;
20
+ }
21
+ .buttonContainer {
22
+ display: flex;
23
+ }
24
+ .buttonContainer > igc-button {
25
+ flex: 1;
26
+ }
27
+ `;
27
28
 
29
+ private handleSubmit = (event:any) => {
30
+ const customEvent = event as CustomEvent<FormData>;
31
+ const formData = customEvent.detail;
32
+ const formKeys = formData.keys();
33
+ const formEntries = formData.entries();
34
+ let result = '';
35
+ do {
36
+ const pair = formEntries.next().value;
37
+ if (pair) {
38
+ result += `${pair[0]}=${pair[1]};`;
39
+ }
40
+ } while (!formKeys.next().done);
41
+ alert(result);
42
+ }
43
+
44
+ render() {
45
+ return html`
28
46
  <div class="container sample">
29
- <igc-form id="form">
47
+ <igc-form id="form" @igcSubmit="${this.handleSubmit}">
30
48
  <div>Subscribe</div>
31
49
  <igc-input required name="name" type="text" label="Your Name"></igc-input>
32
50
  <igc-input required name="email" type="email" label="Your E-mail"></igc-input>
@@ -39,23 +57,5 @@ export default class $(ClassName) extends HTMLElement {
39
57
  </igc-form>
40
58
  </div>
41
59
  `;
42
-
43
- document.addEventListener('igcSubmit', function (event) {
44
- const customEvent = event as CustomEvent<FormData>;
45
- const formData = customEvent.detail;
46
- const formKeys = formData.keys();
47
- const formEntries = formData.entries();
48
- let result = '';
49
- do {
50
- const pair = formEntries.next().value;
51
- if (pair) {
52
- result += pair[0] + '=' + pair[1] + ';';
53
- }
54
- } while (!formKeys.next().done)
55
- console.log(result);
56
- alert(result);
57
- });
58
60
  }
59
61
  }
60
-
61
- customElements.define('app-$(path)', $(ClassName));
@@ -1,5 +1,5 @@
1
1
  import { expect } from '@open-wc/testing';
2
- import $(ClassName) from './$(path)';
2
+ import $(ClassName) from './$(path).js';
3
3
 
4
4
  describe('IgcDockManagerComponent', () => {
5
5
  it('<app-$(path)> is an instance of $(ClassName)', async () => {
@@ -1,3 +1,5 @@
1
+ import { html, css, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
1
3
  import {
2
4
  IgcDockManagerComponent,
3
5
  IgcDockManagerPaneType,
@@ -7,59 +9,59 @@ import { defineCustomElements } from 'igniteui-dockmanager/loader';
7
9
 
8
10
  defineCustomElements();
9
11
 
10
- export default class $(ClassName) extends HTMLElement {
11
- constructor() {
12
- super();
13
- this.attachShadow({ mode: 'open' });
14
- this.shadowRoot!.innerHTML = `
15
- <style>
16
- :host, igc-dockmanager {
17
- height: 100%;
18
- margin: 0px;
19
- padding-left: 275px;
20
- width: calc(100% - 275px);
21
- }
12
+ @customElement('app-$(path)')
13
+ export default class $(ClassName) extends LitElement {
14
+ static styles = css`
15
+ :host, igc-dockmanager {
16
+ height: 100%;
17
+ margin: 0px;
18
+ padding-left: 275px;
19
+ width: calc(100% - 275px);
20
+ }
22
21
 
23
- .dockManagerContent {
24
- padding: 0.5rem;
25
- height: calc(100% - 1rem);
26
- width: calc(100% - 1rem);
27
- display: flex;
28
- flex-direction: column;
29
- /* background: orange; */
30
- }
22
+ .dockManagerContent {
23
+ padding: 0.5rem;
24
+ height: calc(100% - 1rem);
25
+ width: calc(100% - 1rem);
26
+ display: flex;
27
+ flex-direction: column;
28
+ /* background: orange; */
29
+ }
31
30
 
32
- .dockManagerFull {
33
- padding: 0rem;
34
- margin: 0rem;
35
- height: 100%;
36
- width: 100%;
37
- display: flex;
38
- flex-direction: column;
39
- overflow: hidden;
40
- }
31
+ .dockManagerFull {
32
+ padding: 0rem;
33
+ margin: 0rem;
34
+ height: 100%;
35
+ width: 100%;
36
+ display: flex;
37
+ flex-direction: column;
38
+ overflow: hidden;
39
+ }
41
40
 
42
- .dockManagerFrame {
43
- padding: 0rem;
44
- margin: 0rem;
45
- height: 100%;
46
- width: 100%;
47
- display: flex;
48
- flex-direction: column;
49
- overflow: hidden;
50
- }
41
+ .dockManagerFrame {
42
+ padding: 0rem;
43
+ margin: 0rem;
44
+ height: 100%;
45
+ width: 100%;
46
+ display: flex;
47
+ flex-direction: column;
48
+ overflow: hidden;
49
+ }
51
50
 
52
- .employeesDetailsRow {
53
- height: 4rem;
54
- display: flex;
55
- flex-direction: row;
56
- padding-left: 0.5rem;
57
- padding-right: 0.5rem;
58
- padding-top: 0.5rem;
59
- padding-bottom: 0.5rem;
60
- align-items: center;
61
- }
62
- </style>
51
+ .employeesDetailsRow {
52
+ height: 4rem;
53
+ display: flex;
54
+ flex-direction: row;
55
+ padding-left: 0.5rem;
56
+ padding-right: 0.5rem;
57
+ padding-top: 0.5rem;
58
+ padding-bottom: 0.5rem;
59
+ align-items: center;
60
+ }
61
+ `;
62
+
63
+ render() {
64
+ return html`
63
65
  <igc-dockmanager id="dockManager">
64
66
  <div slot="content1" class="dockManagerContent">Content 1</div>
65
67
  <div slot="content2" class="dockManagerContent">Content 2</div>
@@ -77,8 +79,8 @@ export default class $(ClassName) extends HTMLElement {
77
79
  `;
78
80
  }
79
81
 
80
- connectedCallback() {
81
- const dockManager = document.getElementsByTagName('app-$(path)')[0].shadowRoot!.getElementById('dockManager') as IgcDockManagerComponent;
82
+ firstUpdated() {
83
+ const dockManager = this.shadowRoot?.getElementById('dockManager') as IgcDockManagerComponent;
82
84
  dockManager.layout = {
83
85
  rootPane: {
84
86
  type: IgcDockManagerPaneType.splitPane,
@@ -202,5 +204,3 @@ export default class $(ClassName) extends HTMLElement {
202
204
  };
203
205
  }
204
206
  }
205
-
206
- customElements.define('app-$(path)', $(ClassName));