igniteui-cli 12.0.6 → 12.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 (109) hide show
  1. package/lib/commands/new.js +4 -1
  2. package/lib/templates/IgniteUIForReactTemplate.js +0 -1
  3. package/package.json +3 -3
  4. package/templates/react/igr-es6/index.js +1 -1
  5. package/templates/react/igr-ts/bullet-graph/default/files/src/views/__path__/index.test.tsx +8 -0
  6. package/templates/react/igr-ts/bullet-graph/default/files/src/views/__path__/index.tsx +57 -0
  7. package/templates/react/igr-ts/bullet-graph/default/files/src/views/__path__/style.module.css +12 -0
  8. package/templates/react/igr-ts/bullet-graph/default/index.d.ts +1 -0
  9. package/templates/react/igr-ts/bullet-graph/default/index.js +18 -0
  10. package/templates/react/igr-ts/bullet-graph/index.d.ts +1 -0
  11. package/templates/react/igr-ts/bullet-graph/index.js +15 -0
  12. package/templates/react/igr-ts/category-chart/default/files/src/views/__path__/index.test.tsx +8 -0
  13. package/templates/react/igr-ts/category-chart/default/files/src/views/__path__/index.tsx +41 -0
  14. package/templates/react/igr-ts/category-chart/default/files/src/views/__path__/style.module.css +9 -0
  15. package/templates/react/igr-ts/category-chart/default/index.d.ts +1 -0
  16. package/templates/react/igr-ts/category-chart/default/index.js +19 -0
  17. package/templates/react/igr-ts/category-chart/index.d.ts +1 -0
  18. package/templates/react/igr-ts/category-chart/index.js +16 -0
  19. package/templates/react/igr-ts/doughnut-chart/default/files/src/views/__path__/index.test.tsx +8 -0
  20. package/templates/react/igr-ts/doughnut-chart/default/files/src/views/__path__/index.tsx +63 -0
  21. package/templates/react/igr-ts/doughnut-chart/default/files/src/views/__path__/style.module.css +9 -0
  22. package/templates/react/igr-ts/doughnut-chart/default/index.d.ts +1 -0
  23. package/templates/react/igr-ts/doughnut-chart/default/index.js +18 -0
  24. package/templates/react/igr-ts/doughnut-chart/index.d.ts +1 -0
  25. package/templates/react/igr-ts/doughnut-chart/index.js +15 -0
  26. package/templates/react/igr-ts/financial-chart/default/files/src/views/__path__/index.test.tsx +8 -0
  27. package/templates/react/igr-ts/financial-chart/default/files/src/views/__path__/index.tsx +49 -0
  28. package/templates/react/igr-ts/financial-chart/default/files/src/views/__path__/style.module.css +10 -0
  29. package/templates/react/igr-ts/financial-chart/default/index.d.ts +1 -0
  30. package/templates/react/igr-ts/financial-chart/default/index.js +20 -0
  31. package/templates/react/igr-ts/financial-chart/index.d.ts +1 -0
  32. package/templates/react/igr-ts/financial-chart/index.js +16 -0
  33. package/templates/react/igr-ts/grid/basic/files/src/views/__path__/data.tsx +46 -0
  34. package/templates/react/igr-ts/grid/basic/files/src/views/__path__/index.test.tsx +8 -0
  35. package/templates/react/igr-ts/grid/basic/files/src/views/__path__/index.tsx +63 -0
  36. package/templates/react/igr-ts/grid/basic/files/src/views/__path__/style.module.css +17 -0
  37. package/templates/react/igr-ts/grid/basic/index.d.ts +1 -0
  38. package/templates/react/igr-ts/grid/basic/index.js +23 -0
  39. package/templates/react/igr-ts/grid/index.d.ts +1 -0
  40. package/templates/react/igr-ts/grid/index.js +15 -0
  41. package/templates/react/igr-ts/groups.json +5 -0
  42. package/templates/react/igr-ts/index.d.ts +1 -0
  43. package/templates/react/igr-ts/index.js +17 -0
  44. package/templates/react/igr-ts/linear-gauge/default/files/src/views/__path__/index.test.tsx +8 -0
  45. package/templates/react/igr-ts/linear-gauge/default/files/src/views/__path__/index.tsx +60 -0
  46. package/templates/react/igr-ts/linear-gauge/default/files/src/views/__path__/style.module.css +12 -0
  47. package/templates/react/igr-ts/linear-gauge/default/index.d.ts +1 -0
  48. package/templates/react/igr-ts/linear-gauge/default/index.js +18 -0
  49. package/templates/react/igr-ts/linear-gauge/index.d.ts +1 -0
  50. package/templates/react/igr-ts/linear-gauge/index.js +15 -0
  51. package/templates/react/igr-ts/pie-chart/default/files/src/views/__path__/index.test.tsx +8 -0
  52. package/templates/react/igr-ts/pie-chart/default/files/src/views/__path__/index.tsx +57 -0
  53. package/templates/react/igr-ts/pie-chart/default/files/src/views/__path__/style.module.css +9 -0
  54. package/templates/react/igr-ts/pie-chart/default/index.d.ts +1 -0
  55. package/templates/react/igr-ts/pie-chart/default/index.js +18 -0
  56. package/templates/react/igr-ts/pie-chart/index.d.ts +1 -0
  57. package/templates/react/igr-ts/pie-chart/index.js +15 -0
  58. package/templates/react/igr-ts/projects/_base/files/README.md +48 -0
  59. package/templates/react/igr-ts/projects/_base/files/__dot__editorconfig +3 -0
  60. package/templates/react/igr-ts/projects/_base/files/__dot__env +1 -0
  61. package/templates/react/igr-ts/projects/_base/files/__dot__eslintrc.cjs +18 -0
  62. package/templates/react/igr-ts/projects/_base/files/__dot__gitignore +23 -0
  63. package/templates/react/igr-ts/projects/_base/files/ignite-ui-cli.json +16 -0
  64. package/templates/react/igr-ts/projects/_base/files/index.html +33 -0
  65. package/templates/react/igr-ts/projects/_base/files/package.json +52 -0
  66. package/templates/react/igr-ts/projects/_base/files/public/favicon.ico +0 -0
  67. package/templates/react/igr-ts/projects/_base/files/public/manifest.json +15 -0
  68. package/templates/react/igr-ts/projects/_base/files/src/App.test.tsx +8 -0
  69. package/templates/react/igr-ts/projects/_base/files/src/App.tsx +10 -0
  70. package/templates/react/igr-ts/projects/_base/files/src/index.css +14 -0
  71. package/templates/react/igr-ts/projects/_base/files/src/main.tsx +17 -0
  72. package/templates/react/igr-ts/projects/_base/files/src/routes.json +3 -0
  73. package/templates/react/igr-ts/projects/_base/files/src/setupTests.ts +5 -0
  74. package/templates/react/igr-ts/projects/_base/files/src/vite-env.d.ts +1 -0
  75. package/templates/react/igr-ts/projects/_base/files/tsconfig.json +25 -0
  76. package/templates/react/igr-ts/projects/_base/files/tsconfig.node.json +10 -0
  77. package/templates/react/igr-ts/projects/_base/files/vite.config.ts +20 -0
  78. package/templates/react/igr-ts/projects/_base/index.d.ts +29 -0
  79. package/templates/react/igr-ts/projects/_base/index.js +58 -0
  80. package/templates/react/igr-ts/projects/_base_with_home/files/public/logo.svg +7 -0
  81. package/templates/react/igr-ts/projects/_base_with_home/files/src/App.module.css +36 -0
  82. package/templates/react/igr-ts/projects/_base_with_home/files/src/App.test.tsx +8 -0
  83. package/templates/react/igr-ts/projects/_base_with_home/files/src/App.tsx +21 -0
  84. package/templates/react/igr-ts/projects/_base_with_home/files/src/setupTests.ts +5 -0
  85. package/templates/react/igr-ts/projects/_base_with_home/index.d.ts +14 -0
  86. package/templates/react/igr-ts/projects/_base_with_home/index.js +22 -0
  87. package/templates/react/igr-ts/projects/base/index.d.ts +14 -0
  88. package/templates/react/igr-ts/projects/base/index.js +22 -0
  89. package/templates/react/igr-ts/projects/empty/index.d.ts +14 -0
  90. package/templates/react/igr-ts/projects/empty/index.js +22 -0
  91. package/templates/react/igr-ts/projects/top-nav/files/src/App.css +59 -0
  92. package/templates/react/igr-ts/projects/top-nav/files/src/App.tsx +31 -0
  93. package/templates/react/igr-ts/projects/top-nav/files/src/components/navigation-header/index.tsx +29 -0
  94. package/templates/react/igr-ts/projects/top-nav/files/src/hoc/asyncComponent.tsx +50 -0
  95. package/templates/react/igr-ts/projects/top-nav/files/src/routes.json +7 -0
  96. package/templates/react/igr-ts/projects/top-nav/files/src/setupTests.ts +5 -0
  97. package/templates/react/igr-ts/projects/top-nav/files/src/views/home/index.tsx +17 -0
  98. package/templates/react/igr-ts/projects/top-nav/files/src/views/home/logo.svg +7 -0
  99. package/templates/react/igr-ts/projects/top-nav/files/src/views/home/style.module.css +27 -0
  100. package/templates/react/igr-ts/projects/top-nav/index.d.ts +14 -0
  101. package/templates/react/igr-ts/projects/top-nav/index.js +22 -0
  102. package/templates/react/igr-ts/radial-gauge/default/files/src/views/__path__/index.test.tsx +8 -0
  103. package/templates/react/igr-ts/radial-gauge/default/files/src/views/__path__/index.tsx +61 -0
  104. package/templates/react/igr-ts/radial-gauge/default/files/src/views/__path__/style.module.css +12 -0
  105. package/templates/react/igr-ts/radial-gauge/default/index.d.ts +1 -0
  106. package/templates/react/igr-ts/radial-gauge/default/index.js +19 -0
  107. package/templates/react/igr-ts/radial-gauge/index.d.ts +1 -0
  108. package/templates/react/igr-ts/radial-gauge/index.js +16 -0
  109. package/templates/react/index.js +1 -0
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
+ "module": "ESNext",
7
+ "skipLibCheck": true,
8
+
9
+ /* Bundler mode */
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "noEmit": true,
15
+ "jsx": "react-jsx",
16
+
17
+ /* Linting */
18
+ "strict": false,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "noFallthroughCasesInSwitch": true
22
+ },
23
+ "include": ["src", "vite.config.ts"],
24
+ "references": [{ "path": "./tsconfig.node.json" }]
25
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "skipLibCheck": true,
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "allowSyntheticDefaultImports": true
8
+ },
9
+ "include": ["vite.config.ts"]
10
+ }
@@ -0,0 +1,20 @@
1
+ /// <reference types="vitest" />
2
+ import { defineConfig } from 'vite'
3
+ import react from '@vitejs/plugin-react'
4
+
5
+ // https://vitejs.dev/config/
6
+ export default defineConfig({
7
+ define: process.env.VITEST ? {} : { global: 'window' },
8
+ plugins: [react()],
9
+ test: {
10
+ globals: true,
11
+ environment: 'jsdom',
12
+ setupFiles: ['./src/setupTests.ts'],
13
+ deps: {
14
+ inline: ['vitest-canvas-mock'],
15
+ },
16
+ },
17
+ resolve: {
18
+ mainFields: ['module'],
19
+ }
20
+ })
@@ -0,0 +1,29 @@
1
+ import { ControlExtraConfiguration, ProjectTemplate } from "@igniteui/cli-core";
2
+ export declare class BaseIgrTsProject implements ProjectTemplate {
3
+ id: string;
4
+ name: string;
5
+ description: string;
6
+ framework: string;
7
+ projectType: string;
8
+ dependencies: string[];
9
+ hasExtraConfiguration: boolean;
10
+ delimiters: import("@igniteui/cli-core").TemplateDelimiters;
11
+ get templatePaths(): string[];
12
+ generateConfig(name: string, theme: string, ...options: any[]): {
13
+ [key: string]: any;
14
+ };
15
+ installModules(): void;
16
+ upgradeIgniteUIPackages(projectPath: string, packagePath: string): Promise<boolean>;
17
+ getExtraConfiguration(): ControlExtraConfiguration[];
18
+ setExtraConfiguration(extraConfigKeys: {}): void;
19
+ protected getVariablesConfig(name: string, theme: string): {
20
+ name: string;
21
+ theme: string;
22
+ cliVersion: string;
23
+ "dash-name": string;
24
+ description: string;
25
+ dot: string;
26
+ path: string;
27
+ projectTemplate: string;
28
+ };
29
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.BaseIgrTsProject = void 0;
13
+ const cli_core_1 = require("@igniteui/cli-core");
14
+ const path = require("path");
15
+ class BaseIgrTsProject {
16
+ constructor() {
17
+ this.id = "base";
18
+ this.name = "base";
19
+ this.description = "Ignite UI CLI project for React";
20
+ this.framework = "react";
21
+ this.projectType = "tsx";
22
+ this.hasExtraConfiguration = false;
23
+ this.delimiters = cli_core_1.defaultDelimiters;
24
+ }
25
+ get templatePaths() {
26
+ return [path.join(__dirname, "files")];
27
+ }
28
+ generateConfig(name, theme, ...options) {
29
+ return this.getVariablesConfig(name, theme);
30
+ }
31
+ installModules() {
32
+ throw new Error("Method not implemented.");
33
+ }
34
+ upgradeIgniteUIPackages(projectPath, packagePath) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ throw new Error("Method not implemented.");
37
+ });
38
+ }
39
+ getExtraConfiguration() {
40
+ throw new Error("Method not implemented.");
41
+ }
42
+ setExtraConfiguration(extraConfigKeys) {
43
+ throw new Error("Method not implemented.");
44
+ }
45
+ getVariablesConfig(name, theme) {
46
+ return {
47
+ name,
48
+ theme,
49
+ "cliVersion": cli_core_1.Util.version(),
50
+ "dash-name": cli_core_1.Util.lowerDashed(name),
51
+ "description": this.description,
52
+ "dot": ".",
53
+ "path": name,
54
+ "projectTemplate": this.id
55
+ };
56
+ }
57
+ }
58
+ exports.BaseIgrTsProject = BaseIgrTsProject;
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
2
+ <g fill="#61DAFB">
3
+ <path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
4
+ <circle cx="420.9" cy="296.5" r="45.7"/>
5
+ <path d="M520.5 78.1z"/>
6
+ </g>
7
+ </svg>
@@ -0,0 +1,36 @@
1
+ :local(.logo) {
2
+ animation: App-logo-spin infinite 20s linear;
3
+ height: 40vmin;
4
+ }
5
+
6
+ :local(.header) {
7
+ padding-top: 5em;
8
+ display: flex;
9
+ flex-direction: column;
10
+ align-items: center;
11
+ justify-content: center;
12
+ font-size: calc(10px + 2vmin);
13
+ color: #333;
14
+ }
15
+
16
+ :local(.link) {
17
+ color: #61dafb;
18
+ }
19
+
20
+ :local(.app__name) {
21
+ padding-top: 1em;
22
+ display: flex;
23
+ flex-direction: column;
24
+ align-items: center;
25
+ justify-content: center;
26
+ font-size: calc(10px + 2vmin);
27
+ }
28
+
29
+ @keyframes App-logo-spin {
30
+ from {
31
+ transform: rotate(0deg);
32
+ }
33
+ to {
34
+ transform: rotate(360deg);
35
+ }
36
+ }
@@ -0,0 +1,8 @@
1
+ import { expect, test } from 'vitest';
2
+ import { render } from '@testing-library/react';
3
+ import App from './App';
4
+
5
+ test('renders without crashing', () => {
6
+ const wrapper = render(<App />);
7
+ expect(wrapper).toBeTruthy();
8
+ });
@@ -0,0 +1,21 @@
1
+ import logo from '/logo.svg';
2
+ import styles from './App.module.css';
3
+
4
+ export default function App() {
5
+ const name = "$(name)";
6
+ return (
7
+ <div className="app">
8
+ <div className={styles.app__name}>{name}</div>
9
+ <header className={styles.header}>
10
+ <img src={logo} className={styles.logo} alt="logo" />
11
+ <p>Welcome to Ignite UI for React!</p>
12
+ <a className={styles.link}
13
+ href="https://www.infragistics.com/products/ignite-ui-react"
14
+ target="_blank"
15
+ rel="noopener noreferrer">
16
+ Learn More
17
+ </a>
18
+ </header>
19
+ </div>
20
+ )
21
+ }
@@ -0,0 +1,5 @@
1
+ import '@testing-library/jest-dom'
2
+ import 'vitest-canvas-mock'
3
+ import ResizeObserver from 'resize-observer-polyfill'
4
+
5
+ global.ResizeObserver = ResizeObserver
@@ -0,0 +1,14 @@
1
+ import { ProjectTemplate } from "@igniteui/cli-core";
2
+ import { BaseIgrTsProject } from "../_base";
3
+ export declare class BaseWithHomeIgrTsProject extends BaseIgrTsProject implements ProjectTemplate {
4
+ id: string;
5
+ name: string;
6
+ description: string;
7
+ dependencies: string[];
8
+ framework: string;
9
+ projectType: string;
10
+ hasExtraConfiguration: boolean;
11
+ get templatePaths(): string[];
12
+ }
13
+ declare const _default: BaseWithHomeIgrTsProject;
14
+ export default _default;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseWithHomeIgrTsProject = void 0;
4
+ const path = require("path");
5
+ const _base_1 = require("../_base");
6
+ class BaseWithHomeIgrTsProject extends _base_1.BaseIgrTsProject {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.id = "base-with-home";
10
+ this.name = "Base with home";
11
+ this.description = "React project structure with home view";
12
+ this.dependencies = [];
13
+ this.framework = "react";
14
+ this.projectType = "igr-ts";
15
+ this.hasExtraConfiguration = false;
16
+ }
17
+ get templatePaths() {
18
+ return [...super.templatePaths, path.join(__dirname, "files")];
19
+ }
20
+ }
21
+ exports.BaseWithHomeIgrTsProject = BaseWithHomeIgrTsProject;
22
+ exports.default = new BaseWithHomeIgrTsProject();
@@ -0,0 +1,14 @@
1
+ import { ProjectTemplate } from "@igniteui/cli-core";
2
+ import { BaseIgrTsProject } from "../_base";
3
+ export declare class BasePageIgrTsProject extends BaseIgrTsProject implements ProjectTemplate {
4
+ id: string;
5
+ name: string;
6
+ description: string;
7
+ dependencies: string[];
8
+ framework: string;
9
+ projectType: string;
10
+ hasExtraConfiguration: boolean;
11
+ get templatePaths(): string[];
12
+ }
13
+ declare const _default: BasePageIgrTsProject;
14
+ export default _default;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BasePageIgrTsProject = void 0;
4
+ const path = require("path");
5
+ const _base_1 = require("../_base");
6
+ class BasePageIgrTsProject extends _base_1.BaseIgrTsProject {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.id = "base";
10
+ this.name = "Base project";
11
+ this.description = "Empty project structure";
12
+ this.dependencies = [];
13
+ this.framework = "react";
14
+ this.projectType = "igr-ts";
15
+ this.hasExtraConfiguration = false;
16
+ }
17
+ get templatePaths() {
18
+ return [...super.templatePaths, path.join(__dirname, "files")];
19
+ }
20
+ }
21
+ exports.BasePageIgrTsProject = BasePageIgrTsProject;
22
+ exports.default = new BasePageIgrTsProject();
@@ -0,0 +1,14 @@
1
+ import { ProjectTemplate } from "@igniteui/cli-core";
2
+ import { BaseWithHomeIgrTsProject } from "../_base_with_home";
3
+ export declare class EmptyIgrTsProject extends BaseWithHomeIgrTsProject implements ProjectTemplate {
4
+ id: string;
5
+ name: string;
6
+ description: string;
7
+ dependencies: string[];
8
+ framework: string;
9
+ projectType: string;
10
+ hasExtraConfiguration: boolean;
11
+ get templatePaths(): string[];
12
+ }
13
+ declare const _default: EmptyIgrTsProject;
14
+ export default _default;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmptyIgrTsProject = void 0;
4
+ const path = require("path");
5
+ const _base_with_home_1 = require("../_base_with_home");
6
+ class EmptyIgrTsProject extends _base_with_home_1.BaseWithHomeIgrTsProject {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.id = "empty";
10
+ this.name = "Empty project";
11
+ this.description = "Empty project structure with home page";
12
+ this.dependencies = [];
13
+ this.framework = "react";
14
+ this.projectType = "igr-ts";
15
+ this.hasExtraConfiguration = false;
16
+ }
17
+ get templatePaths() {
18
+ return [...super.templatePaths, path.join(__dirname, "files")];
19
+ }
20
+ }
21
+ exports.EmptyIgrTsProject = EmptyIgrTsProject;
22
+ exports.default = new EmptyIgrTsProject();
@@ -0,0 +1,59 @@
1
+ .app {
2
+ text-align: center;
3
+ display: flex;
4
+ flex-flow: column;
5
+ min-height: 100vh;
6
+ }
7
+
8
+ .content {
9
+ flex: 1 0 auto;
10
+ padding: 1em;
11
+ }
12
+
13
+ /* quick nav menubar */
14
+ nav, .app__name {
15
+ background-color: rgb(0, 153, 255);
16
+ box-sizing: border-box;
17
+ }
18
+ .app__name {
19
+ font-weight: 600;
20
+ font-size: 24px;
21
+ line-height: 32px;
22
+ padding-left: 24px;
23
+ text-align: left;
24
+ color: #FFF;
25
+ padding-bottom: 8px;
26
+ }
27
+
28
+ nav ul {
29
+ list-style: none;
30
+ display: flex;
31
+ justify-content: flex-start;
32
+ flex-wrap: wrap;
33
+ margin: 0;
34
+ padding: 0;
35
+ }
36
+
37
+ nav ul a {
38
+ color: #fff;
39
+ line-height: 2;
40
+ text-decoration: none;
41
+ margin: 0 5px;
42
+ }
43
+
44
+ nav ul a.active {
45
+ color: #fff;
46
+ font-weight: 600;
47
+ }
48
+ nav ul li {
49
+ margin: 0px 16px;
50
+ box-sizing: border-box;
51
+ border-bottom: 1px solid transparent;
52
+ }
53
+ nav ul li.active {
54
+ border-bottom: 2px solid #fff;
55
+ }
56
+ nav ul li:not(.active):hover {
57
+ border-bottom: 1px solid #fff;
58
+ }
59
+
@@ -0,0 +1,31 @@
1
+ import { Route, BrowserRouter as Router, Switch } from "react-router-dom";
2
+ import asyncComponent from "./hoc/asyncComponent";
3
+ import NavigationHeader from "./components/navigation-header/index";
4
+ import routes from "./routes.json";
5
+ import "./App.css";
6
+
7
+ export default function App() {
8
+ const name = "$(name)";
9
+ return (
10
+ <Router>
11
+ <div className="app">
12
+ <div className="app__name">{name}</div>
13
+ <NavigationHeader routes={routes}></NavigationHeader>
14
+ <div className="content">
15
+ <Switch>
16
+ {routes.map((route, i) => (
17
+ <Route
18
+ exact
19
+ key={i}
20
+ path={route.path}
21
+ component={asyncComponent(() =>
22
+ import("" + route.componentPath)
23
+ )}
24
+ />
25
+ ))}
26
+ </Switch>
27
+ </div>
28
+ </div>
29
+ </Router>
30
+ );
31
+ }
@@ -0,0 +1,29 @@
1
+ import { useState, useEffect } from 'react';
2
+ import { NavLink } from 'react-router-dom';
3
+
4
+ export default function NavigationHeader({ routes }) {
5
+ const [state, setState] = useState({ activeItem: null });
6
+
7
+ function handleClick(index) {
8
+ setState({ activeItem: index });
9
+ }
10
+
11
+ useEffect(() => {
12
+ let currentRoute = window.location.href.split(window.location.origin)[1];
13
+ if (!currentRoute) {
14
+ currentRoute = '/'
15
+ }
16
+ const activeItem = routes.findIndex((route) => route.path === currentRoute);
17
+ setState({ activeItem });
18
+ }, [routes]);
19
+
20
+ return (
21
+ <nav>
22
+ <ul>
23
+ {routes.map(
24
+ (route, i) => <li key={i} className={state.activeItem === i ? 'active' : ''}><NavLink onClick={() => handleClick(i)} exact to={route.path}>{route.text}</NavLink></li>
25
+ )}
26
+ </ul>
27
+ </nav>
28
+ )
29
+ }
@@ -0,0 +1,50 @@
1
+ import { Component } from 'react';
2
+
3
+ // https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html
4
+ const makeCancelable = (promise) => {
5
+ let hasCanceled_ = false;
6
+
7
+ const wrappedPromise = new Promise((resolve, reject) => {
8
+ promise.then(
9
+ val => hasCanceled_ ? reject({isCanceled: true}) : resolve(val),
10
+ error => hasCanceled_ ? reject({isCanceled: true}) : reject(error)
11
+ );
12
+ });
13
+
14
+ return {
15
+ promise: wrappedPromise,
16
+ cancel() {
17
+ hasCanceled_ = true;
18
+ },
19
+ };
20
+ };
21
+
22
+ /**
23
+ * https://medium.com/front-end-weekly/loading-components-asynchronously-in-react-app-with-an-hoc-61ca27c4fda7
24
+ * @param {function} importComponent
25
+ */
26
+ const asyncComponent = (importComponent) => {
27
+ return class extends Component {
28
+ state = {
29
+ component: null
30
+ }
31
+
32
+ componentDidMount() {
33
+ this.op = makeCancelable(importComponent());
34
+ this.op.promise.then(cmp => {
35
+ this.setState({component: cmp.default});
36
+ });
37
+ }
38
+
39
+ componentWillUnmount() {
40
+ this.op.cancel();
41
+ }
42
+
43
+ render() {
44
+ const C = this.state.component;
45
+ return C ? <C {...this.props}/> : null;
46
+ }
47
+ }
48
+ };
49
+
50
+ export default asyncComponent;
@@ -0,0 +1,7 @@
1
+ [
2
+ {
3
+ "path": "/",
4
+ "componentPath": "./views/home",
5
+ "text": "Home"
6
+ }
7
+ ]
@@ -0,0 +1,5 @@
1
+ import '@testing-library/jest-dom'
2
+ import 'vitest-canvas-mock'
3
+ import ResizeObserver from 'resize-observer-polyfill'
4
+
5
+ global.ResizeObserver = ResizeObserver
@@ -0,0 +1,17 @@
1
+ import logo from './logo.svg';
2
+ import styles from './style.module.css';
3
+
4
+ export default function Home() {
5
+ return (
6
+ <header className={styles.header}>
7
+ <img src={logo} className={styles.logo} alt="logo" />
8
+ <p>Welcome to Ignite UI for React!</p>
9
+ <a className={styles.link}
10
+ href="https://www.infragistics.com/products/ignite-ui-react"
11
+ target="_blank"
12
+ rel="noopener noreferrer">
13
+ Learn More
14
+ </a>
15
+ </header>
16
+ )
17
+ }
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
2
+ <g fill="#61DAFB">
3
+ <path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
4
+ <circle cx="420.9" cy="296.5" r="45.7"/>
5
+ <path d="M520.5 78.1z"/>
6
+ </g>
7
+ </svg>
@@ -0,0 +1,27 @@
1
+ :local(.logo) {
2
+ animation: App-logo-spin infinite 20s linear;
3
+ height: 40vmin;
4
+ }
5
+
6
+ :local(.header) {
7
+ padding-top: 5em;
8
+ display: flex;
9
+ flex-direction: column;
10
+ align-items: center;
11
+ justify-content: center;
12
+ font-size: calc(10px + 2vmin);
13
+ color: #333;
14
+ }
15
+
16
+ :local(.link) {
17
+ color: #61dafb;
18
+ }
19
+
20
+ @keyframes App-logo-spin {
21
+ from {
22
+ transform: rotate(0deg);
23
+ }
24
+ to {
25
+ transform: rotate(360deg);
26
+ }
27
+ }
@@ -0,0 +1,14 @@
1
+ import { ProjectTemplate } from "@igniteui/cli-core";
2
+ import { BaseIgrTsProject } from "../_base";
3
+ export declare class TopNavIgrTsProject extends BaseIgrTsProject implements ProjectTemplate {
4
+ id: string;
5
+ name: string;
6
+ description: string;
7
+ dependencies: string[];
8
+ framework: string;
9
+ projectType: string;
10
+ hasExtraConfiguration: boolean;
11
+ get templatePaths(): string[];
12
+ }
13
+ declare const _default: TopNavIgrTsProject;
14
+ export default _default;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TopNavIgrTsProject = void 0;
4
+ const path = require("path");
5
+ const _base_1 = require("../_base");
6
+ class TopNavIgrTsProject extends _base_1.BaseIgrTsProject {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.id = "top-nav";
10
+ this.name = "Default top navigation";
11
+ this.description = "Project structure with top navigation menu";
12
+ this.dependencies = [];
13
+ this.framework = "react";
14
+ this.projectType = "igr-ts";
15
+ this.hasExtraConfiguration = false;
16
+ }
17
+ get templatePaths() {
18
+ return [...super.templatePaths, path.join(__dirname, "files")];
19
+ }
20
+ }
21
+ exports.TopNavIgrTsProject = TopNavIgrTsProject;
22
+ exports.default = new TopNavIgrTsProject();
@@ -0,0 +1,8 @@
1
+ import { expect, test } from 'vitest';
2
+ import { render } from '@testing-library/react';
3
+ import $(ClassName) from './index';
4
+
5
+ test('renders $(ClassName) component', () => {
6
+ const wrapper = render(<$(ClassName) />);
7
+ expect(wrapper).toBeTruthy();
8
+ });