igniteui-cli 13.1.11 → 13.1.12-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/upgrade.js +4 -5
- package/lib/templates/IgniteUIForReactTemplate.js +1 -1
- package/lib/templates/IgniteUIForWebComponentsTemplate.js +1 -2
- package/package.json +3 -3
- package/templates/react/ReactTypeScriptFileUpdate.d.ts +4 -4
- package/templates/react/ReactTypeScriptFileUpdate.js +33 -19
- package/templates/react/igr-ts/bullet-graph/default/files/src/app/__path__/__filePrefix__.test.tsx +3 -3
- package/templates/react/igr-ts/bullet-graph/default/files/src/app/__path__/__filePrefix__.tsx +46 -46
- package/templates/react/igr-ts/bullet-graph/default/files/src/app/__path__/style.module.css +6 -6
- package/templates/react/igr-ts/category-chart/default/files/src/app/__path__/__filePrefix__.test.tsx +3 -3
- package/templates/react/igr-ts/category-chart/default/files/src/app/__path__/__filePrefix__.tsx +27 -27
- package/templates/react/igr-ts/category-chart/default/files/src/app/__path__/style.module.css +5 -5
- package/templates/react/igr-ts/category-chart/index.js +1 -1
- package/templates/react/igr-ts/doughnut-chart/default/files/src/app/__path__/__filePrefix__.test.tsx +3 -3
- package/templates/react/igr-ts/doughnut-chart/default/files/src/app/__path__/__filePrefix__.tsx +41 -41
- package/templates/react/igr-ts/doughnut-chart/default/files/src/app/__path__/style.module.css +5 -5
- package/templates/react/igr-ts/financial-chart/default/files/src/app/__path__/__filePrefix__.test.tsx +3 -3
- package/templates/react/igr-ts/financial-chart/default/files/src/app/__path__/__filePrefix__.tsx +34 -34
- package/templates/react/igr-ts/financial-chart/default/files/src/app/__path__/style.module.css +7 -6
- package/templates/react/igr-ts/financial-chart/index.js +1 -1
- package/templates/react/igr-ts/grid/basic/files/src/app/__path__/__filePrefix__.test.tsx +3 -3
- package/templates/react/igr-ts/grid/basic/files/src/app/__path__/__filePrefix__.tsx +45 -45
- package/templates/react/igr-ts/grid/basic/files/src/app/__path__/data.tsx +40 -40
- package/templates/react/igr-ts/grid/basic/files/src/app/__path__/style.module.css +9 -9
- package/templates/react/igr-ts/linear-gauge/default/files/src/app/__path__/__filePrefix__.test.tsx +3 -3
- package/templates/react/igr-ts/linear-gauge/default/files/src/app/__path__/__filePrefix__.tsx +52 -51
- package/templates/react/igr-ts/linear-gauge/default/files/src/app/__path__/style.module.css +6 -6
- package/templates/react/igr-ts/pie-chart/default/files/src/app/__path__/__filePrefix__.test.tsx +3 -3
- package/templates/react/igr-ts/pie-chart/default/files/src/app/__path__/__filePrefix__.tsx +39 -40
- package/templates/react/igr-ts/pie-chart/default/files/src/app/__path__/style.module.css +5 -5
- package/templates/react/igr-ts/projects/_base/files/package.json +3 -2
- package/templates/react/igr-ts/projects/_base/files/src/app/app.test.tsx +1 -0
- package/templates/react/igr-ts/projects/_base/files/src/app/style-utils.ts +1 -1
- package/templates/react/igr-ts/projects/_base/files/src/main.tsx +1 -1
- package/templates/react/igr-ts/projects/_base/index.js +1 -1
- package/templates/react/igr-ts/projects/_base_with_home/files/src/app/home/home.tsx +18 -18
- package/templates/react/igr-ts/projects/top-nav/files/src/app/app.tsx +11 -11
- package/templates/react/igr-ts/projects/top-nav/files/src/components/navigation-header/index.tsx +21 -21
- package/templates/react/igr-ts/radial-gauge/default/files/src/app/__path__/__filePrefix__.test.tsx +3 -3
- package/templates/react/igr-ts/radial-gauge/default/files/src/app/__path__/__filePrefix__.tsx +50 -50
- package/templates/react/igr-ts/radial-gauge/default/files/src/app/__path__/style.module.css +5 -5
- package/templates/react/igr-ts/radial-gauge/index.js +1 -1
- package/templates/webcomponents/igc-ts/projects/_base/files/__dot__github/workflows/node.js.yml +2 -2
- package/templates/webcomponents/igc-ts/projects/_base/index.js +3 -2
- package/templates/webcomponents/package-resolve.d.ts +0 -12
- package/templates/webcomponents/package-resolve.js +0 -42
package/lib/commands/upgrade.js
CHANGED
|
@@ -42,11 +42,10 @@ command = {
|
|
|
42
42
|
case "jquery":
|
|
43
43
|
cli_core_1.Util.log("Upgrading packages for jQuery projects is currently not supported!");
|
|
44
44
|
return;
|
|
45
|
-
case "react":
|
|
46
|
-
cli_core_1.Util.log("Upgrading packages for React projects is currently not supported!");
|
|
47
|
-
return;
|
|
48
45
|
case "angular":
|
|
49
|
-
|
|
46
|
+
case "react":
|
|
47
|
+
case "webcomponents":
|
|
48
|
+
if (projectType === "igx-ts" || projectType === "igr-ts" || projectType === "igc-ts") {
|
|
50
49
|
const projectLibrary = command.templateManager.getProjectLibrary(framework, projectType);
|
|
51
50
|
let project;
|
|
52
51
|
if (!config.project.projectTemplate || !projectLibrary.hasProject(config.project.projectTemplate)) {
|
|
@@ -69,7 +68,7 @@ command = {
|
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
|
-
else {
|
|
71
|
+
else if (framework.toLowerCase() === "angular") {
|
|
73
72
|
cli_core_1.Util.log("Upgrading packages for Angular Wrappers projects is currently not supported!");
|
|
74
73
|
return;
|
|
75
74
|
}
|
|
@@ -58,7 +58,7 @@ class IgniteUIForReactTemplate {
|
|
|
58
58
|
let filePath = path.posix.join(projectPath, options.modulePath, `${lowerDashed}.tsx`);
|
|
59
59
|
const routingModule = new ReactTypeScriptFileUpdate_1.ReactTypeScriptFileUpdate(path.join(projectPath, routeModulePath));
|
|
60
60
|
if (defaultPath) {
|
|
61
|
-
routingModule.addRoute(
|
|
61
|
+
routingModule.addRoute(lowerDashed, options.className, nameFromPath, filePath, options.routerChildren, undefined, defaultPath);
|
|
62
62
|
}
|
|
63
63
|
routingModule.addRoute(lowerDashed, options.className, nameFromPath, filePath, options.routerChildren, undefined);
|
|
64
64
|
if (options.hasChildren) {
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.IgniteUIForWebComponentsTemplate = void 0;
|
|
4
4
|
const cli_core_1 = require("@igniteui/cli-core");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
const package_resolve_1 = require("../../templates/webcomponents/package-resolve");
|
|
7
6
|
const TypeScriptFileUpdate_1 = require("../../templates/webcomponents/TypeScriptFileUpdate");
|
|
8
7
|
class IgniteUIForWebComponentsTemplate {
|
|
9
8
|
constructor(rootPath) {
|
|
@@ -59,7 +58,7 @@ class IgniteUIForWebComponentsTemplate {
|
|
|
59
58
|
config["description"] = this.description;
|
|
60
59
|
config["cliVersion"] = cli_core_1.Util.version();
|
|
61
60
|
config["camelCaseName"] = cli_core_1.Util.camelCase(name);
|
|
62
|
-
config["dockManagerPackage"] = (0,
|
|
61
|
+
config["dockManagerPackage"] = (0, cli_core_1.resolvePackage)(cli_core_1.NPM_DOCK_MANAGER);
|
|
63
62
|
return config;
|
|
64
63
|
}
|
|
65
64
|
folderName(pathName) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "igniteui-cli",
|
|
3
|
-
"version": "13.1.
|
|
3
|
+
"version": "13.1.12-beta.2",
|
|
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": "
|
|
76
|
-
"@igniteui/cli-core": "
|
|
75
|
+
"@igniteui/angular-templates": "^17.1.13112-beta.2",
|
|
76
|
+
"@igniteui/cli-core": "^13.1.12-beta.2",
|
|
77
77
|
"chalk": "^2.3.2",
|
|
78
78
|
"fs-extra": "^3.0.1",
|
|
79
79
|
"glob": "^7.1.2",
|
|
@@ -18,18 +18,18 @@ export declare class ReactTypeScriptFileUpdate {
|
|
|
18
18
|
constructor(targetPath: string);
|
|
19
19
|
/** Applies accumulated transforms, saves and formats the file */
|
|
20
20
|
finalize(): void;
|
|
21
|
-
addRoute(path: string, component: string, name: string, filePath: string, routerChildren: string, importAlias: string,
|
|
21
|
+
addRoute(path: string, component: string, name: string, filePath: string, routerChildren: string, importAlias: string, defaultRoute?: boolean): void;
|
|
22
22
|
/** Initializes existing imports info, [re]sets import and `NgModule` edits */
|
|
23
23
|
protected initState(): void;
|
|
24
24
|
protected loadImportsMeta(): {
|
|
25
25
|
lastIndex: number;
|
|
26
26
|
modulePaths: any[];
|
|
27
27
|
};
|
|
28
|
-
protected addRouteModuleEntry(path: string, component: string, name: string, filePath: string, routerChildren: string, importAlias: string,
|
|
29
|
-
protected requestImport(modulePath: string, routerAlias: string, componentName: string): void;
|
|
28
|
+
protected addRouteModuleEntry(path: string, component: string, name: string, filePath: string, routerChildren: string, importAlias: string, defaultRoute?: boolean): void;
|
|
29
|
+
protected requestImport(modulePath: string, routerAlias: string, componentName: string, namedImport?: boolean): void;
|
|
30
30
|
/** Add `import` statements not previously found in the file */
|
|
31
31
|
protected addNewFileImports(): void;
|
|
32
|
-
protected createIdentifierImport(importPath: string, as: string, component: string): ts.ImportDeclaration;
|
|
32
|
+
protected createIdentifierImport(importPath: string, as: string, component: string, namedImport: boolean): ts.ImportDeclaration;
|
|
33
33
|
/** Transformation to apply edits to existing named import declarations */
|
|
34
34
|
protected importsTransformer: ts.TransformerFactory<ts.Node>;
|
|
35
35
|
/** Format a TS source file, very TBD */
|
|
@@ -46,8 +46,8 @@ class ReactTypeScriptFileUpdate {
|
|
|
46
46
|
// reset state in case of further updates
|
|
47
47
|
this.initState();
|
|
48
48
|
}
|
|
49
|
-
addRoute(path, component, name, filePath, routerChildren, importAlias,
|
|
50
|
-
this.addRouteModuleEntry(path, component, name, filePath, routerChildren, importAlias,
|
|
49
|
+
addRoute(path, component, name, filePath, routerChildren, importAlias, defaultRoute = false) {
|
|
50
|
+
this.addRouteModuleEntry(path, component, name, filePath, routerChildren, importAlias, defaultRoute);
|
|
51
51
|
}
|
|
52
52
|
//#region File state
|
|
53
53
|
/** Initializes existing imports info, [re]sets import and `NgModule` edits */
|
|
@@ -82,12 +82,15 @@ class ReactTypeScriptFileUpdate {
|
|
|
82
82
|
return meta;
|
|
83
83
|
}
|
|
84
84
|
//#endregion File state
|
|
85
|
-
addRouteModuleEntry(path, component, name, filePath, routerChildren, importAlias,
|
|
86
|
-
const isRouting = path.indexOf(
|
|
85
|
+
addRouteModuleEntry(path, component, name, filePath, routerChildren, importAlias, defaultRoute = false) {
|
|
86
|
+
const isRouting = path.indexOf(DEFAULT_ROUTES_VARIABLE) >= 0;
|
|
87
87
|
if (isRouting && this.targetSource.text.indexOf(path.slice(0, -4)) > 0) {
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
|
-
if (
|
|
90
|
+
if (defaultRoute) {
|
|
91
|
+
this.requestImport("react-router-dom", undefined, "redirect", true);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
91
94
|
const relativePath = cli_core_1.Util.relativePath(this.targetPath, filePath, true, true);
|
|
92
95
|
this.requestImport(relativePath, importAlias, component);
|
|
93
96
|
}
|
|
@@ -96,7 +99,7 @@ class ReactTypeScriptFileUpdate {
|
|
|
96
99
|
// the visitor that should be used when adding routes to the main route array
|
|
97
100
|
const conditionalVisitor = (node) => {
|
|
98
101
|
if (node.kind === ts.SyntaxKind.ArrayLiteralExpression) {
|
|
99
|
-
const newObject = this.createRouteEntry(path, component, name, routerChildren);
|
|
102
|
+
const newObject = this.createRouteEntry(path, component, name, routerChildren, defaultRoute);
|
|
100
103
|
const array = node;
|
|
101
104
|
this.createdStringLiterals.push(path, name);
|
|
102
105
|
const notFoundWildCard = ".*";
|
|
@@ -126,7 +129,7 @@ class ReactTypeScriptFileUpdate {
|
|
|
126
129
|
if (!isRouting) {
|
|
127
130
|
visitCondition = (node) => {
|
|
128
131
|
return node.kind === ts.SyntaxKind.VariableDeclaration &&
|
|
129
|
-
node.name.getText() ===
|
|
132
|
+
node.name.getText() === DEFAULT_ROUTES_VARIABLE;
|
|
130
133
|
// no type currently
|
|
131
134
|
//(node as ts.VariableDeclaration).type.getText() === "Route[]";
|
|
132
135
|
};
|
|
@@ -145,20 +148,19 @@ class ReactTypeScriptFileUpdate {
|
|
|
145
148
|
}).transformed[0];
|
|
146
149
|
this.finalize();
|
|
147
150
|
}
|
|
148
|
-
requestImport(modulePath, routerAlias, componentName) {
|
|
151
|
+
requestImport(modulePath, routerAlias, componentName, namedImport = false) {
|
|
149
152
|
const existing = this.requestedImports.find(x => x.from === modulePath);
|
|
153
|
+
// TODO: better check for named imports. There could be several named imports from same modulePath
|
|
150
154
|
if (!existing) {
|
|
151
155
|
// new imports, check if already exists in file
|
|
152
156
|
this.requestedImports.push({
|
|
153
157
|
as: routerAlias,
|
|
154
158
|
from: modulePath,
|
|
155
159
|
component: componentName,
|
|
156
|
-
edit: this.importsMeta.modulePaths.indexOf(modulePath) !== -1
|
|
160
|
+
edit: this.importsMeta.modulePaths.indexOf(modulePath) !== -1,
|
|
161
|
+
namedImport
|
|
157
162
|
});
|
|
158
163
|
}
|
|
159
|
-
else {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
164
|
}
|
|
163
165
|
/** Add `import` statements not previously found in the file */
|
|
164
166
|
addNewFileImports() {
|
|
@@ -168,13 +170,13 @@ class ReactTypeScriptFileUpdate {
|
|
|
168
170
|
}
|
|
169
171
|
const newStatements = ts.factory.createNodeArray([
|
|
170
172
|
...this.targetSource.statements.slice(0, this.importsMeta.lastIndex),
|
|
171
|
-
...newImports.map(x => this.createIdentifierImport(x.from, x.as, x.component)),
|
|
173
|
+
...newImports.map(x => this.createIdentifierImport(x.from, x.as, x.component, x.namedImport)),
|
|
172
174
|
...this.targetSource.statements.slice(this.importsMeta.lastIndex)
|
|
173
175
|
]);
|
|
174
176
|
newImports.forEach(x => this.createdStringLiterals.push(x.from));
|
|
175
177
|
this.targetSource = ts.factory.updateSourceFile(this.targetSource, newStatements);
|
|
176
178
|
}
|
|
177
|
-
createIdentifierImport(importPath, as, component) {
|
|
179
|
+
createIdentifierImport(importPath, as, component, namedImport) {
|
|
178
180
|
let exportedObject;
|
|
179
181
|
let exportedObjectName;
|
|
180
182
|
let importClause;
|
|
@@ -186,7 +188,14 @@ class ReactTypeScriptFileUpdate {
|
|
|
186
188
|
]));
|
|
187
189
|
}
|
|
188
190
|
else {
|
|
189
|
-
|
|
191
|
+
if (namedImport) {
|
|
192
|
+
const importSpecifier = ts.factory.createImportSpecifier(false, undefined, ts.factory.createIdentifier(component));
|
|
193
|
+
const imports = ts.factory.createNamedImports([importSpecifier]);
|
|
194
|
+
importClause = ts.factory.createImportClause(false, undefined, imports);
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
importClause = ts.factory.createImportClause(false, ts.factory.createIdentifier(component), undefined);
|
|
198
|
+
}
|
|
190
199
|
}
|
|
191
200
|
const importDeclaration = ts.factory.createImportDeclaration(undefined, undefined, importClause, ts.factory.createStringLiteral(importPath, true));
|
|
192
201
|
return importDeclaration;
|
|
@@ -316,7 +325,14 @@ class ReactTypeScriptFileUpdate {
|
|
|
316
325
|
return node;
|
|
317
326
|
};
|
|
318
327
|
}
|
|
319
|
-
createRouteEntry(path, component, name, routerAlias) {
|
|
328
|
+
createRouteEntry(path, component, name, routerAlias, defaultRoute = false) {
|
|
329
|
+
if (defaultRoute) {
|
|
330
|
+
// for default route in React we should generate index: true, loader: () => redirect(path)
|
|
331
|
+
const index = ts.factory.createPropertyAssignment("index", ts.factory.createTrue());
|
|
332
|
+
const loader = ts.factory.createArrowFunction(undefined, undefined, [], undefined, undefined, ts.factory.createCallExpression(ts.factory.createIdentifier("redirect"), [], [ts.factory.createStringLiteral(path, true)]));
|
|
333
|
+
const redirect = ts.factory.createPropertyAssignment("loader", loader);
|
|
334
|
+
return ts.factory.createObjectLiteralExpression([index, redirect]);
|
|
335
|
+
}
|
|
320
336
|
const routePath = ts.factory.createPropertyAssignment("path", ts.factory.createStringLiteral(path, true));
|
|
321
337
|
const jsxElement = ts.factory.createJsxSelfClosingElement(ts.factory.createIdentifier(component), [], undefined);
|
|
322
338
|
const routeComponent = ts.factory.createPropertyAssignment("element", jsxElement);
|
|
@@ -325,9 +341,7 @@ class ReactTypeScriptFileUpdate {
|
|
|
325
341
|
const childrenData = ts.factory.createPropertyAssignment("children", ts.factory.createIdentifier(routerAlias));
|
|
326
342
|
return ts.factory.createObjectLiteralExpression([routePath, routeComponent, routeData, childrenData]);
|
|
327
343
|
}
|
|
328
|
-
|
|
329
|
-
return ts.factory.createObjectLiteralExpression([routePath, routeComponent, routeData]);
|
|
330
|
-
}
|
|
344
|
+
return ts.factory.createObjectLiteralExpression([routePath, routeComponent, routeData]);
|
|
331
345
|
}
|
|
332
346
|
}
|
|
333
347
|
exports.ReactTypeScriptFileUpdate = ReactTypeScriptFileUpdate;
|
package/templates/react/igr-ts/bullet-graph/default/files/src/app/__path__/__filePrefix__.test.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { expect, test } from 'vitest';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
|
-
import $(ClassName) from '
|
|
3
|
+
import $(ClassName) from './$(path)';
|
|
4
4
|
|
|
5
5
|
test('renders $(ClassName) component', () => {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const wrapper = render(<$(ClassName) />);
|
|
7
|
+
expect(wrapper).toBeTruthy();
|
|
8
8
|
});
|
package/templates/react/igr-ts/bullet-graph/default/files/src/app/__path__/__filePrefix__.tsx
CHANGED
|
@@ -6,51 +6,51 @@ IgrBulletGraphModule.register();
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
export default function $(ClassName)() {
|
|
9
|
-
|
|
9
|
+
const title = 'Bullet Graph';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
11
|
+
return (
|
|
12
|
+
<div>
|
|
13
|
+
<h1 className={style.title}>{title}</h1>
|
|
14
|
+
<div>
|
|
15
|
+
Read more on the
|
|
16
|
+
<a href="https://www.infragistics.com/products/ignite-ui-react/react/components/bulletgraph.html">
|
|
17
|
+
official documentation page
|
|
18
|
+
</a>
|
|
19
|
+
</div>
|
|
20
|
+
<div className={style.container}>
|
|
21
|
+
<div className={style.graph}>
|
|
22
|
+
<IgrBulletGraph
|
|
23
|
+
height="80px" width="400px"
|
|
24
|
+
minimumValue={0} value={70} interval={10}
|
|
25
|
+
maximumValue={100} targetValue={90}
|
|
26
|
+
isScaleInverted={false}
|
|
27
|
+
scaleBackgroundBrush="DodgerBlue"
|
|
28
|
+
scaleBackgroundOutline="DarkViolet"
|
|
29
|
+
scaleBackgroundThickness={2}
|
|
30
|
+
scaleStartExtent={0.05}
|
|
31
|
+
scaleEndExtent={0.95}>
|
|
32
|
+
</IgrBulletGraph>
|
|
33
|
+
</div>
|
|
34
|
+
<div className={style.graph}>
|
|
35
|
+
<IgrBulletGraph
|
|
36
|
+
value={50}
|
|
37
|
+
valueBrush="DodgerBlue"
|
|
38
|
+
valueStrokeThickness={1}
|
|
39
|
+
valueInnerExtent={0.5}
|
|
40
|
+
valueOuterExtent={0.65}
|
|
41
|
+
targetValue={80}
|
|
42
|
+
targetValueBreadth={10}
|
|
43
|
+
targetValueBrush="LimeGreen"
|
|
44
|
+
targetValueOutline="LimeGreen"
|
|
45
|
+
targetValueStrokeThickness={1}
|
|
46
|
+
targetValueInnerExtent={0.3}
|
|
47
|
+
targetValueOuterExtent={0.85}
|
|
48
|
+
height="80px" width="400px"
|
|
49
|
+
minimumValue={0}
|
|
50
|
+
maximumValue={100}>
|
|
51
|
+
</IgrBulletGraph>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
)
|
|
56
56
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
:local(.container) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
padding-top: 24px;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-flow: row;
|
|
5
|
+
justify-content: space-around;
|
|
6
6
|
}
|
|
7
7
|
:local(.title) {
|
|
8
|
-
|
|
8
|
+
color: rgb(0, 153, 255);
|
|
9
9
|
}
|
|
10
10
|
:local(.graph) {
|
|
11
|
-
|
|
11
|
+
width: 50%;
|
|
12
12
|
}
|
package/templates/react/igr-ts/category-chart/default/files/src/app/__path__/__filePrefix__.test.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { expect, test } from 'vitest';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
|
-
import $(ClassName) from '
|
|
3
|
+
import $(ClassName) from './$(path)';
|
|
4
4
|
|
|
5
5
|
test('renders $(ClassName) component', () => {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const wrapper = render(<$(ClassName) />);
|
|
7
|
+
expect(wrapper).toBeTruthy();
|
|
8
8
|
});
|
package/templates/react/igr-ts/category-chart/default/files/src/app/__path__/__filePrefix__.tsx
CHANGED
|
@@ -6,36 +6,36 @@ import style from './style.module.css';
|
|
|
6
6
|
IgrCategoryChartModule.register();
|
|
7
7
|
|
|
8
8
|
const data = [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
{ 'CountryName': 'China', 'Pop1995': 1216, 'Pop2005': 1297, 'Pop2015': 1361, 'Pop2025': 1394 },
|
|
10
|
+
{ 'CountryName': 'India', 'Pop1995': 920, 'Pop2005': 1090, 'Pop2015': 1251, 'Pop2025': 1396 },
|
|
11
|
+
{ 'CountryName': 'United States', 'Pop1995': 266, 'Pop2005': 295, 'Pop2015': 322, 'Pop2025': 351 },
|
|
12
|
+
{ 'CountryName': 'Indonesia', 'Pop1995': 197, 'Pop2005': 229, 'Pop2015': 256, 'Pop2025': 277 },
|
|
13
|
+
{ 'CountryName': 'Brazil', 'Pop1995': 161, 'Pop2005': 186, 'Pop2015': 204, 'Pop2025': 218 }
|
|
14
14
|
];
|
|
15
15
|
|
|
16
16
|
export default function $(ClassName)() {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const title = 'Category Chart';
|
|
18
|
+
const [chartData, setChartData] = useState([]);
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
setChartData(data);
|
|
22
|
+
}, []);
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
24
|
+
return (
|
|
25
|
+
<div>
|
|
26
|
+
<h1 className={style.title}>{title}</h1>
|
|
27
|
+
<div>
|
|
28
|
+
Read more on the
|
|
29
|
+
<a href="https://www.infragistics.com/products/ignite-ui-react/react/components/categorychart.html">
|
|
30
|
+
official documentation page
|
|
31
|
+
</a>
|
|
32
|
+
</div>
|
|
33
|
+
<div className={style.container}>
|
|
34
|
+
<IgrCategoryChart dataSource={chartData}
|
|
35
|
+
width="100%"
|
|
36
|
+
height="500px">
|
|
37
|
+
</IgrCategoryChart>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
)
|
|
41
41
|
}
|
package/templates/react/igr-ts/category-chart/default/files/src/app/__path__/style.module.css
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
:local(.container) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
padding-top: 24px;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-flow: row;
|
|
5
|
+
justify-content: center;
|
|
6
6
|
}
|
|
7
7
|
:local(.title) {
|
|
8
|
-
|
|
8
|
+
color: rgb(0, 153, 255);
|
|
9
9
|
}
|
|
@@ -10,7 +10,7 @@ class IgrTsCategoryChartComponent extends cli_core_1.BaseComponent {
|
|
|
10
10
|
this.name = "Category Chart";
|
|
11
11
|
this.group = "Charts";
|
|
12
12
|
this.description = `makes visualizing category data easy. Simplifies the complexities
|
|
13
|
-
|
|
13
|
+
of the data visualization domain into manageable API`;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
module.exports = new IgrTsCategoryChartComponent();
|
package/templates/react/igr-ts/doughnut-chart/default/files/src/app/__path__/__filePrefix__.test.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { expect, test } from 'vitest';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
|
-
import $(ClassName) from '
|
|
3
|
+
import $(ClassName) from './$(path)';
|
|
4
4
|
|
|
5
5
|
test('renders $(ClassName) component', () => {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const wrapper = render(<$(ClassName) />);
|
|
7
|
+
expect(wrapper).toBeTruthy();
|
|
8
8
|
});
|
package/templates/react/igr-ts/doughnut-chart/default/files/src/app/__path__/__filePrefix__.tsx
CHANGED
|
@@ -14,50 +14,50 @@ IgrRingSeriesModule.register();
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
const data = [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
{ MarketShare: 30, Company: "Google", },
|
|
18
|
+
{ MarketShare: 15, Company: "Microsoft", },
|
|
19
|
+
{ MarketShare: 30, Company: "Apple", },
|
|
20
|
+
{ MarketShare: 15, Company: "Samsung", },
|
|
21
|
+
{ MarketShare: 10, Company: "Other", }
|
|
22
22
|
];
|
|
23
23
|
|
|
24
24
|
export default function $(ClassName)() {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const title = 'Doughnut Chart';
|
|
26
|
+
const [chartData, setChartData] = useState([]);
|
|
27
|
+
const legendRef = useRef();
|
|
28
|
+
const chartRef = useRef();
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setChartData(data);
|
|
32
|
+
}, []);
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
34
|
+
return (
|
|
35
|
+
<div>
|
|
36
|
+
<h1 className={style.title}>{title}</h1>
|
|
37
|
+
<div>
|
|
38
|
+
Read more on the
|
|
39
|
+
<a href="https://www.infragistics.com/products/ignite-ui-react/react/components/doughnutchart.html">
|
|
40
|
+
official documentation page
|
|
41
|
+
</a>
|
|
42
|
+
</div>
|
|
43
|
+
<div className={style.container}>
|
|
44
|
+
<div className={style.legend}>
|
|
45
|
+
<IgrItemLegend ref={legendRef} />
|
|
46
|
+
</div>
|
|
47
|
+
<div className={style.chart}>
|
|
48
|
+
<IgrDoughnutChart ref={chartRef}
|
|
49
|
+
width="300px"
|
|
50
|
+
height="300px">
|
|
51
|
+
<IgrRingSeries
|
|
52
|
+
name="ring1"
|
|
53
|
+
dataSource={chartData}
|
|
54
|
+
labelMemberPath="Company"
|
|
55
|
+
valueMemberPath="MarketShare"
|
|
56
|
+
legend={legendRef.current}
|
|
57
|
+
/>
|
|
58
|
+
</IgrDoughnutChart>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
)
|
|
63
63
|
}
|
package/templates/react/igr-ts/doughnut-chart/default/files/src/app/__path__/style.module.css
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
:local(.container) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-flow: row;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
padding-top: 24px;
|
|
6
6
|
}
|
|
7
7
|
:local(.title) {
|
|
8
|
-
|
|
8
|
+
color: rgb(0, 153, 255);
|
|
9
9
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { expect, test } from 'vitest';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
|
-
import $(ClassName) from '
|
|
3
|
+
import $(ClassName) from './$(path)';
|
|
4
4
|
|
|
5
5
|
test('renders $(ClassName) component', () => {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const wrapper = render(<$(ClassName) />);
|
|
7
|
+
expect(wrapper).toBeTruthy();
|
|
8
8
|
});
|