Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tree Grid column types sample #738

Merged
merged 3 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions samples/grids/tree-grid/column-data-types/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"printWidth": 250,
"tabWidth": 4,
"useTabs": false,
"semi": true,
"singleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"fluid": false
}
40 changes: 40 additions & 0 deletions samples/grids/tree-grid/column-data-types/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<title>Sample | Ignite UI | Web Components | infragistics</title>
<meta charset="UTF-8" />

<link rel="shortcut icon" href="https://static.infragistics.com/xplatform/images/browsers/wc.png" />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Kanit&display=swap" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium Web" />
<link rel="stylesheet" href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css" />
<link rel="stylesheet" href="/src/index.css" type="text/css" />
</head>

<body>
<div id="root">
<div class="container sample ig-typography">
<div class="container fill">
<igc-tree-grid auto-generate="false" id="grid" primary-key="ID" foreign-key="ParentID" allow-filtering="true" filter-mode="excelStyleFilter" locale="EN" summary-calculation-mode="rootLevelOnly">
<igc-column field="Name" header="Full Name" data-type="string" width="220px" sortable="true" has-summary="true" editable="true" resizable="true"></igc-column>
<igc-column field="Avatar" header="Photo" data-type="image" width="120px" resizable="true"></igc-column>
<igc-column field="Title" header="Title" data-type="string" width="250px" sortable="true" has-summary="true" editable="true" resizable="true"></igc-column>
<igc-column field="Age" header="Age" data-type="number" width="120px" sortable="true" has-summary="true" editable="true" resizable="true"></igc-column>
<igc-column field="HireFullDate" header="Hire Full Date" data-type="dateTime" width="300px" sortable="true" has-summary="true" editable="true" resizable="true" id="column1"></igc-column>
<igc-column field="HireDate" header="Hire Date" data-type="date" width="160px" sortable="true" has-summary="true" editable="true" resizable="true" id="column2"></igc-column>
<igc-column field="HireTime" header="Hire Time" data-type="time" width="160px" sortable="true" has-summary="true" editable="true" resizable="true" id="column3"></igc-column>
<igc-column field="Salary" header="Salary" data-type="currency" width="120px" sortable="true" has-summary="true" editable="true" resizable="true" id="column4"></igc-column>
<igc-column field="CompletedTasks" header="Completed Tasks" data-type="percent" width="200px" sortable="true" editable="true" resizable="true" id="column5"></igc-column>
<igc-column field="OnPTO" header="On PTO" data-type="boolean" width="120px" sortable="true" editable="true" resizable="true"></igc-column>
</igc-tree-grid>
</div>
</div>
</div>

<!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %>
<script src="src/index.ts"></script>
<% } %>
</body>
</html>
62 changes: 62 additions & 0 deletions samples/grids/tree-grid/column-data-types/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"name": "example-ignite-ui-web-components",
"description": "This project provides example of using Ignite UI for Web Components",
"author": "Infragistics",
"version": "1.0.0",
"license": "",
"private": true,
"homepage": ".",
"main": "src/index.ts",
"scripts": {
"build": "npm run build:prod",
"build:dev": "webpack --mode development --config ./webpack.config.js --progress --color --display-error-details",
"build:prod": "webpack --env.NODE_ENV=production --mode production --config ./webpack.config.js --progress --color --display-error-details --bail",
"serve:dev": "node --max-old-space-size=8192 node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode development --config ./webpack.config.js --hot --progress --open",
"serve:prod": "webpack-dev-server --env.NODE_ENV=production --mode production --config ./webpack.config.js --port 3000 --host 0.0.0.0 --hot --progress --open --content-base dist/",
"start": "npm run serve:dev",
"build:legacy": "npm run build:prod:legacy",
"build:dev:legacy": "webpack --env.legacy=true --mode development --config ./webpack.config.js --progress --color --display-error-details",
"build:prod:legacy": "webpack --env.NODE_ENV=production --env.legacy=true --mode production --config ./webpack.config.js --progress --color --display-error-details --bail",
"serve:dev:legacy": "node --max-old-space-size=8192 node_modules/webpack-dev-server/bin/webpack-dev-server.js --env.legacy=true --mode development --config ./webpack.config.js --hot --progress --open",
"serve:prod:legacy": "webpack-dev-server --env.NODE_ENV=production --env.legacy=true --mode production --config ./webpack.config.js --port 3000 --host 0.0.0.0 --hot --progress --open --content-base dist/",
"start:legacy": "npm run serve:dev:legacy"
},
"dependencies": {
"@webcomponents/custom-elements": "^1.4.1",
"@webcomponents/template": "^1.4.2",
"babel-runtime": "^6.26.0",
"core-js": "^3.6.5",
"igniteui-webcomponents-core": "4.8.0",
"igniteui-webcomponents-grids": "4.8.0",
"igniteui-webcomponents-inputs": "4.8.0",
"igniteui-webcomponents-layouts": "4.8.0",
RivaIvanova marked this conversation as resolved.
Show resolved Hide resolved
"lit-html": "^2.2.0",
"tslib": "^2.0.0"
},
"devDependencies": {
"@babel/cli": "^7.8.3",
"@babel/core": "^7.8.3",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.10.0",
"@babel/preset-env": "^7.8.3",
"@babel/preset-typescript": "^7.8.3",
"@types/source-map": "^0.5.7",
"babel-loader": "^8.1.0",
"babel-plugin-transform-custom-element-classes": "^0.1.0",
"css-loader": "^1.0.0",
"csv-loader": "^3.0.2",
"file-loader": "^4.2.0",
"fork-ts-checker-webpack-plugin": "^4.1.5",
"html-webpack-plugin": "^4.3.0",
"parcel-bundler": "^1.6.1",
"source-map": "^0.7.3",
"style-loader": "^0.22.1",
"tsconfig-paths-webpack-plugin": "^4.0.0",
"typescript": "^4.4.4",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1",
"worker-loader": "^3.0.8",
"xml-loader": "^1.2.1"
}
}
6 changes: 6 additions & 0 deletions samples/grids/tree-grid/column-data-types/sandbox.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"infiniteLoopProtection": false,
"hardReloadOnChange": false,
"view": "browser",
"template": "parcel"
}
272 changes: 272 additions & 0 deletions samples/grids/tree-grid/column-data-types/src/EmployeesData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
export const EMPLOYEES_DATA = [
{
Age: 55,
HireDate: new Date("2008-03-20"),
HireTime: new Date("2008-03-20"),
HireFullDate: new Date("2008-03-20"),
ID: 1,
Name: "Johnathan Winchester",
Phone: "0251-031259",
OnPTO: false,
ParentID: -1,
Avatar: "https://static.infragistics.com/xplatform/images/people/men/5.jpg",
Salary: 15,
CompletedTasks: 0.15,
Title: "Development Manager"
},
{
Age: 42,
HireDate: new Date("2014-01-22"),
HireTime: new Date("2014-01-22"),
HireFullDate: new Date("2014-01-22"),
ID: 4,
Name: "Ana Sanders",
Phone: "(21) 555-0091",
OnPTO: true,
ParentID: -1,
Avatar: "https://static.infragistics.com/xplatform/images/people/women/4.jpg",
Salary: 39,
CompletedTasks: 0.39,
Title: "CEO"
},
{
Age: 49,
HireDate: new Date("2014-01-22"),
HireTime: new Date("2014-01-22"),
HireFullDate: new Date("2014-01-22"),
ID: 18,
Name: "Victoria Lincoln",
Phone: "(071) 23 67 22 20",
OnPTO: true,
ParentID: -1,
Avatar: "https://static.infragistics.com/xplatform/images/people/women/2.jpg",
Salary: 52,
CompletedTasks: 0.52,
Title: "Accounting Manager"
},
{
Age: 61,
HireDate: new Date("2010-01-01"),
HireTime: new Date("2010-01-01"),
HireFullDate: new Date("2010-01-01"),
ID: 10,
Name: "Yang Wang",
Phone: "(21) 555-0091",
OnPTO: false,
ParentID: -1,
Avatar: "https://static.infragistics.com/xplatform/images/people/men/4.jpg",
Salary: 13,
CompletedTasks: 0.13,
Title: "Localization Manager"
},
{
Age: 43,
HireDate: new Date("2011-06-03"),
HireTime: new Date("2011-06-03"),
HireFullDate: new Date("2011-06-03"),
ID: 3,
Name: "Michael Burke",
Phone: "0452-076545",
OnPTO: true,
ParentID: 1,
Avatar: "https://static.infragistics.com/xplatform/images/people/men/1.jpg",
Salary: 22,
CompletedTasks: 0.22,
Title: "Senior Software Developer"
},
{
Age: 29,
HireDate: new Date("2009-06-19"),
HireTime: new Date("2009-06-19"),
HireFullDate: new Date("2009-06-19"),
ID: 2,
Name: "Thomas Anderson",
Phone: "(14) 555-8122",
OnPTO: false,
ParentID: 1,
Avatar: "https://static.infragistics.com/xplatform/images/people/men/2.jpg",
Salary: 30,
CompletedTasks: 0.3,
Title: "Senior Software Developer"
},
{
Age: 31,
HireDate: new Date("2014-08-18"),
HireTime: new Date("2014-08-18"),
HireFullDate: new Date("2014-08-18"),
ID: 11,
Name: "Monica Reyes",
Phone: "7675-3425",
OnPTO: false,
ParentID: 1,
Avatar: "https://static.infragistics.com/xplatform/images/people/women/3.jpg",
Salary: 45,
CompletedTasks: 0.45,
Title: "Software Development Team Lead"
},
{
Age: 35,
HireDate: new Date("2015-09-17"),
HireTime: new Date("2015-09-17"),
HireFullDate: new Date("2015-09-17"),
ID: 6,
Name: "Roland Mendel",
Phone: "(505) 555-5939",
OnPTO: false,
ParentID: 11,
Avatar: "https://static.infragistics.com/xplatform/images/people/men/3.jpg",
Salary: 35,
CompletedTasks: 0.35,
Title: "Senior Software Developer"
},
{
Age: 44,
HireDate: new Date("2009-10-11"),
HireTime: new Date("2009-10-11"),
HireFullDate: new Date("2009-10-11"),
ID: 12,
Name: "Sven Cooper",
Phone: "0695-34 67 21",
OnPTO: true,
ParentID: 11,
Avatar: "https://static.infragistics.com/xplatform/images/people/men/6.jpg",
Salary: 29,
CompletedTasks: 0.29,
Title: "Senior Software Developer"
},
{
Age: 44,
HireDate: new Date("2014-04-04"),
HireTime: new Date("2014-04-04"),
HireFullDate: new Date("2014-04-04"),
ID: 14,
Name: "Laurence Johnson",
Phone: "981-443655",
OnPTO: false,
ParentID: 4,
Avatar: "https://static.infragistics.com/xplatform/images/people/men/7.jpg",
Salary: 63,
CompletedTasks: 0.63,
Title: "Director"
},
{
Age: 25,
HireDate: new Date("2017-11-09"),
HireTime: new Date("2017-11-09"),
HireFullDate: new Date("2017-11-09"),
ID: 5,
Name: "Elizabeth Richards",
Phone: "(2) 283-2951",
OnPTO: true,
ParentID: 4,
Avatar: "https://static.infragistics.com/xplatform/images/people/women/1.jpg",
Salary: 67,
CompletedTasks: 0.67,
Title: "Vice President"
},
{
Age: 39,
HireDate: new Date("2010-03-22"),
HireTime: new Date("2010-03-22"),
HireFullDate: new Date("2010-03-22"),
ID: 13,
Name: "Trevor Ashworth",
Phone: "981-443655",
OnPTO: true,
ParentID: 5,
Avatar: "https://static.infragistics.com/xplatform/images/people/men/8.jpg",
Salary: 70,
CompletedTasks: 0.7,
Title: "Director"
},
{
Age: 44,
HireDate: new Date("2014-04-04"),
HireTime: new Date("2014-04-04"),
HireFullDate: new Date("2014-04-04"),
ID: 17,
Name: "Antonio Moreno",
Phone: "(505) 555-5939",
OnPTO: false,
ParentID: 18,
Avatar: "https://static.infragistics.com/xplatform/images/people/men/9.jpg",
Salary: 52,
CompletedTasks: 0.52,
Title: "Senior Accountant"
},
{
Age: 50,
HireDate: new Date("2007-11-18"),
HireTime: new Date("2007-11-18"),
HireFullDate: new Date("2007-11-18"),
ID: 7,
Name: "Pedro Rodriguez",
Phone: "035-640230",
OnPTO: false,
ParentID: 10,
Avatar: "https://static.infragistics.com/xplatform/images/people/men/10.jpg",
Salary: 43,
CompletedTasks: 0.43,
Title: "Senior Localization Developer"
},
{
Age: 27,
HireDate: new Date("2016-02-19"),
HireTime: new Date("2016-02-19"),
HireFullDate: new Date("2016-02-19"),
ID: 8,
Name: "Casey Harper",
Phone: "0342-023176",
OnPTO: true,
ParentID: 10,
Avatar: "https://static.infragistics.com/xplatform/images/people/women/5.jpg",
Salary: 35,
CompletedTasks: 0.35,
Title: "Senior Localization"
},
{
Age: 25,
HireDate: new Date("2017-11-09"),
HireTime: new Date("2017-11-09"),
HireFullDate: new Date("2017-11-09"),
ID: 15,
Name: "Patricia Simpson",
Phone: "069-0245984",
OnPTO: false,
ParentID: 7,
Avatar: "https://static.infragistics.com/xplatform/images/people/women/6.jpg",
Salary: 15,
CompletedTasks: 0.15,
Title: "Localization Intern"
},
{
Age: 39,
HireDate: new Date("2010-03-22"),
HireTime: new Date("2010-03-22"),
HireFullDate: new Date("2010-03-22"),
ID: 9,
Name: "Francisco Chang",
Phone: "(91) 745 6200",
OnPTO: false,
ParentID: 7,
Avatar: "https://static.infragistics.com/xplatform/images/people/men/26.jpg",
Salary: 15,
CompletedTasks: 0.15,
Title: "Localization Intern"
},
{
Age: 25,
HireDate: new Date("2018-03-18"),
HireTime: new Date("2018-03-18"),
HireFullDate: new Date("2018-03-18"),
ID: 16,
Name: "Peter Lewis",
Phone: "069-0245984",
OnPTO: true,
ParentID: 7,
Avatar: "https://static.infragistics.com/xplatform/images/people/men/27.jpg",
Salary: 15,
CompletedTasks: 0.15,
Title: "Localization Intern"
}
];
Loading
Loading