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

refactor(samples): updating wc styling samples #932

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
9 changes: 9 additions & 0 deletions browser/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@
<a class="nav-link" href="#" data-nav="/samples/grids/tree/basic-example">─<span>Basic Example</span></a>
<a class="nav-link" href="#" data-nav="/samples/grids/tree/load-on-demand">─<span>Load On Demand</span></a>
<a class="nav-link" href="#" data-nav="/samples/grids/tree/load-on-demand-virtualized">─<span>Load On Demand Virtualized</span></a>
<a class="nav-link" href="#" data-nav="/samples/grids/tree/styling">─<span>Styling</span></a>
</div>
<label id="nav-tree-grid" class="nav-component">Tree Grid</label>
<div id="nav-tree-grid-list" class="nav-list" state="collapsed">
Expand Down Expand Up @@ -779,6 +780,7 @@
<div id="nav-badge-list" class="nav-list" state="collapsed">
<a class="nav-link" href="#" data-nav="/samples/inputs/badge/outlined">─<span>Outlined</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/badge/shape">─<span>Shape</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/badge/styling">─<span>Styling</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/badge/variants">─<span>Variants</span></a>
</div>
<label id="nav-button" class="nav-component">Button</label>
Expand Down Expand Up @@ -807,6 +809,7 @@
<a class="nav-link" href="#" data-nav="/samples/inputs/checkbox/indeterminate">─<span>Indeterminate</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/checkbox/label">─<span>Label</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/checkbox/overview">─<span>Overview</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/checkbox/styling">─<span>Styling</span></a>
</div>
<label id="nav-chip" class="nav-component">Chip</label>
<div id="nav-chip-list" class="nav-list" state="collapsed">
Expand Down Expand Up @@ -842,6 +845,7 @@
<a class="nav-link" href="#" data-nav="/samples/inputs/date-time-input/min-max-value">─<span>Min Max Value</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/date-time-input/overview">─<span>Overview</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/date-time-input/step-up-down">─<span>Step Up Down</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/date-time-input/styling">─<span>Styling</span></a>
</div>
<label id="nav-dropdown" class="nav-component">Dropdown</label>
<div id="nav-dropdown-list" class="nav-list" state="collapsed">
Expand Down Expand Up @@ -879,6 +883,7 @@
<div id="nav-mask-input-list" class="nav-list" state="collapsed">
<a class="nav-link" href="#" data-nav="/samples/inputs/mask-input/applying-mask">─<span>Applying Mask</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/mask-input/overview">─<span>Overview</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/mask-input/styling">─<span>Styling</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/mask-input/value-modes">─<span>Value Modes</span></a>
</div>
<label id="nav-radio" class="nav-component">Radio</label>
Expand Down Expand Up @@ -930,6 +935,7 @@
<a class="nav-link" href="#" data-nav="/samples/inputs/switches/disabled">─<span>Disabled</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/switches/label">─<span>Label</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/switches/overview">─<span>Overview</span></a>
<a class="nav-link" href="#" data-nav="/samples/inputs/switches/styling">─<span>Styling</span></a>
</div>
<label id="nav-textarea" class="nav-component">Textarea</label>
<div id="nav-textarea-list" class="nav-list" state="collapsed">
Expand All @@ -954,6 +960,7 @@
<a class="nav-link" href="#" data-nav="/samples/layouts/avatar/initials">─<span>Initials</span></a>
<a class="nav-link" href="#" data-nav="/samples/layouts/avatar/shape">─<span>Shape</span></a>
<a class="nav-link" href="#" data-nav="/samples/layouts/avatar/size">─<span>Size</span></a>
<a class="nav-link" href="#" data-nav="/samples/layouts/avatar/styling">─<span>Styling</span></a>
</div>
<label id="nav-card" class="nav-component">Card</label>
<div id="nav-card-list" class="nav-list" state="collapsed">
Expand Down Expand Up @@ -1012,13 +1019,15 @@
<a class="nav-link" href="#" data-nav="/samples/layouts/stepper/orientation">─<span>Orientation</span></a>
<a class="nav-link" href="#" data-nav="/samples/layouts/stepper/overview">─<span>Overview</span></a>
<a class="nav-link" href="#" data-nav="/samples/layouts/stepper/steptypes">─<span>Steptypes</span></a>
<a class="nav-link" href="#" data-nav="/samples/layouts/stepper/styling">─<span>Styling</span></a>
</div>
<label id="nav-tabs" class="nav-component">Tabs</label>
<div id="nav-tabs-list" class="nav-list" state="collapsed">
<a class="nav-link" href="#" data-nav="/samples/layouts/tabs/alignment">─<span>Alignment</span></a>
<a class="nav-link" href="#" data-nav="/samples/layouts/tabs/overview">─<span>Overview</span></a>
<a class="nav-link" href="#" data-nav="/samples/layouts/tabs/prefix-suffix">─<span>Prefix Suffix</span></a>
<a class="nav-link" href="#" data-nav="/samples/layouts/tabs/scrolling">─<span>Scrolling</span></a>
<a class="nav-link" href="#" data-nav="/samples/layouts/tabs/styling">─<span>Styling</span></a>
</div>

<div class="nav-group">MAPS</div>
Expand Down
18 changes: 7 additions & 11 deletions samples/grids/list/styling/src/ListStyling.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
igc-list-header {
font-size: 20px;
font-weight: 700;
color: #3f51b5;
font-size: 20px;
font-weight: 700;
color: var(--ig-primary-700);
}

igc-list-item::part(title) {
font-size: 18px;
color: #3f51b5;
font-size: 18px;
color: var(--ig-primary-600);
}

igc-list-item::part(subtitle) {
color: #0099ff;
}

igc-list-item::part(end) {
--ig-secondary-500: 230,48%,47%;
}
color: var(--ig-primary-300);
}
11 changes: 11 additions & 0 deletions samples/grids/tree/styling/.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
}
56 changes: 56 additions & 0 deletions samples/grids/tree/styling/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!-- NOTE: do not change this file because it's auto re-generated from template: -->
<!-- https://github.com/IgniteUI/igniteui-wc-examples/tree/vnext/templates/browser/sample/ReadMe.md -->

This folder contains implementation of Web Components application with example of Styling feature using [Tree](https://infragistics.com/webcomponentssite/components/general-getting-started.html) component.


<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<body>
<a target="_blank" href="https://infragistics.com/webcomponentssite/components/general-getting-started.html" rel="noopener noreferrer">
<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"/>
</a>
<a target="_blank" href="./src/index.ts" rel="noopener noreferrer">
<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"/>
</a>
<a target="_blank" href="https://www.infragistics.com/webcomponents-demos/samples/grids/tree/styling" rel="noopener noreferrer">
<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"/>
</a>
<a target="_blank" href="https://codesandbox.io/s/github/IgniteUI/igniteui-wc-examples/tree/master/samples/grids/tree/styling?fontsize=14&hidenavigation=1&theme=dark&view=preview&file=/src/{SampleFile}" rel="noopener noreferrer">
<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"/>
</a>
</body>
</html>

## Branches

> **_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.

## Instructions

To set up this project locally, execute these commands:

```
git clone https://github.com/IgniteUI/igniteui-wc-examples.git
git checkout master
cd ./igniteui-wc-examples
cd ./samples/grids/tree/styling
```

open above folder in VS Code or type:
```
code .
```

In terminal window, run:

```
npm install
npm run start
```

Then open http://localhost:4200/ in your browser


## Learn More

To learn more about **Ignite UI for Web Components**, check out the [Web Components documentation](https://infragistics.com/webcomponentssite/components/general-getting-started.html).
39 changes: 39 additions & 0 deletions samples/grids/tree/styling/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<title>Tree Styling Example</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" type="text/css" />
</head>

<body>
<div id="root">
<div class="container sample">
<igc-tree>
<igc-tree-item label="North America">
<igc-tree-item label="United States"></igc-tree-item>
<igc-tree-item label="Canada"></igc-tree-item>
<igc-tree-item label="Mexico"></igc-tree-item>
</igc-tree-item>
<igc-tree-item label="South America">
<igc-tree-item label="Brazil"></igc-tree-item>
<igc-tree-item label="Uruguay"></igc-tree-item>
</igc-tree-item>
<igc-tree-item label="Europe">
<igc-tree-item label="United Kingdom"></igc-tree-item>
<igc-tree-item label="Germany"></igc-tree-item>
<igc-tree-item label="Bulgaria"></igc-tree-item>
</igc-tree-item>
</igc-tree>
</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>
59 changes: 59 additions & 0 deletions samples/grids/tree/styling/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "wc-tree-basic",
"version": "1.0.0",
"description": "This project provides example of Tree using IgniteUI for Web Components",
"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"
},
"author": "Infragistics",
"dependencies": {
"@webcomponents/custom-elements": "^1.4.1",
"@webcomponents/template": "^1.4.2",
"babel-runtime": "^6.26.0",
"core-js": "^3.6.5",
"igniteui-webcomponents": "5.2.1",
"lit": "^3.2.0",
"lit-html": "^3.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.96.1",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1",
"worker-loader": "^3.0.8",
"xml-loader": "^1.2.1"
},
"license": "",
"homepage": "."
}
7 changes: 7 additions & 0 deletions samples/grids/tree/styling/sandbox.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"infiniteLoopProtection": false,
"hardReloadOnChange": false,
"view": "browser",
"template": "parcel"
}

4 changes: 4 additions & 0 deletions samples/grids/tree/styling/src/TreeBasic.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
igc-tree-item::part(active) {
background: var(--ig-secondary-500);
color: var(--ig-secondary-500-contrast);
}
2 changes: 2 additions & 0 deletions samples/grids/tree/styling/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* shared styles are loaded from: */
/* https://static.infragistics.com/xplatform/css/samples */
11 changes: 11 additions & 0 deletions samples/grids/tree/styling/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineComponents, IgcTreeComponent } from "igniteui-webcomponents";
import "igniteui-webcomponents/themes/light/bootstrap.css";
import "./TreeBasic.css";

defineComponents(IgcTreeComponent);
export class TreeStyling {
constructor() {
}
}

new TreeStyling();
5 changes: 5 additions & 0 deletions samples/grids/tree/styling/src/layout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
igc-tree {
width: 320px;
max-height: 360px;
overflow-y: auto;
}
20 changes: 20 additions & 0 deletions samples/grids/tree/styling/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"noImplicitReturns": true,
"esModuleInterop": true,
"noImplicitAny": true,
"declarationDir": "dist/types",
"moduleResolution": "node",
"declaration": true,
"target": "es2015",
"module": "es2015",
"strict": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"dist"
]
}
Loading