igniteui-cli 12.0.5 → 12.0.6-alpha.1
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/templates/IgniteUIForReactTemplate.js +0 -1
- package/package.json +3 -3
- package/templates/react/igr-ts/bullet-graph/default/files/src/views/__path__/index.test.tsx +8 -0
- package/templates/react/igr-ts/bullet-graph/default/files/src/views/__path__/index.tsx +57 -0
- package/templates/react/igr-ts/bullet-graph/default/files/src/views/__path__/style.module.css +12 -0
- package/templates/react/igr-ts/bullet-graph/default/index.d.ts +1 -0
- package/templates/react/igr-ts/bullet-graph/default/index.js +17 -0
- package/templates/react/igr-ts/bullet-graph/index.d.ts +1 -0
- package/templates/react/igr-ts/bullet-graph/index.js +15 -0
- package/templates/react/igr-ts/category-chart/default/files/src/views/__path__/index.test.tsx +8 -0
- package/templates/react/igr-ts/category-chart/default/files/src/views/__path__/index.tsx +41 -0
- package/templates/react/igr-ts/category-chart/default/files/src/views/__path__/style.module.css +9 -0
- package/templates/react/igr-ts/category-chart/default/index.d.ts +1 -0
- package/templates/react/igr-ts/category-chart/default/index.js +18 -0
- package/templates/react/igr-ts/category-chart/index.d.ts +1 -0
- package/templates/react/igr-ts/category-chart/index.js +16 -0
- package/templates/react/igr-ts/doughnut-chart/default/files/src/views/__path__/index.test.tsx +8 -0
- package/templates/react/igr-ts/doughnut-chart/default/files/src/views/__path__/index.tsx +63 -0
- package/templates/react/igr-ts/doughnut-chart/default/files/src/views/__path__/style.module.css +9 -0
- package/templates/react/igr-ts/doughnut-chart/default/index.d.ts +1 -0
- package/templates/react/igr-ts/doughnut-chart/default/index.js +17 -0
- package/templates/react/igr-ts/doughnut-chart/index.d.ts +1 -0
- package/templates/react/igr-ts/doughnut-chart/index.js +15 -0
- package/templates/react/igr-ts/financial-chart/default/files/src/views/__path__/index.test.tsx +8 -0
- package/templates/react/igr-ts/financial-chart/default/files/src/views/__path__/index.tsx +49 -0
- package/templates/react/igr-ts/financial-chart/default/files/src/views/__path__/style.module.css +10 -0
- package/templates/react/igr-ts/financial-chart/default/index.d.ts +1 -0
- package/templates/react/igr-ts/financial-chart/default/index.js +19 -0
- package/templates/react/igr-ts/financial-chart/index.d.ts +1 -0
- package/templates/react/igr-ts/financial-chart/index.js +16 -0
- package/templates/react/igr-ts/grid/basic/files/src/views/__path__/data.tsx +46 -0
- package/templates/react/igr-ts/grid/basic/files/src/views/__path__/index.test.tsx +8 -0
- package/templates/react/igr-ts/grid/basic/files/src/views/__path__/index.tsx +48 -0
- package/templates/react/igr-ts/grid/basic/files/src/views/__path__/style.module.css +17 -0
- package/templates/react/igr-ts/grid/basic/index.d.ts +1 -0
- package/templates/react/igr-ts/grid/basic/index.js +23 -0
- package/templates/react/igr-ts/grid/index.d.ts +1 -0
- package/templates/react/igr-ts/grid/index.js +15 -0
- package/templates/react/igr-ts/groups.json +5 -0
- package/templates/react/igr-ts/index.d.ts +1 -0
- package/templates/react/igr-ts/index.js +17 -0
- package/templates/react/igr-ts/linear-gauge/default/files/src/views/__path__/index.test.tsx +8 -0
- package/templates/react/igr-ts/linear-gauge/default/files/src/views/__path__/index.tsx +60 -0
- package/templates/react/igr-ts/linear-gauge/default/files/src/views/__path__/style.module.css +12 -0
- package/templates/react/igr-ts/linear-gauge/default/index.d.ts +1 -0
- package/templates/react/igr-ts/linear-gauge/default/index.js +17 -0
- package/templates/react/igr-ts/linear-gauge/index.d.ts +1 -0
- package/templates/react/igr-ts/linear-gauge/index.js +15 -0
- package/templates/react/igr-ts/pie-chart/default/files/src/views/__path__/index.test.tsx +8 -0
- package/templates/react/igr-ts/pie-chart/default/files/src/views/__path__/index.tsx +57 -0
- package/templates/react/igr-ts/pie-chart/default/files/src/views/__path__/style.module.css +9 -0
- package/templates/react/igr-ts/pie-chart/default/index.d.ts +1 -0
- package/templates/react/igr-ts/pie-chart/default/index.js +17 -0
- package/templates/react/igr-ts/pie-chart/index.d.ts +1 -0
- package/templates/react/igr-ts/pie-chart/index.js +15 -0
- package/templates/react/igr-ts/projects/_base/files/README.md +48 -0
- package/templates/react/igr-ts/projects/_base/files/__dot__editorconfig +3 -0
- package/templates/react/igr-ts/projects/_base/files/__dot__env +1 -0
- package/templates/react/igr-ts/projects/_base/files/__dot__eslintrc.cjs +18 -0
- package/templates/react/igr-ts/projects/_base/files/__dot__gitignore +23 -0
- package/templates/react/igr-ts/projects/_base/files/ignite-ui-cli.json +16 -0
- package/templates/react/igr-ts/projects/_base/files/index.html +33 -0
- package/templates/react/igr-ts/projects/_base/files/package.json +50 -0
- package/templates/react/igr-ts/projects/_base/files/public/favicon.ico +0 -0
- package/templates/react/igr-ts/projects/_base/files/public/manifest.json +15 -0
- package/templates/react/igr-ts/projects/_base/files/src/App.test.tsx +8 -0
- package/templates/react/igr-ts/projects/_base/files/src/App.tsx +11 -0
- package/templates/react/igr-ts/projects/_base/files/src/hoc/asyncComponent.tsx +50 -0
- package/templates/react/igr-ts/projects/_base/files/src/index.css +14 -0
- package/templates/react/igr-ts/projects/_base/files/src/main.tsx +23 -0
- package/templates/react/igr-ts/projects/_base/files/src/routes.json +3 -0
- package/templates/react/igr-ts/projects/_base/files/src/serviceWorker.tsx +135 -0
- package/templates/react/igr-ts/projects/_base/files/src/setupTests.ts +5 -0
- package/templates/react/igr-ts/projects/_base/files/src/vite-env.d.ts +1 -0
- package/templates/react/igr-ts/projects/_base/files/tsconfig.json +25 -0
- package/templates/react/igr-ts/projects/_base/files/tsconfig.node.json +10 -0
- package/templates/react/igr-ts/projects/_base/files/vite.config.ts +20 -0
- package/templates/react/igr-ts/projects/_base/index.d.ts +29 -0
- package/templates/react/igr-ts/projects/_base/index.js +58 -0
- package/templates/react/igr-ts/projects/_base_with_home/files/public/logo.svg +7 -0
- package/templates/react/igr-ts/projects/_base_with_home/files/src/App.module.css +36 -0
- package/templates/react/igr-ts/projects/_base_with_home/files/src/App.test.tsx +8 -0
- package/templates/react/igr-ts/projects/_base_with_home/files/src/App.tsx +26 -0
- package/templates/react/igr-ts/projects/_base_with_home/files/src/setupTests.ts +5 -0
- package/templates/react/igr-ts/projects/_base_with_home/index.d.ts +14 -0
- package/templates/react/igr-ts/projects/_base_with_home/index.js +22 -0
- package/templates/react/igr-ts/projects/base/index.d.ts +14 -0
- package/templates/react/igr-ts/projects/base/index.js +22 -0
- package/templates/react/igr-ts/projects/empty/index.d.ts +14 -0
- package/templates/react/igr-ts/projects/empty/index.js +22 -0
- package/templates/react/igr-ts/projects/top-nav/files/src/App.css +59 -0
- package/templates/react/igr-ts/projects/top-nav/files/src/App.tsx +32 -0
- package/templates/react/igr-ts/projects/top-nav/files/src/components/navigation-header/index.tsx +29 -0
- package/templates/react/igr-ts/projects/top-nav/files/src/routes.json +7 -0
- package/templates/react/igr-ts/projects/top-nav/files/src/setupTests.ts +5 -0
- package/templates/react/igr-ts/projects/top-nav/files/src/views/home/index.tsx +22 -0
- package/templates/react/igr-ts/projects/top-nav/files/src/views/home/logo.svg +7 -0
- package/templates/react/igr-ts/projects/top-nav/files/src/views/home/style.module.css +27 -0
- package/templates/react/igr-ts/projects/top-nav/index.d.ts +14 -0
- package/templates/react/igr-ts/projects/top-nav/index.js +22 -0
- package/templates/react/igr-ts/radial-gauge/default/files/src/views/__path__/index.test.tsx +8 -0
- package/templates/react/igr-ts/radial-gauge/default/files/src/views/__path__/index.tsx +61 -0
- package/templates/react/igr-ts/radial-gauge/default/files/src/views/__path__/style.module.css +12 -0
- package/templates/react/igr-ts/radial-gauge/default/index.d.ts +1 -0
- package/templates/react/igr-ts/radial-gauge/default/index.js +18 -0
- package/templates/react/igr-ts/radial-gauge/index.d.ts +1 -0
- package/templates/react/igr-ts/radial-gauge/index.js +16 -0
- package/templates/react/index.js +1 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cli_core_1 = require("@igniteui/cli-core");
|
|
4
|
+
class IgrTsDataGridComponent extends cli_core_1.BaseComponent {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
constructor() {
|
|
9
|
+
super(__dirname);
|
|
10
|
+
this.name = "Data Grid";
|
|
11
|
+
this.group = "Grids & Lists";
|
|
12
|
+
this.description = "pick from grids: basic, sorting, templating.";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
module.exports = new IgrTsDataGridComponent();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cli_core_1 = require("@igniteui/cli-core");
|
|
4
|
+
class IgrTsReactProjectLibrary extends cli_core_1.BaseProjectLibrary {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(__dirname);
|
|
7
|
+
this.name = "Ignite UI for React TS";
|
|
8
|
+
this.projectType = "igr-ts";
|
|
9
|
+
this.themes = ["default"];
|
|
10
|
+
const groups = require("./groups.json");
|
|
11
|
+
// tslint:disable-next-line:forin
|
|
12
|
+
for (const key in groups) {
|
|
13
|
+
this.groupDescriptions.set(key, groups[key]);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
module.exports = new IgrTsReactProjectLibrary();
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import style from './style.module.css';
|
|
3
|
+
import { IgrLinearGaugeModule } from 'igniteui-react-gauges';
|
|
4
|
+
import { IgrLinearGauge } from 'igniteui-react-gauges';
|
|
5
|
+
|
|
6
|
+
IgrLinearGaugeModule.register();
|
|
7
|
+
|
|
8
|
+
export default function $(ClassName)() {
|
|
9
|
+
const title = 'Linear Gauge';
|
|
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
|
+
)
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const IgniteUIForReactTemplate_1 = require("../../../../../lib/templates/IgniteUIForReactTemplate");
|
|
4
|
+
class IgrTsLinearGaugeTemplate extends IgniteUIForReactTemplate_1.IgniteUIForReactTemplate {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(__dirname);
|
|
7
|
+
this.components = ["Linear Gauge"];
|
|
8
|
+
this.controlGroup = "Gauges";
|
|
9
|
+
this.listInComponentTemplates = true;
|
|
10
|
+
this.id = "linear-gauge";
|
|
11
|
+
this.projectType = "igr-ts";
|
|
12
|
+
this.name = "Linear Gauge";
|
|
13
|
+
this.description = `value compared against a scale and one or more ranges.`;
|
|
14
|
+
this.packages = ["igniteui-react-gauges@~16.15.0"]; // TODO: read version from igniteui-react-core in package.json
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
module.exports = new IgrTsLinearGaugeTemplate();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cli_core_1 = require("@igniteui/cli-core");
|
|
4
|
+
class IgrTsLinearGaugeComponent extends cli_core_1.BaseComponent {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
constructor() {
|
|
9
|
+
super(__dirname);
|
|
10
|
+
this.name = "Linear Gauge";
|
|
11
|
+
this.group = "Gauges";
|
|
12
|
+
this.description = `value compared against a scale and one or more ranges.`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
module.exports = new IgrTsLinearGaugeComponent();
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { IgrPieChartModule } from 'igniteui-react-charts';
|
|
3
|
+
import { IgrPieChart } from 'igniteui-react-charts';
|
|
4
|
+
import { IgrItemLegend } from 'igniteui-react-charts';
|
|
5
|
+
import { IgrItemLegendModule } from 'igniteui-react-charts';
|
|
6
|
+
import style from './style.module.css';
|
|
7
|
+
|
|
8
|
+
IgrPieChartModule.register();
|
|
9
|
+
IgrItemLegendModule.register();
|
|
10
|
+
|
|
11
|
+
const data = [
|
|
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
|
+
];
|
|
18
|
+
|
|
19
|
+
export default function $(ClassName)() {
|
|
20
|
+
const title = 'Pie Chart';
|
|
21
|
+
const [chartData, setChartData] = useState([]);
|
|
22
|
+
let legendRef = useRef();
|
|
23
|
+
let chartRef = useRef();
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
setChartData(data);
|
|
27
|
+
}, []);
|
|
28
|
+
|
|
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
|
+
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const IgniteUIForReactTemplate_1 = require("../../../../../lib/templates/IgniteUIForReactTemplate");
|
|
4
|
+
class IgrTsPieChartTemplate extends IgniteUIForReactTemplate_1.IgniteUIForReactTemplate {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(__dirname);
|
|
7
|
+
this.components = ["Pie Chart"];
|
|
8
|
+
this.controlGroup = "Charts";
|
|
9
|
+
this.listInComponentTemplates = true;
|
|
10
|
+
this.id = "pie-chart";
|
|
11
|
+
this.projectType = "igr-ts";
|
|
12
|
+
this.name = "Pie Chart";
|
|
13
|
+
this.description = `easily illustate the proportions of data entries`;
|
|
14
|
+
this.packages = ["igniteui-react-charts@~16.15.0"]; // TODO: read version from igniteui-react-core in package.json
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
module.exports = new IgrTsPieChartTemplate();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cli_core_1 = require("@igniteui/cli-core");
|
|
4
|
+
class IgrTsPieChartComponent extends cli_core_1.BaseComponent {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
constructor() {
|
|
9
|
+
super(__dirname);
|
|
10
|
+
this.name = "Pie Chart";
|
|
11
|
+
this.group = "Charts";
|
|
12
|
+
this.description = `easily illustrate the proportions of data entries`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
module.exports = new IgrTsPieChartComponent();
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# $(name)
|
|
2
|
+
|
|
3
|
+
This project was generated with [Ignite UI CLI](https://github.com/IgniteUI/igniteui-cli) version $(cliVersion).<br>
|
|
4
|
+
The template builds upon a project bootstrapped with [Vite](https://vitejs.dev/).
|
|
5
|
+
|
|
6
|
+
## Development server
|
|
7
|
+
|
|
8
|
+
Run `ig start` to build the application, start a web server and open the application in the default browser. <br>
|
|
9
|
+
The default serving port is `http://localhost:3003/`. Default serving port can be configured in `.env` via `PORT` property.
|
|
10
|
+
|
|
11
|
+
## Build
|
|
12
|
+
|
|
13
|
+
Run `ig build` to build the application into an output directory.
|
|
14
|
+
|
|
15
|
+
## Step by step mode
|
|
16
|
+
|
|
17
|
+
If you want to get a guided experience through the available options, you can initialize the step by step mode that will help you to create and setup your new application, as well as update project previously created with the Ignite UI CLI. To start the guide, simply run the `ig` command.
|
|
18
|
+
|
|
19
|
+
## List templates
|
|
20
|
+
|
|
21
|
+
The `ig list` command lists all available templates for this project.
|
|
22
|
+
|
|
23
|
+
## Adding components
|
|
24
|
+
|
|
25
|
+
Add a new component or template to the project passing component ID and choosing a name.
|
|
26
|
+
|
|
27
|
+
`ig add <component/template> <component_name>`
|
|
28
|
+
|
|
29
|
+
The ID matches either a component ("grid", "category-chart", etc) or a predefined template. Predefined templates can provide either multiple components or fulfilling a specific use case like "form-validation", "master-detail" and so on.
|
|
30
|
+
|
|
31
|
+
## Running unit tests
|
|
32
|
+
|
|
33
|
+
Run `ig test` to execute the unit tests.
|
|
34
|
+
|
|
35
|
+
## Commands Help
|
|
36
|
+
|
|
37
|
+
`ig help` lists the available commands and provides a brief description of what they do.
|
|
38
|
+
|
|
39
|
+
## Learn More
|
|
40
|
+
|
|
41
|
+
To get more help on the IgniteUI CLI go check out the [IgniteUI CLI Wiki](https://github.com/IgniteUI/igniteui-cli/wiki).
|
|
42
|
+
|
|
43
|
+
Learn more about Vite features in the [Vite documentation](https://vitejs.dev/guide/).
|
|
44
|
+
|
|
45
|
+
To learn React, check out the [React documentation](https://reactjs.org/).
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
PORT=3003
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
env: { browser: true, es2020: true },
|
|
4
|
+
extends: [
|
|
5
|
+
'eslint:recommended',
|
|
6
|
+
'plugin:@typescript-eslint/recommended',
|
|
7
|
+
'plugin:react-hooks/recommended',
|
|
8
|
+
],
|
|
9
|
+
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
|
10
|
+
parser: '@typescript-eslint/parser',
|
|
11
|
+
plugins: ['react-refresh'],
|
|
12
|
+
rules: {
|
|
13
|
+
'react-refresh/only-export-components': [
|
|
14
|
+
'warn',
|
|
15
|
+
{ allowConstantExport: true },
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.js
|
|
7
|
+
|
|
8
|
+
# testing
|
|
9
|
+
/coverage
|
|
10
|
+
|
|
11
|
+
# production
|
|
12
|
+
/build
|
|
13
|
+
|
|
14
|
+
# misc
|
|
15
|
+
.DS_Store
|
|
16
|
+
.env.local
|
|
17
|
+
.env.development.local
|
|
18
|
+
.env.test.local
|
|
19
|
+
.env.production.local
|
|
20
|
+
|
|
21
|
+
npm-debug.log*
|
|
22
|
+
yarn-debug.log*
|
|
23
|
+
yarn-error.log*
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "$(cliVersion)",
|
|
3
|
+
"project": {
|
|
4
|
+
"defaultPort": 3003,
|
|
5
|
+
"framework": "react",
|
|
6
|
+
"projectType": "igr-ts",
|
|
7
|
+
"projectTemplate": "$(projectTemplate)",
|
|
8
|
+
"theme": "$(theme)",
|
|
9
|
+
"isBundle": false,
|
|
10
|
+
"components": [],
|
|
11
|
+
"sourceFiles": [],
|
|
12
|
+
"isShowcase": false,
|
|
13
|
+
"version": ""
|
|
14
|
+
},
|
|
15
|
+
"build": {}
|
|
16
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<link rel="shortcut icon" href="/favicon.ico" />
|
|
6
|
+
<meta
|
|
7
|
+
name="viewport"
|
|
8
|
+
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
|
9
|
+
/>
|
|
10
|
+
<meta name="theme-color" content="#000000" />
|
|
11
|
+
<!--
|
|
12
|
+
manifest.json provides metadata used when your web app is installed on a
|
|
13
|
+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
|
14
|
+
-->
|
|
15
|
+
<link rel="manifest" href="/manifest.json" />
|
|
16
|
+
<title>IgniteUI for React</title>
|
|
17
|
+
</head>
|
|
18
|
+
<body>
|
|
19
|
+
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
20
|
+
<div id="root"></div>
|
|
21
|
+
<!--
|
|
22
|
+
This HTML file is a template.
|
|
23
|
+
If you open it directly in the browser, you will see an empty page.
|
|
24
|
+
|
|
25
|
+
You can add webfonts, meta tags, or analytics to this file.
|
|
26
|
+
The build step will place the bundled scripts into the <body> tag.
|
|
27
|
+
|
|
28
|
+
To begin the development, run `npm start` or `yarn start`.
|
|
29
|
+
To create a production bundle, use `npm run build` or `yarn build`.
|
|
30
|
+
-->
|
|
31
|
+
</body>
|
|
32
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
33
|
+
</html>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "$(dash-name)",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@testing-library/jest-dom": "^6.1.3",
|
|
8
|
+
"@testing-library/react": "^14.0.0",
|
|
9
|
+
"functions-have-names": "^1.2.3",
|
|
10
|
+
"igniteui-react-core": "18.2.2-beta.0",
|
|
11
|
+
"react": "^18.2.0",
|
|
12
|
+
"react-app-polyfill": "^0.2.0",
|
|
13
|
+
"react-dom": "^18.2.0",
|
|
14
|
+
"react-router-dom": "5.3.4",
|
|
15
|
+
"react-native-get-random-values": "^1.9.0",
|
|
16
|
+
"resize-observer-polyfill": "^1.5.1",
|
|
17
|
+
"vitest": "^0.34.4"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/react": "^18.2.15",
|
|
21
|
+
"@types/react-dom": "^18.2.7",
|
|
22
|
+
"@vitejs/plugin-react": "^4.0.3",
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
|
24
|
+
"@typescript-eslint/parser": "^6.2.1",
|
|
25
|
+
"eslint": "^8.46.0",
|
|
26
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
27
|
+
"eslint-plugin-react-refresh": "^0.4.3",
|
|
28
|
+
"jsdom": "^22.1.0",
|
|
29
|
+
"typescript": "^5.0.2",
|
|
30
|
+
"vite": "^4.4.9",
|
|
31
|
+
"vitest-canvas-mock": "^0.3.3",
|
|
32
|
+
"igniteui-cli": "~$(cliVersion)"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"start": "vite",
|
|
36
|
+
"build": "tsc && vite build",
|
|
37
|
+
"preview": "vite preview",
|
|
38
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
39
|
+
"test": "vitest"
|
|
40
|
+
},
|
|
41
|
+
"eslintConfig": {
|
|
42
|
+
"extends": "react-app"
|
|
43
|
+
},
|
|
44
|
+
"browserslist": [
|
|
45
|
+
">0.2%",
|
|
46
|
+
"not dead",
|
|
47
|
+
"not ie <= 11",
|
|
48
|
+
"not op_mini all"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"short_name": "$(name)",
|
|
3
|
+
"name": "$(name)",
|
|
4
|
+
"icons": [
|
|
5
|
+
{
|
|
6
|
+
"src": "favicon.ico",
|
|
7
|
+
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
+
"type": "image/x-icon"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"start_url": ".",
|
|
12
|
+
"display": "standalone",
|
|
13
|
+
"theme_color": "#000000",
|
|
14
|
+
"background_color": "#ffffff"
|
|
15
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, {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,14 @@
|
|
|
1
|
+
body {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 0;
|
|
4
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
|
|
5
|
+
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
|
6
|
+
sans-serif;
|
|
7
|
+
-webkit-font-smoothing: antialiased;
|
|
8
|
+
-moz-osx-font-smoothing: grayscale;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
code {
|
|
12
|
+
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
|
13
|
+
monospace;
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom/client';
|
|
3
|
+
import './index.css';
|
|
4
|
+
import App from './App';
|
|
5
|
+
import * as serviceWorker from './serviceWorker';
|
|
6
|
+
import 'react-app-polyfill/ie11';
|
|
7
|
+
|
|
8
|
+
/** Required in IE11 for Charts */
|
|
9
|
+
Number.isNaN = Number.isNaN || function(value) {
|
|
10
|
+
// eslint-disable-next-line
|
|
11
|
+
return value !== value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
15
|
+
<React.StrictMode>
|
|
16
|
+
<App />
|
|
17
|
+
</React.StrictMode>
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
// If you want your app to work offline and load faster, you can change
|
|
21
|
+
// unregister() to register() below. Note this comes with some pitfalls.
|
|
22
|
+
// Learn more about service workers: http://bit.ly/CRA-PWA
|
|
23
|
+
serviceWorker.unregister();
|