Skip to content

Commit 6d7cac5

Browse files
authored
sample(splitter): add splitter samples (#1193)
1 parent 0587874 commit 6d7cac5

35 files changed

Lines changed: 1208 additions & 5 deletions

package-lock.json

Lines changed: 44 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"igniteui-grid-lite": "^0.6.0",
4747
"igniteui-i18n-resources": "^1.0.2",
4848
"igniteui-theming": "^25.0.0",
49-
"igniteui-webcomponents": "^7.0.0",
49+
"igniteui-webcomponents": "^7.1.0",
5050
"igniteui-webcomponents-charts": "7.0.0",
5151
"igniteui-webcomponents-core": "7.0.0",
5252
"igniteui-webcomponents-dashboards": "7.0.0",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"printWidth": 250,
3+
"tabWidth": 4,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": false,
7+
"trailingComma": "none",
8+
"bracketSpacing": true,
9+
"jsxBracketSameLine": false,
10+
"fluid": false
11+
}
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-wc-examples/tree/vnext/templates/browser/sample/ReadMe.md -->
3+
4+
This folder contains implementation of Web Components application with example of Base feature using [Splitter](https://infragistics.com/webcomponentssite/components/general-getting-started.html) component.
5+
6+
7+
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
8+
<body>
9+
<a target="_blank" href="https://infragistics.com/webcomponentssite/components/general-getting-started.html" rel="noopener noreferrer">
10+
<img height="40px" style="border-radius: 0rem" alt="View Docs" src="https://dl.infragistics.com/x/img/browsers/button-docs.png"/>
11+
</a>
12+
<a target="_blank" href="./src/index.ts" rel="noopener noreferrer">
13+
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="View Code" src="https://dl.infragistics.com/x/img/browsers/button-code.png"/>
14+
</a>
15+
<a target="_blank" href="https://www.infragistics.com/webcomponents-demos/samples/layouts/splitter/base" rel="noopener noreferrer">
16+
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="Run Sample" src="https://dl.infragistics.com/x/img/browsers/button-run.png"/>
17+
</a>
18+
<a target="_blank" href="https://codesandbox.io/s/github/IgniteUI/igniteui-wc-examples/tree/master/samples/layouts/splitter/base?fontsize=14&hidenavigation=1&theme=dark&view=preview&file=/src/{SampleFile}" rel="noopener noreferrer">
19+
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="Run Sample" src="https://dl.infragistics.com/x/img/browsers/button-sandbox.png"/>
20+
</a>
21+
</body>
22+
</html>
23+
24+
## Branches
25+
26+
> **_NOTE:_** You should use [master](https://github.com/IgniteUI/igniteui-angular-examples/tree/master) branch of this repository if you want to run samples on your computer. Use the [vnext](https://github.com/IgniteUI/igniteui-angular-examples/tree/vnext) branch only when you want to contribute new samples to this repository.
27+
28+
## Instructions
29+
30+
To set up this project locally, execute these commands:
31+
32+
```
33+
git clone https://github.com/IgniteUI/igniteui-wc-examples.git
34+
git checkout master
35+
cd ./igniteui-wc-examples
36+
cd ./samples/layouts/splitter/base
37+
```
38+
39+
open above folder in VS Code or type:
40+
```
41+
code .
42+
```
43+
44+
In terminal window, run:
45+
46+
```
47+
npm install
48+
npm run 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 Web Components**, check out the [Web Components documentation](https://infragistics.com/webcomponentssite/components/general-getting-started.html).
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Splitter Overview</title>
5+
<meta charset="UTF-8" />
6+
7+
<link rel="shortcut icon" href="https://dl.infragistics.com/x/img/browsers/wc.png" />
8+
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
9+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Kanit&display=swap" />
10+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium Web" />
11+
<link rel="stylesheet" href="https://dl.infragistics.com/x/css/samples/shared.v8.css" type="text/css" />
12+
</head>
13+
14+
<body>
15+
<div id="root">
16+
<div class="controls">
17+
<igc-switch id="orientationToggle">Make Splitter Vertical</igc-switch>
18+
<igc-switch id="disableCollapseToggle">Disable Collapse</igc-switch>
19+
<igc-switch id="disableResizeToggle">Disable Resize</igc-switch>
20+
<igc-switch id="hideDragHandleToggle">Hide Drag Handle</igc-switch>
21+
<igc-switch id="hideCollapseButtonsToggle">Hide Collapse Buttons</igc-switch>
22+
</div>
23+
<igc-splitter id="splitter" style="height: calc(100vh - 60px); width: 100%;">
24+
<div slot="start">
25+
<p>
26+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris in lacus eget turpis congue fermentum. Aliquam sollicitudin massa vel ullamcorper bibendum. Donec sit amet augue in justo fermentum facilisis vel quis quam. Vivamus eget iaculis nisi, vitae dignissim leo. Donec eget consectetur lacus. In viverra vehicula libero, quis dictum odio varius in. Phasellus aliquam elit et lectus ornare placerat. Aliquam vitae sapien facilisis, auctor enim quis, consectetur dui. Cras elementum velit eros, ut efficitur ante pellentesque in. Proin vulputate lacus dui, vitae imperdiet dui pharetra ac. Nunc sagittis, sapien et posuere varius, mauris justo tincidunt odio, in interdum lorem libero sed enim. Nulla placerat scelerisque felis vitae accumsan.
27+
</p>
28+
</div>
29+
<div slot="end">
30+
<p>
31+
Duis auctor, diam id vehicula consequat, lacus tellus molestie magna, sed varius nisi quam eget nisl. Donec dignissim mi et elementum laoreet. Nam dignissim quis justo eu fermentum. Proin vestibulum, neque quis elementum tincidunt, nibh mi gravida purus, eget volutpat ipsum magna in orci. Donec id mauris vitae lectus molestie blandit. Praesent non quam interdum, efficitur lacus nec, gravida mauris. Ut ac ante maximus, ultrices turpis a, aliquam magna. Praesent blandit ante ut nulla malesuada lobortis. Praesent a lobortis justo. Morbi congue, dui sed ornare faucibus, turpis felis vulputate arcu, lobortis posuere sem leo eget risus. Duis risus augue, dignissim ac tincidunt a, ullamcorper rutrum nisl. Ut ut ipsum vel purus viverra dapibus.
32+
</p>
33+
</div>
34+
</igc-splitter>
35+
</div>
36+
<!-- This script is needed only for parcel and it will be excluded for webpack -->
37+
<% if (false) { %>
38+
<script src="src/index.ts"></script>
39+
<% } %>
40+
</body>
41+
</html>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"name": "example-ignite-ui-web-components",
3+
"description": "This project provides example of using Ignite UI for Web Components",
4+
"author": "Infragistics",
5+
"version": "1.0.0",
6+
"license": "",
7+
"private": true,
8+
"homepage": ".",
9+
"main": "src/index.ts",
10+
"scripts": {
11+
"build": "npm run build:prod",
12+
"build:dev": "webpack --mode development --config ./webpack.config.js --progress --color --display-error-details",
13+
"build:prod": "webpack --env.NODE_ENV=production --mode production --config ./webpack.config.js --progress --color --display-error-details --bail",
14+
"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",
15+
"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/",
16+
"start": "npm run serve:dev",
17+
"build:legacy": "npm run build:prod:legacy",
18+
"build:dev:legacy": "webpack --env.legacy=true --mode development --config ./webpack.config.js --progress --color --display-error-details",
19+
"build:prod:legacy": "webpack --env.NODE_ENV=production --env.legacy=true --mode production --config ./webpack.config.js --progress --color --display-error-details --bail",
20+
"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",
21+
"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/",
22+
"start:legacy": "npm run serve:dev:legacy"
23+
},
24+
"dependencies": {
25+
"@webcomponents/custom-elements": "^1.4.1",
26+
"@webcomponents/template": "^1.4.2",
27+
"babel-runtime": "^6.26.0",
28+
"core-js": "^3.6.5",
29+
"igniteui-webcomponents": "^7.1.0",
30+
"lit": "^3.2.0",
31+
"lit-html": "^3.3.1",
32+
"tslib": "^2.8.1"
33+
},
34+
"devDependencies": {
35+
"@babel/cli": "^7.28.3",
36+
"@babel/core": "^7.28.4",
37+
"@babel/plugin-transform-class-properties": "^7.27.1",
38+
"@babel/plugin-transform-class-static-block": "^7.28.3",
39+
"@babel/plugin-transform-runtime": "^7.28.3",
40+
"@babel/preset-env": "^7.28.3",
41+
"@babel/preset-typescript": "^7.27.1",
42+
"@types/source-map": "^0.5.7",
43+
"babel-loader": "^10.0.0",
44+
"babel-plugin-transform-custom-element-classes": "^0.1.0",
45+
"css-loader": "^7.1.2",
46+
"csv-loader": "^3.0.5",
47+
"file-loader": "^6.2.0",
48+
"fork-ts-checker-webpack-plugin": "^9.1.0",
49+
"html-webpack-plugin": "^5.6.4",
50+
"parcel-bundler": "^1.12.5",
51+
"source-map": "^0.7.6",
52+
"style-loader": "^4.0.0",
53+
"tsconfig-paths-webpack-plugin": "^4.2.0",
54+
"typescript": "^5.9.2",
55+
"webpack": "^5.101.3",
56+
"webpack-cli": "^6.0.1",
57+
"webpack-dev-server": "^5.2.2",
58+
"worker-loader": "^3.0.8",
59+
"xml-loader": "^1.2.1"
60+
}
61+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"infiniteLoopProtection": false,
3+
"hardReloadOnChange": false,
4+
"view": "browser",
5+
"template": "parcel"
6+
}
7+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* shared styles are loaded from: */
2+
/* https://dl.infragistics.com/x/css/samples/shared.v8.css */
3+
.controls {
4+
display: flex;
5+
flex-wrap: wrap;
6+
gap: 16px;
7+
align-items: center;
8+
padding: 12px 16px;
9+
height: 60px;
10+
box-sizing: border-box;
11+
}
12+
13+
p {
14+
padding: 0 16px;
15+
}
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://dl.infragistics.com/x/css/samples/shared.v8.css */
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { defineComponents, IgcSplitterComponent, IgcSwitchComponent } from "igniteui-webcomponents";
2+
import "igniteui-webcomponents/themes/light/bootstrap.css";
3+
import "./SplitterOverview.css";
4+
5+
defineComponents(IgcSplitterComponent, IgcSwitchComponent);
6+
7+
export class SplitterOverview {
8+
private splitter: IgcSplitterComponent;
9+
10+
constructor() {
11+
this.splitter = document.getElementById("splitter") as IgcSplitterComponent;
12+
13+
document.getElementById("orientationToggle")!.addEventListener("igcChange", (e: Event) => {
14+
this.splitter.orientation = (e.target as IgcSwitchComponent).checked ? "vertical" : "horizontal";
15+
});
16+
17+
document.getElementById("disableCollapseToggle")!.addEventListener("igcChange", (e: Event) => {
18+
this.splitter.disableCollapse = (e.target as IgcSwitchComponent).checked;
19+
});
20+
21+
document.getElementById("disableResizeToggle")!.addEventListener("igcChange", (e: Event) => {
22+
this.splitter.disableResize = (e.target as IgcSwitchComponent).checked;
23+
});
24+
25+
document.getElementById("hideDragHandleToggle")!.addEventListener("igcChange", (e: Event) => {
26+
this.splitter.hideDragHandle = (e.target as IgcSwitchComponent).checked;
27+
});
28+
29+
document.getElementById("hideCollapseButtonsToggle")!.addEventListener("igcChange", (e: Event) => {
30+
this.splitter.hideCollapseButtons = (e.target as IgcSwitchComponent).checked;
31+
});
32+
}
33+
}
34+
35+
new SplitterOverview();

0 commit comments

Comments
 (0)