Skip to content

Commit 96f206c

Browse files
Merge pull request #582 from IgniteUI/ganastasov/tree-grid-multi-cell-selection-mode
Add tree grid multi cell selection mode sample for React
2 parents 8957949 + 09b9eca commit 96f206c

9 files changed

Lines changed: 482 additions & 0 deletions

File tree

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// https://www.robertcooper.me/using-eslint-and-prettier-in-a-typescript-project
2+
module.exports = {
3+
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
4+
parserOptions: {
5+
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
6+
sourceType: "module", // Allows for the use of imports
7+
ecmaFeatures: {
8+
jsx: true // Allows for the parsing of JSX
9+
}
10+
},
11+
settings: {
12+
react: {
13+
version: "999.999.999" // Tells eslint-plugin-react to automatically detect the version of React to use
14+
}
15+
},
16+
extends: [
17+
"eslint:recommended",
18+
"plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react
19+
"plugin:@typescript-eslint/recommended" // Uses the recommended rules from @typescript-eslint/eslint-plugin
20+
],
21+
rules: {
22+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
23+
"default-case": "off",
24+
"jsx-a11y/alt-text": "off",
25+
"jsx-a11y/iframe-has-title": "off",
26+
"no-undef": "off",
27+
"no-unused-vars": "off",
28+
"no-extend-native": "off",
29+
"no-throw-literal": "off",
30+
"no-useless-concat": "off",
31+
"no-mixed-operators": "off",
32+
"no-prototype-builtins": "off",
33+
"prefer-const": "off",
34+
"prefer-rest-params": "off",
35+
"@typescript-eslint/no-unused-vars": "off",
36+
"@typescript-eslint/no-explicit-any": "off",
37+
"@typescript-eslint/no-inferrable-types": "off",
38+
"@typescript-eslint/no-useless-constructor": "off",
39+
"@typescript-eslint/no-use-before-define": "off",
40+
"@typescript-eslint/no-non-null-assertion": "off",
41+
"@typescript-eslint/interface-name-prefix": "off",
42+
"@typescript-eslint/prefer-namespace-keyword": "off",
43+
"@typescript-eslint/explicit-function-return-type": "off",
44+
"@typescript-eslint/explicit-module-boundary-types": "off"
45+
},
46+
"overrides": [
47+
{
48+
"files": ["*.ts", "*.tsx"],
49+
"rules": {
50+
"default-case": "off",
51+
"jsx-a11y/alt-text": "off",
52+
"jsx-a11y/iframe-has-title": "off",
53+
"no-var": "off",
54+
"no-undef": "off",
55+
"no-unused-vars": "off",
56+
"no-extend-native": "off",
57+
"no-throw-literal": "off",
58+
"no-useless-concat": "off",
59+
"no-mixed-operators": "off",
60+
"no-prototype-builtins": "off",
61+
"prefer-const": "off",
62+
"prefer-rest-params": "off",
63+
"@typescript-eslint/no-unused-vars": "off",
64+
"@typescript-eslint/no-explicit-any": "off",
65+
"@typescript-eslint/no-inferrable-types": "off",
66+
"@typescript-eslint/no-useless-constructor": "off",
67+
"@typescript-eslint/no-use-before-define": "off",
68+
"@typescript-eslint/no-non-null-assertion": "off",
69+
"@typescript-eslint/interface-name-prefix": "off",
70+
"@typescript-eslint/prefer-namespace-keyword": "off",
71+
"@typescript-eslint/explicit-function-return-type": "off",
72+
"@typescript-eslint/explicit-module-boundary-types": "off"
73+
}
74+
}
75+
]
76+
};
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "example-ignite-ui-react",
3+
"description": "This project provides example of using Ignite UI for React components",
4+
"author": "Infragistics",
5+
"version": "1.4.0",
6+
"license": "",
7+
"homepage": ".",
8+
"private": true,
9+
"scripts": {
10+
"start": "set PORT=4200 && react-scripts --max_old_space_size=10240 start",
11+
"build": "react-scripts --max_old_space_size=10240 build ",
12+
"test": "react-scripts test --env=jsdom",
13+
"eject": "react-scripts eject",
14+
"lint": "eslint ./src/**/*.{ts,tsx}"
15+
},
16+
"dependencies": {
17+
"igniteui-dockmanager": "1.14.3",
18+
"igniteui-react": "18.6.1-alpha.0",
19+
"igniteui-react-core": "18.6.1-alpha.0",
20+
"igniteui-react-datasources": "18.6.1-alpha.0",
21+
"igniteui-react-grids": "18.6.1-alpha.0",
22+
"igniteui-react-inputs": "18.6.1-alpha.0",
23+
"igniteui-react-layouts": "18.6.1-alpha.0",
24+
"igniteui-webcomponents": "4.9.0",
25+
"lit-html": "^2.2.0",
26+
"react": "^18.2.0",
27+
"react-dom": "^18.2.0",
28+
"react-scripts": "^5.0.1",
29+
"tslib": "^2.4.0"
30+
},
31+
"devDependencies": {
32+
"@types/jest": "^29.2.0",
33+
"@types/node": "^18.11.7",
34+
"@types/react": "^18.0.24",
35+
"@types/react-dom": "^18.0.8",
36+
"eslint": "^8.33.0",
37+
"eslint-config-react": "^1.1.7",
38+
"eslint-plugin-react": "^7.20.0",
39+
"react-app-rewired": "^2.2.1",
40+
"typescript": "^4.8.4",
41+
"worker-loader": "^3.0.8"
42+
},
43+
"browserslist": [
44+
">0.2%",
45+
"not dead",
46+
"not ie <= 11",
47+
"not op_mini all"
48+
]
49+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Sample | Ignite UI | React | infragistics</title>
5+
<link rel="shortcut icon" href="https://static.infragistics.com/xplatform/images/browsers/react.png" >
6+
<link rel="stylesheet" href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css" />
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
</body>
11+
</html>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"infiniteLoopProtection": false,
3+
"hardReloadOnChange": false,
4+
"view": "browser"
5+
}
Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
export class EmployeesFlatDataItem {
2+
public constructor(init: Partial<EmployeesFlatDataItem>) {
3+
Object.assign(this, init);
4+
}
5+
6+
public Age: number;
7+
public HireDate: string;
8+
public ID: number;
9+
public Name: string;
10+
public Phone: string;
11+
public OnPTO: boolean;
12+
public ParentID: number;
13+
public Title: string;
14+
15+
}
16+
export class EmployeesFlatData extends Array<EmployeesFlatDataItem> {
17+
public constructor(items: Array<EmployeesFlatDataItem> | number = -1) {
18+
if (Array.isArray(items)) {
19+
super(...items);
20+
} else {
21+
const newItems = [
22+
new EmployeesFlatDataItem(
23+
{
24+
Age: 55,
25+
HireDate: `2008-03-20`,
26+
ID: 1,
27+
Name: `Johnathan Winchester`,
28+
Phone: `0251-031259`,
29+
OnPTO: false,
30+
ParentID: -1,
31+
Title: `Development Manager`
32+
}),
33+
new EmployeesFlatDataItem(
34+
{
35+
Age: 42,
36+
HireDate: `2014-01-22`,
37+
ID: 4,
38+
Name: `Ana Sanders`,
39+
Phone: `(21) 555-0091`,
40+
OnPTO: true,
41+
ParentID: -1,
42+
Title: `CEO`
43+
}),
44+
new EmployeesFlatDataItem(
45+
{
46+
Age: 49,
47+
HireDate: `2014-01-22`,
48+
ID: 18,
49+
Name: `Victoria Lincoln`,
50+
Phone: `(071) 23 67 22 20`,
51+
OnPTO: true,
52+
ParentID: -1,
53+
Title: `Accounting Manager`
54+
}),
55+
new EmployeesFlatDataItem(
56+
{
57+
Age: 61,
58+
HireDate: `2010-01-01`,
59+
ID: 10,
60+
Name: `Yang Wang`,
61+
Phone: `(21) 555-0091`,
62+
OnPTO: false,
63+
ParentID: -1,
64+
Title: `Localization Manager`
65+
}),
66+
new EmployeesFlatDataItem(
67+
{
68+
Age: 43,
69+
HireDate: `2011-06-03`,
70+
ID: 3,
71+
Name: `Michael Burke`,
72+
Phone: `0452-076545`,
73+
OnPTO: true,
74+
ParentID: 1,
75+
Title: `Senior Software Developer`
76+
}),
77+
new EmployeesFlatDataItem(
78+
{
79+
Age: 29,
80+
HireDate: `2009-06-19`,
81+
ID: 2,
82+
Name: `Thomas Anderson`,
83+
Phone: `(14) 555-8122`,
84+
OnPTO: false,
85+
ParentID: 1,
86+
Title: `Senior Software Developer`
87+
}),
88+
new EmployeesFlatDataItem(
89+
{
90+
Age: 31,
91+
HireDate: `2014-08-18`,
92+
ID: 11,
93+
Name: `Monica Reyes`,
94+
Phone: `7675-3425`,
95+
OnPTO: false,
96+
ParentID: 1,
97+
Title: `Software Development Team Lead`
98+
}),
99+
new EmployeesFlatDataItem(
100+
{
101+
Age: 35,
102+
HireDate: `2015-09-17`,
103+
ID: 6,
104+
Name: `Roland Mendel`,
105+
Phone: `(505) 555-5939`,
106+
OnPTO: false,
107+
ParentID: 11,
108+
Title: `Senior Software Developer`
109+
}),
110+
new EmployeesFlatDataItem(
111+
{
112+
Age: 44,
113+
HireDate: `2009-10-11`,
114+
ID: 12,
115+
Name: `Sven Cooper`,
116+
Phone: `0695-34 67 21`,
117+
OnPTO: true,
118+
ParentID: 11,
119+
Title: `Senior Software Developer`
120+
}),
121+
new EmployeesFlatDataItem(
122+
{
123+
Age: 44,
124+
HireDate: `2014-04-04`,
125+
ID: 14,
126+
Name: `Laurence Johnson`,
127+
Phone: `981-443655`,
128+
OnPTO: false,
129+
ParentID: 4,
130+
Title: `Director`
131+
}),
132+
new EmployeesFlatDataItem(
133+
{
134+
Age: 25,
135+
HireDate: `2017-11-09`,
136+
ID: 5,
137+
Name: `Elizabeth Richards`,
138+
Phone: `(2) 283-2951`,
139+
OnPTO: true,
140+
ParentID: 4,
141+
Title: `Vice President`
142+
}),
143+
new EmployeesFlatDataItem(
144+
{
145+
Age: 39,
146+
HireDate: `2010-03-22`,
147+
ID: 13,
148+
Name: `Trevor Ashworth`,
149+
Phone: `981-443655`,
150+
OnPTO: true,
151+
ParentID: 5,
152+
Title: `Director`
153+
}),
154+
new EmployeesFlatDataItem(
155+
{
156+
Age: 44,
157+
HireDate: `2014-04-04`,
158+
ID: 17,
159+
Name: `Antonio Moreno`,
160+
Phone: `(505) 555-5939`,
161+
OnPTO: false,
162+
ParentID: 18,
163+
Title: `Senior Accountant`
164+
}),
165+
new EmployeesFlatDataItem(
166+
{
167+
Age: 50,
168+
HireDate: `2007-11-18`,
169+
ID: 7,
170+
Name: `Pedro Rodriguez`,
171+
Phone: `035-640230`,
172+
OnPTO: false,
173+
ParentID: 10,
174+
Title: `Senior Localization Developer`
175+
}),
176+
new EmployeesFlatDataItem(
177+
{
178+
Age: 27,
179+
HireDate: `2016-02-19`,
180+
ID: 8,
181+
Name: `Casey Harper`,
182+
Phone: `0342-023176`,
183+
OnPTO: true,
184+
ParentID: 10,
185+
Title: `Senior Localization`
186+
}),
187+
new EmployeesFlatDataItem(
188+
{
189+
Age: 25,
190+
HireDate: `2017-11-09`,
191+
ID: 15,
192+
Name: `Patricia Simpson`,
193+
Phone: `069-0245984`,
194+
OnPTO: false,
195+
ParentID: 7,
196+
Title: `Localization Intern`
197+
}),
198+
new EmployeesFlatDataItem(
199+
{
200+
Age: 39,
201+
HireDate: `2010-03-22`,
202+
ID: 9,
203+
Name: `Francisco Chang`,
204+
Phone: `(91) 745 6200`,
205+
OnPTO: false,
206+
ParentID: 7,
207+
Title: `Localization Intern`
208+
}),
209+
new EmployeesFlatDataItem(
210+
{
211+
Age: 25,
212+
HireDate: `2018-03-18`,
213+
ID: 16,
214+
Name: `Peter Lewis`,
215+
Phone: `069-0245984`,
216+
OnPTO: true,
217+
ParentID: 7,
218+
Title: `Localization Intern`
219+
}),
220+
];
221+
super(...(newItems.slice(0, items)));
222+
}
223+
}
224+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* shared styles are loaded from: */
2+
/* https://static.infragistics.com/xplatform/css/samples */

0 commit comments

Comments
 (0)