Skip to content

Commit f79c873

Browse files
committed
chore(TileManager): Adding new samples
1 parent 09875b3 commit f79c873

70 files changed

Lines changed: 2461 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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+
"no-undef": "off",
25+
"no-unused-vars": "off",
26+
"no-extend-native": "off",
27+
"no-throw-literal": "off",
28+
"no-useless-concat": "off",
29+
"no-mixed-operators": "off",
30+
"no-prototype-builtins": "off",
31+
"prefer-const": "off",
32+
"prefer-rest-params": "off",
33+
"jsx-a11y/alt-text": "off",
34+
"jsx-a11y/iframe-has-title": "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+
"no-undef": "off",
52+
"no-unused-vars": "off",
53+
"no-extend-native": "off",
54+
"no-throw-literal": "off",
55+
"no-useless-concat": "off",
56+
"no-mixed-operators": "off",
57+
"no-prototype-builtins": "off",
58+
"prefer-const": "off",
59+
"prefer-rest-params": "off",
60+
"jsx-a11y/alt-text": "off",
61+
"jsx-a11y/iframe-has-title": "off",
62+
"@typescript-eslint/no-unused-vars": "off",
63+
"@typescript-eslint/no-explicit-any": "off",
64+
"@typescript-eslint/no-inferrable-types": "off",
65+
"@typescript-eslint/no-useless-constructor": "off",
66+
"@typescript-eslint/no-use-before-define": "off",
67+
"@typescript-eslint/no-non-null-assertion": "off",
68+
"@typescript-eslint/interface-name-prefix": "off",
69+
"@typescript-eslint/prefer-namespace-keyword": "off",
70+
"@typescript-eslint/explicit-function-return-type": "off",
71+
"@typescript-eslint/explicit-module-boundary-types": "off"
72+
}
73+
}
74+
]
75+
};
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!-- NOTE: do not change this file because it's auto re-generated from template: -->
2+
<!-- https://github.com/IgniteUI/igniteui-react-examples/tree/vnext/templates/sample/ReadMe.md -->
3+
4+
This folder contains implementation of React application with example of Overview feature using [TileManager](https://www.infragistics.com/products/ignite-ui-react/react/components/layouts/tile-manager.html) component.
5+
6+
7+
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
8+
<body>
9+
<a target="_blank" href="https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started.html" rel="noopener noreferrer">
10+
<img height="40px" style="border-radius: 0rem" alt="View Docs" src="https://github.com/IgniteUI/igniteui-blazor-examples/raw/vnext/templates/sample/images/button-docs.png"/>
11+
</a>
12+
<a target="_blank" href="./src/index.tsx" rel="noopener noreferrer">
13+
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="View Code" src="https://github.com/IgniteUI/igniteui-blazor-examples/raw/vnext/templates/sample/images/button-code.png"/>
14+
</a>
15+
<a target="_blank" href="https://www.infragistics.com/react-demos/samples/layouts/tile-manager/actions" rel="noopener noreferrer">
16+
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="Run Sample" src="https://github.com/IgniteUI/igniteui-blazor-examples/raw/vnext/templates/sample/images/button-run.png"/>
17+
</a>
18+
<a target="_blank" href="https://codesandbox.io/s/github/IgniteUI/igniteui-react-examples/tree/master/samples/layouts/tile-manager/actions?fontsize=14&hidenavigation=1&theme=dark&view=preview&file=/src/index.tsx" rel="noopener noreferrer">
19+
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="Run Sample" src="https://github.com/IgniteUI/igniteui-blazor-examples/raw/vnext/templates/sample/images/button-sandbox.png"/>
20+
</a>
21+
</body>
22+
</html>
23+
24+
## Branches
25+
26+
> **_NOTE:_** You should use [master](https://github.com/IgniteUI/igniteui-react-examples/tree/master) branch of this repository if you want to run samples on your computer. Use the [vnext](https://github.com/IgniteUI/igniteui-react-examples/tree/vnext) branch only when you want to contribute new samples to this repository.
27+
28+
## Instructions
29+
30+
Follow these instructions to run this example:
31+
32+
33+
```
34+
git clone https://github.com/IgniteUI/igniteui-react-examples.git
35+
git checkout master
36+
cd ./igniteui-react-examples
37+
cd ./samples/layouts/tile-manager/actions
38+
```
39+
40+
open above folder in VS Code or type:
41+
```
42+
code .
43+
```
44+
45+
In terminal window, run:
46+
```
47+
npm install --legacy-peer-deps
48+
npm run-script start
49+
```
50+
51+
Then open http://localhost:4200/ in your browser
52+
53+
54+
## Learn More
55+
56+
To learn more about **Ignite UI for React** components, check out the [React documentation](https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started.html).
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "react-radio-group",
3+
"description": "This project provides example of Radio Group using Infragistics React components",
4+
"author": "Infragistics",
5+
"homepage": ".",
6+
"version": "1.4.0",
7+
"private": true,
8+
"scripts": {
9+
"start": "set PORT=4200 && react-scripts --max_old_space_size=10240 start",
10+
"build": "react-scripts --max_old_space_size=10240 build ",
11+
"test": "react-scripts test --env=jsdom",
12+
"eject": "react-scripts eject"
13+
},
14+
"dependencies": {
15+
"igniteui-dockmanager": "1.16.1",
16+
"igniteui-react": "19.0.2",
17+
"igniteui-react-core": "19.0.0",
18+
"react": "^18.2.0",
19+
"react-dom": "^18.2.0",
20+
"react-scripts": "^5.0.1",
21+
"tslib": "^2.4.0"
22+
},
23+
"devDependencies": {
24+
"@types/jest": "^29.2.0",
25+
"@types/node": "^18.11.7",
26+
"@types/react": "^18.0.24",
27+
"@types/react-dom": "^18.0.8",
28+
"react-app-rewired": "^2.2.1",
29+
"typescript": "^4.8.4",
30+
"worker-loader": "^3.0.8"
31+
},
32+
"browserslist": [
33+
">0.2%",
34+
"not dead",
35+
"not ie <= 11",
36+
"not op_mini all"
37+
]
38+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Tile Manager Actions</title>
5+
<link href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css" rel="stylesheet" />
6+
</head>
7+
<body>
8+
<div id="root"></div>
9+
</body>
10+
</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: 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 */
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
import React from "react";
2+
import ReactDOM from "react-dom/client";
3+
import "./index.css";
4+
import { IgrTileManager, IgrTile, IgrIconButton, registerIconFromText } from "igniteui-react";
5+
import "igniteui-webcomponents/themes/light/bootstrap.css";
6+
7+
export default class Actions extends React.Component<any, any> {
8+
9+
constructor(props: any) {
10+
super(props);
11+
const northEast =
12+
'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="m216-160-56-56 464-464H360v-80h400v400h-80v-264L216-160Z"/></svg>';
13+
registerIconFromText('north_east', northEast, 'material');
14+
const southWest =
15+
'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M200-200v-400h80v264l464-464 56 56-464 464h264v80H200Z"/></svg>';
16+
registerIconFromText('south_west', southWest, 'material');
17+
const more =
18+
'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"/></svg>';
19+
registerIconFromText('more', more, 'material');
20+
const chart =
21+
'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M640-160v-280h160v280H640Zm-240 0v-640h160v640H400Zm-240 0v-440h160v440H160Z"/></svg>';
22+
registerIconFromText('chart', chart, 'material');
23+
}
24+
25+
private onCustomOneClick = (event: React.MouseEvent) => {
26+
27+
const tile = (event.currentTarget as HTMLElement).closest('igc-tile');
28+
29+
if (tile) {
30+
tile.maximized = !tile.maximized;
31+
32+
const actionsSlot = tile.querySelector('[slot="actions"]') as HTMLElement;
33+
const currentBtn = event.currentTarget as HTMLElement;
34+
35+
if (currentBtn) {
36+
if (
37+
tile.maximized
38+
) {
39+
currentBtn.setAttribute('name', 'south_west');
40+
currentBtn.setAttribute('aria-label', 'collapse');
41+
42+
const chartBtn = document.createElement('igc-icon-button');
43+
chartBtn.classList.add('additional-action');
44+
chartBtn.setAttribute('slot', 'actions');
45+
chartBtn.setAttribute('variant', 'flat');
46+
chartBtn.setAttribute('collection', 'material');
47+
chartBtn.setAttribute('name', 'chart');
48+
chartBtn.setAttribute('aria-label', 'chart');
49+
50+
const moreBtn = document.createElement('igc-icon-button');
51+
moreBtn.classList.add('additional-action');
52+
moreBtn.setAttribute('slot', 'actions');
53+
moreBtn.setAttribute('variant', 'flat');
54+
moreBtn.setAttribute('collection', 'material');
55+
moreBtn.setAttribute('name', 'more');
56+
moreBtn.setAttribute('aria-label', 'more');
57+
58+
tile.append(chartBtn);
59+
tile.append(moreBtn);
60+
} else {
61+
currentBtn.setAttribute('name', 'north_east');
62+
currentBtn.setAttribute('aria-label', 'expand');
63+
64+
const additionalButtons =
65+
actionsSlot.parentElement?.querySelectorAll('.additional-action');
66+
additionalButtons?.forEach((btn) => btn.remove());
67+
}
68+
}
69+
}
70+
};
71+
72+
private onCustomTwoClick = (event: React.MouseEvent) => {
73+
const tile = (event.currentTarget as HTMLElement).closest('igc-tile');
74+
75+
if (tile) {
76+
tile.maximized = !tile.maximized;
77+
78+
const currentBtn = event.currentTarget as HTMLElement;
79+
80+
if (currentBtn) {
81+
if (
82+
tile.maximized
83+
) {
84+
currentBtn.setAttribute('name', 'south_west');
85+
currentBtn.setAttribute('aria-label', 'collapse');
86+
}
87+
else {
88+
currentBtn.setAttribute('name', 'north_east');
89+
currentBtn.setAttribute('aria-label', 'expand');
90+
}
91+
}
92+
}
93+
};
94+
95+
public render(): JSX.Element {
96+
return (
97+
<div className="container sample center">
98+
<IgrTileManager id="tile-manager1" columnCount={2} gap="20px">
99+
<IgrTile>
100+
<h3 slot="title">Default Actions</h3>
101+
<p>This tile has default actions and title.</p>
102+
</IgrTile>
103+
<IgrTile disableFullscreen>
104+
<h3 slot="title">No Fullscreen Action</h3>
105+
<p>Fullscreen is disabled via property.</p>
106+
</IgrTile>
107+
<IgrTile disableFullscreen disableMaximize>
108+
<h3 slot="title">Custom Actions</h3>
109+
<IgrIconButton id="customOne" onClick={this.onCustomOneClick} slot="actions" variant="flat" collection="material" exportparts="icon" name="north_east"
110+
aria-label="north_east"></IgrIconButton>
111+
<p>Replace the default actions with custom ones, and include extra actions when the tile is maximized.</p>
112+
</IgrTile>
113+
<IgrTile disableFullscreen disableMaximize>
114+
<IgrIconButton id="customTwo" onClick={this.onCustomTwoClick} slot="actions" variant="flat" collection="material" exportparts="icon"
115+
name="north_east"></IgrIconButton>
116+
<p>Display only custom actions in the header.</p>
117+
</IgrTile>
118+
<IgrTile disableFullscreen disableMaximize>
119+
<h3 slot="title">Only title</h3>
120+
<p>Display only title in the header.</p>
121+
</IgrTile>
122+
<IgrTile disableFullscreen disableMaximize>
123+
<p>Content only.</p>
124+
</IgrTile>
125+
</IgrTileManager>
126+
</div>
127+
);
128+
}
129+
130+
}
131+
132+
// rendering above class to the React DOM
133+
const root = ReactDOM.createRoot(document.getElementById("root"));
134+
root.render(<Actions/>);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="react-scripts" />
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"compilerOptions": {
3+
"resolveJsonModule": true,
4+
"esModuleInterop": true,
5+
"baseUrl": ".",
6+
"outDir": "build/dist",
7+
"module": "esnext",
8+
"target": "es5",
9+
"lib": [
10+
"es6",
11+
"dom"
12+
],
13+
"sourceMap": true,
14+
"allowJs": true,
15+
"jsx": "react",
16+
"moduleResolution": "node",
17+
"rootDir": "src",
18+
"forceConsistentCasingInFileNames": true,
19+
"noImplicitReturns": true,
20+
"noImplicitThis": true,
21+
"noImplicitAny": true,
22+
"noUnusedLocals": false,
23+
"importHelpers": true,
24+
"allowSyntheticDefaultImports": true,
25+
"skipLibCheck": true,
26+
"strict": false,
27+
"isolatedModules": true,
28+
"noEmit": true
29+
},
30+
"exclude": [
31+
"node_modules",
32+
"build",
33+
"scripts",
34+
"acceptance-tests",
35+
"webpack",
36+
"jest",
37+
"src/setupTests.ts",
38+
"**/odatajs-4.0.0.js",
39+
"config-overrides.js"
40+
],
41+
"include": [
42+
"src"
43+
]
44+
}

0 commit comments

Comments
 (0)