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/templates/react/igr-ts/financial-chart/default/files/src/app/__path__/__filePrefix__.tsx
CHANGED
|
@@ -6,44 +6,44 @@ import style from './style.module.css';
|
|
|
6
6
|
IgrFinancialChartModule.register();
|
|
7
7
|
|
|
8
8
|
const data = [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
{ time: new Date(2013, 1, 1), open: 268.93, high: 268.93, low: 262.80, close: 265.00, volume: 6118146 },
|
|
10
|
+
{ time: new Date(2013, 1, 4), open: 262.78, high: 264.68, low: 259.07, close: 259.98, volume: 3723793 },
|
|
11
|
+
{ time: new Date(2013, 1, 5), open: 262.00, high: 268.03, low: 261.46, close: 266.89, volume: 4013780 },
|
|
12
|
+
{ time: new Date(2013, 1, 6), open: 265.16, high: 266.89, low: 261.11, close: 262.22, volume: 2772204 },
|
|
13
|
+
{ time: new Date(2013, 1, 7), open: 264.10, high: 264.10, low: 255.11, close: 260.23, volume: 3977065 },
|
|
14
|
+
{ time: new Date(2013, 1, 8), open: 261.40, high: 265.25, low: 260.56, close: 261.95, volume: 3879628 },
|
|
15
|
+
{ time: new Date(2013, 1, 11), open: 263.20, high: 263.25, low: 256.60, close: 257.21, volume: 3407457 },
|
|
16
|
+
{ time: new Date(2013, 1, 12), open: 259.19, high: 260.16, low: 257.00, close: 258.70, volume: 2944730 },
|
|
17
|
+
{ time: new Date(2013, 1, 13), open: 261.53, high: 269.96, low: 260.30, close: 269.47, volume: 5295786 },
|
|
18
|
+
{ time: new Date(2013, 1, 14), open: 267.37, high: 270.65, low: 265.40, close: 269.24, volume: 3464080 },
|
|
19
|
+
{ time: new Date(2013, 1, 15), open: 267.63, high: 268.92, low: 263.11, close: 265.09, volume: 3981233 }
|
|
20
20
|
];
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
export default function $(ClassName)() {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
const title = 'Financial Chart';
|
|
25
|
+
const [chartData, setChartData] = useState([]);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
setChartData(data);
|
|
29
|
+
}, []);
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
31
|
+
return (
|
|
32
|
+
<div>
|
|
33
|
+
<h1 className={style.title}>{title}</h1>
|
|
34
|
+
<div>
|
|
35
|
+
Read more on the
|
|
36
|
+
<a href="https://www.infragistics.com/products/ignite-ui-react/react/components/financialchart.html">
|
|
37
|
+
official documentation page
|
|
38
|
+
</a>
|
|
39
|
+
</div>
|
|
40
|
+
<div className={style.container}>
|
|
41
|
+
<IgrFinancialChart
|
|
42
|
+
width="700px"
|
|
43
|
+
height="500px"
|
|
44
|
+
dataSource={chartData}>
|
|
45
|
+
</IgrFinancialChart>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
)
|
|
49
49
|
}
|
package/templates/react/igr-ts/financial-chart/default/files/src/app/__path__/style.module.css
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
:local(.container) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
padding-top: 24px;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-flow: row;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
text-align: left;
|
|
7
7
|
}
|
|
8
|
+
|
|
8
9
|
:local(.title) {
|
|
9
|
-
|
|
10
|
+
color: rgb(0, 153, 255);
|
|
10
11
|
}
|
|
@@ -10,7 +10,7 @@ class IgrTsFinancialChartComponent extends cli_core_1.BaseComponent {
|
|
|
10
10
|
this.name = "Financial Chart";
|
|
11
11
|
this.group = "Charts";
|
|
12
12
|
this.description = `charting component that makes it easy to visualize financial data by
|
|
13
|
-
|
|
13
|
+
using a simple and intuitive API.`;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
module.exports = new IgrTsFinancialChartComponent();
|
|
@@ -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
|
});
|
|
@@ -8,51 +8,51 @@ import data from './data';
|
|
|
8
8
|
IgrGridModule.register();
|
|
9
9
|
|
|
10
10
|
export default function $(ClassName)() {
|
|
11
|
-
|
|
11
|
+
const title = 'Grid';
|
|
12
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
|
-
</div>
|
|
52
|
-
<div className={style.grid}>
|
|
53
|
-
<IgrGrid autoGenerate="true" data={data} />
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
13
|
+
return (
|
|
14
|
+
<div>
|
|
15
|
+
<h1 className={style.title}>{title}</h1>
|
|
16
|
+
<div>
|
|
17
|
+
Read more on the
|
|
18
|
+
<a href="https://www.infragistics.com/products/ignite-ui-react/react/components/grid.html">
|
|
19
|
+
official documentation page
|
|
20
|
+
</a>
|
|
21
|
+
</div>
|
|
22
|
+
<div className={style.container}>
|
|
23
|
+
<div className={style.grid}>
|
|
24
|
+
<IgrGrid autoGenerate="false" data={data}>
|
|
25
|
+
<IgrColumn
|
|
26
|
+
field="ProductID"
|
|
27
|
+
header="Product ID"
|
|
28
|
+
dataType="Number">
|
|
29
|
+
</IgrColumn>
|
|
30
|
+
<IgrColumn
|
|
31
|
+
field="ProductName"
|
|
32
|
+
header="Product Name"
|
|
33
|
+
dataType="String">
|
|
34
|
+
</IgrColumn>
|
|
35
|
+
<IgrColumn
|
|
36
|
+
field="QuantityPerUnit"
|
|
37
|
+
header="Quantity Per Unit"
|
|
38
|
+
dataType="String">
|
|
39
|
+
</IgrColumn>
|
|
40
|
+
<IgrColumn
|
|
41
|
+
field="UnitsInStock"
|
|
42
|
+
header="Units In Stock"
|
|
43
|
+
dataType="Number">
|
|
44
|
+
</IgrColumn>
|
|
45
|
+
<IgrColumn
|
|
46
|
+
field="OrderDate"
|
|
47
|
+
header="Order Date"
|
|
48
|
+
dataType="Date">
|
|
49
|
+
</IgrColumn>
|
|
50
|
+
</IgrGrid>
|
|
56
51
|
</div>
|
|
57
|
-
|
|
52
|
+
<div className={style.grid}>
|
|
53
|
+
<IgrGrid autoGenerate="true" data={data} />
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
58
|
}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
export default [{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
Discontinued: false,
|
|
3
|
+
OrderDate: new Date('2012-02-12'),
|
|
4
|
+
ProductID: 1,
|
|
5
|
+
ProductName: 'Chai',
|
|
6
|
+
QuantityPerUnit: '10 boxes x 20 bags',
|
|
7
|
+
ReorderLevel: 10,
|
|
8
|
+
UnitPrice: 18.0000,
|
|
9
|
+
UnitsInStock: 39
|
|
10
10
|
}, {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
Discontinued: false,
|
|
12
|
+
OrderDate: new Date('2003-03-17'),
|
|
13
|
+
ProductID: 2,
|
|
14
|
+
ProductName: 'Chang',
|
|
15
|
+
QuantityPerUnit: '24 - 12 oz bottles',
|
|
16
|
+
ReorderLevel: 25,
|
|
17
|
+
UnitPrice: 19.0000,
|
|
18
|
+
UnitsInStock: 17
|
|
19
19
|
}, {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
Discontinued: false,
|
|
21
|
+
OrderDate: new Date('2006-03-17'),
|
|
22
|
+
ProductID: 3,
|
|
23
|
+
ProductName: 'Aniseed Syrup',
|
|
24
|
+
QuantityPerUnit: '12 - 550 ml bottles',
|
|
25
|
+
ReorderLevel: 25,
|
|
26
|
+
UnitPrice: 10.0000,
|
|
27
|
+
UnitsInStock: 13
|
|
28
28
|
}, {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
Discontinued: false,
|
|
30
|
+
OrderDate: new Date('2016-03-17'),
|
|
31
|
+
ProductID: 4,
|
|
32
|
+
ProductName: 'Chef Antons Cajun Seasoning',
|
|
33
|
+
QuantityPerUnit: '48 - 6 oz jars',
|
|
34
|
+
ReorderLevel: 0,
|
|
35
|
+
UnitPrice: 22.0000,
|
|
36
|
+
UnitsInStock: 53
|
|
37
37
|
}, {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
Discontinued: true,
|
|
39
|
+
OrderDate: new Date('2011-11-11'),
|
|
40
|
+
ProductID: 5,
|
|
41
|
+
ProductName: 'Chef Antons Gumbo Mix',
|
|
42
|
+
QuantityPerUnit: '36 boxes',
|
|
43
|
+
ReorderLevel: 0,
|
|
44
|
+
UnitPrice: 21.3500,
|
|
45
|
+
UnitsInStock: 0
|
|
46
46
|
}];
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
:local(.container) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
padding-top: 24px;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-flow: column;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
:local(.title) {
|
|
10
|
-
|
|
10
|
+
color: rgb(0, 153, 255);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
:local(.grid) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
width: 80%;
|
|
15
|
+
margin-bottom: 24px;
|
|
16
|
+
border: 1px solid rgb(0, 153, 255);
|
|
17
17
|
}
|
package/templates/react/igr-ts/linear-gauge/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/linear-gauge/default/files/src/app/__path__/__filePrefix__.tsx
CHANGED
|
@@ -5,55 +5,56 @@ import { IgrLinearGauge } from 'igniteui-react-gauges';
|
|
|
5
5
|
IgrLinearGaugeModule.register();
|
|
6
6
|
|
|
7
7
|
export default function $(ClassName)() {
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
8
|
+
const title = 'Linear Gauge';
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<div>
|
|
12
|
+
<h1 className={style.title}>{title}</h1>
|
|
13
|
+
<div>
|
|
14
|
+
Read more on the
|
|
15
|
+
<a href="https://www.infragistics.com/products/ignite-ui-react/react/components/lineargauge.html">
|
|
16
|
+
official documentation page
|
|
17
|
+
</a>
|
|
18
|
+
</div>
|
|
19
|
+
<div className={style.container}>
|
|
20
|
+
<div className={style.gauge}>
|
|
21
|
+
<IgrLinearGauge
|
|
22
|
+
height="80px" width="400px"
|
|
23
|
+
minimumValue={0}
|
|
24
|
+
maximumValue={100} interval={10}
|
|
25
|
+
value={50}
|
|
26
|
+
isNeedleDraggingEnabled={true}
|
|
27
|
+
needleShape="Custom"
|
|
28
|
+
needleBrush="DodgerBlue"
|
|
29
|
+
needleOutline="DodgerBlue"
|
|
30
|
+
needleStrokeThickness={1}
|
|
31
|
+
needleBreadth={15}
|
|
32
|
+
needleInnerExtent={0.35}
|
|
33
|
+
needleOuterExtent={0.65}
|
|
34
|
+
needleOuterPointExtent={0.8}
|
|
35
|
+
needleInnerPointExtent={0.325}
|
|
36
|
+
needleInnerPointWidth={0}
|
|
37
|
+
needleOuterPointWidth={0.3}
|
|
38
|
+
needleInnerBaseWidth={0}
|
|
39
|
+
needleOuterBaseWidth={0.07}>
|
|
40
|
+
</IgrLinearGauge>
|
|
41
|
+
</div>
|
|
42
|
+
<div className={style.gauge}>
|
|
43
|
+
<IgrLinearGauge
|
|
44
|
+
height="80px" width="400px"
|
|
45
|
+
minimumValue={0} value={50}
|
|
46
|
+
maximumValue={100} interval={10}
|
|
47
|
+
isScaleInverted={false}
|
|
48
|
+
scaleBrush="DodgerBlue"
|
|
49
|
+
scaleOutline="DarkViolet"
|
|
50
|
+
scaleStrokeThickness={1}
|
|
51
|
+
scaleInnerExtent={0.05}
|
|
52
|
+
scaleOuterExtent={0.65}
|
|
53
|
+
scaleStartExtent={0.05}
|
|
54
|
+
scaleEndExtent={0.95}>
|
|
55
|
+
</IgrLinearGauge>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
)
|
|
59
60
|
}
|
|
@@ -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(.gauge) {
|
|
11
|
-
|
|
11
|
+
width: 50%;
|
|
12
12
|
}
|
package/templates/react/igr-ts/pie-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
|
});
|
|
@@ -9,49 +9,48 @@ IgrPieChartModule.register();
|
|
|
9
9
|
IgrItemLegendModule.register();
|
|
10
10
|
|
|
11
11
|
const data = [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
{ MarketShare: 30, Company: "Google", },
|
|
13
|
+
{ MarketShare: 15, Company: "Microsoft", },
|
|
14
|
+
{ MarketShare: 30, Company: "Apple", },
|
|
15
|
+
{ MarketShare: 15, Company: "Samsung", },
|
|
16
|
+
{ MarketShare: 10, Company: "Other", },
|
|
17
17
|
];
|
|
18
18
|
|
|
19
19
|
export default function $(ClassName)() {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const title = 'Pie Chart';
|
|
21
|
+
const [chartData, setChartData] = useState([]);
|
|
22
|
+
let legendRef = useRef();
|
|
23
|
+
let chartRef = useRef();
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
setChartData(data);
|
|
27
|
+
}, []);
|
|
28
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
|
-
|
|
56
|
-
)
|
|
29
|
+
return (
|
|
30
|
+
<div>
|
|
31
|
+
<h1 className={style.title}>{title}</h1>
|
|
32
|
+
<div>
|
|
33
|
+
Read more on the
|
|
34
|
+
<a href="https://www.infragistics.com/products/ignite-ui-react/react/components/piechart.html">
|
|
35
|
+
official documentation page
|
|
36
|
+
</a>
|
|
37
|
+
</div>
|
|
38
|
+
<div className={style.container}>
|
|
39
|
+
<div className={style.legend}>
|
|
40
|
+
<IgrItemLegend ref={legendRef} />
|
|
41
|
+
</div>
|
|
42
|
+
<div className={style.chart}>
|
|
43
|
+
<IgrPieChart dataSource={chartData}
|
|
44
|
+
labelMemberPath="Company"
|
|
45
|
+
valueMemberPath="MarketShare"
|
|
46
|
+
width="500px"
|
|
47
|
+
height="500px"
|
|
48
|
+
ref={chartRef}
|
|
49
|
+
legendLabelMemberPath="Label"
|
|
50
|
+
legend={legendRef.current}
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
)
|
|
57
56
|
}
|
|
@@ -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
|
}
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@testing-library/jest-dom": "^6.1.3",
|
|
8
8
|
"@testing-library/react": "^14.0.0",
|
|
9
|
+
"element-internals-polyfill": "^1.3.10",
|
|
9
10
|
"functions-have-names": "^1.2.3",
|
|
11
|
+
"igniteui-dockmanager": "^1.13.0",
|
|
10
12
|
"igniteui-react": "18.3.0",
|
|
11
13
|
"igniteui-react-core": "18.3.0",
|
|
12
14
|
"react": "^18.2.0",
|
|
@@ -14,8 +16,7 @@
|
|
|
14
16
|
"react-dom": "^18.2.0",
|
|
15
17
|
"react-router-dom": "^6.16.0",
|
|
16
18
|
"resize-observer-polyfill": "^1.5.1",
|
|
17
|
-
"vitest": "^0.34.4"
|
|
18
|
-
"igniteui-dockmanager": "^1.13.0"
|
|
19
|
+
"vitest": "^0.34.4"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
22
|
"@types/react": "^18.2.15",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Creates a class transformer function that maps matches from a module object
|
|
3
3
|
* @param styles Object map of classes and their scoped name, normally from a CSS Module import
|
|
4
4
|
*/
|
|
5
|
-
export default function createClassTransformer(styles:
|
|
5
|
+
export default function createClassTransformer(styles: CSSModuleClasses) {
|
|
6
6
|
return (classes: string) => {
|
|
7
7
|
return classes
|
|
8
8
|
.split(' ')
|