Skip to content

Commit c5916de

Browse files
Merge pull request #795 from IgniteUI/ikitanov/divider-samples
Adding Divider Samples
2 parents d3eb62b + d630c74 commit c5916de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1555
-0
lines changed
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 Overview feature using [Select](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://github.com/IgniteUI/igniteui-blazor-examples/raw/vnext/templates/sample/images/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://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/webcomponents-demos/samples/inputs/select/overview" 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-wc-examples/tree/master/samples/inputs/select/overview?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://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-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/inputs/select/overview
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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Divider Base</title>
5+
<meta charset="UTF-8" />
6+
7+
<link rel="shortcut icon" href="https://static.infragistics.com/xplatform/images/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://static.infragistics.com/xplatform/css/samples/shared.v6.css" type="text/css" />
12+
</head>
13+
14+
<body>
15+
<div id="root">
16+
<div class="container sample center">
17+
<p>First paragraph</p>
18+
<igc-divider></igc-divider>
19+
<p>Second paragraph</p>
20+
</div>
21+
</div>
22+
<!-- This script is needed only for parcel and it will be excluded for webpack -->
23+
<% if (false) { %><script src="src/index.ts"></script><% } %>
24+
25+
</body>
26+
</html>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "wc-select-overview",
3+
"version": "1.0.0",
4+
"description": "This project provides example of Select overview using IgniteUI for Web Components",
5+
"main": "src/index.ts",
6+
"scripts": {
7+
"build": "npm run build:prod",
8+
"build:dev": "webpack --mode development --config ./webpack.config.js --progress --color --display-error-details",
9+
"build:prod": "webpack --env.NODE_ENV=production --mode production --config ./webpack.config.js --progress --color --display-error-details --bail",
10+
"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",
11+
"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/",
12+
"start": "npm run serve:dev",
13+
"build:legacy": "npm run build:prod:legacy",
14+
"build:dev:legacy": "webpack --env.legacy=true --mode development --config ./webpack.config.js --progress --color --display-error-details",
15+
"build:prod:legacy": "webpack --env.NODE_ENV=production --env.legacy=true --mode production --config ./webpack.config.js --progress --color --display-error-details --bail",
16+
"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",
17+
"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/",
18+
"start:legacy": "npm run serve:dev:legacy"
19+
},
20+
"author": "Infragistics",
21+
"dependencies": {
22+
"@webcomponents/custom-elements": "^1.4.1",
23+
"@webcomponents/template": "^1.4.2",
24+
"babel-runtime": "^6.26.0",
25+
"core-js": "^3.6.5",
26+
"igniteui-webcomponents": "4.11.1",
27+
"lit": "^2.0.2",
28+
"lit-html": "^2.2.0",
29+
"tslib": "^2.0.0"
30+
},
31+
"devDependencies": {
32+
"@babel/cli": "^7.8.3",
33+
"@babel/core": "^7.8.3",
34+
"@babel/plugin-proposal-class-properties": "^7.8.3",
35+
"@babel/plugin-transform-runtime": "^7.10.0",
36+
"@babel/preset-env": "^7.8.3",
37+
"@babel/preset-typescript": "^7.8.3",
38+
"@types/source-map": "^0.5.7",
39+
"babel-loader": "^8.1.0",
40+
"babel-plugin-transform-custom-element-classes": "^0.1.0",
41+
"css-loader": "^1.0.0",
42+
"csv-loader": "^3.0.2",
43+
"file-loader": "^4.2.0",
44+
"fork-ts-checker-webpack-plugin": "^4.1.5",
45+
"html-webpack-plugin": "^4.3.0",
46+
"parcel-bundler": "^1.6.1",
47+
"source-map": "^0.7.3",
48+
"style-loader": "^0.22.1",
49+
"tsconfig-paths-webpack-plugin": "^4.0.0",
50+
"typescript": "^4.4.4",
51+
"webpack": "^5.74.0",
52+
"webpack-cli": "^4.10.0",
53+
"webpack-dev-server": "^4.11.1",
54+
"worker-loader": "^3.0.8",
55+
"xml-loader": "^1.2.1"
56+
},
57+
"license": "",
58+
"homepage": "."
59+
}
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: 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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineComponents, IgcDividerComponent } from 'igniteui-webcomponents';
2+
import 'igniteui-webcomponents/themes/light/bootstrap.css';
3+
4+
defineComponents(IgcDividerComponent);
5+
6+
export class SelectOverview {
7+
constructor() {
8+
}
9+
}
10+
11+
new SelectOverview();
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"noImplicitReturns": true,
4+
"esModuleInterop": true,
5+
"noImplicitAny": true,
6+
"declarationDir": "dist/types",
7+
"moduleResolution": "node",
8+
"declaration": true,
9+
"target": "es2015",
10+
"module": "es2015",
11+
"strict": true
12+
},
13+
"include": [
14+
"src/**/*"
15+
],
16+
"exclude": [
17+
"node_modules",
18+
"dist"
19+
]
20+
}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
2+
const HtmlWebpackPlugin = require('html-webpack-plugin');
3+
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
4+
const path = require('path');
5+
const webpack = require('webpack');
6+
7+
module.exports = env => {
8+
const nodeEnv = process.env.NODE_ENV || 'development';
9+
const isProd = nodeEnv === 'production';
10+
const isLegacy = !!process.env.legacy && !(process.env.legacy == "false");
11+
console.log(">> webpack nodeEnv=" + nodeEnv);
12+
console.log(">> webpack isProd=" + isProd);
13+
console.log(">> webpack isLegacy=" + isLegacy);
14+
const presets = [
15+
["@babel/preset-env", {
16+
"useBuiltIns": "usage",
17+
"corejs": 3,
18+
"targets": {
19+
"browsers": isLegacy ? ["defaults"] : [
20+
"last 2 Chrome versions",
21+
"last 2 Safari versions",
22+
"last 2 iOS versions",
23+
"last 2 Firefox versions",
24+
"last 2 Edge versions"]
25+
}
26+
}],
27+
"@babel/preset-typescript"
28+
];
29+
30+
return {
31+
entry: isLegacy ? [
32+
path.resolve(__dirname, 'node_modules/@webcomponents/custom-elements'),
33+
path.resolve(__dirname, 'node_modules/@webcomponents/template'),
34+
path.resolve(__dirname, 'src')
35+
] : path.resolve(__dirname, 'src'),
36+
devtool: isProd ? false : 'source-map',
37+
output: {
38+
filename: isProd ? '[fullhash].bundle.js' : '[fullhash].bundle.js',
39+
globalObject: 'this',
40+
path: path.resolve(__dirname, 'dist'),
41+
},
42+
43+
resolve: {
44+
mainFields: ['esm2015', 'module', 'main'],
45+
extensions: ['.ts', '.js', '.json'],
46+
plugins: [new TsconfigPathsPlugin({
47+
configFile: './tsconfig.json',
48+
extensions: ['.ts', '.js'],
49+
mainFields: ['esm2015', 'module', 'main']
50+
})]
51+
},
52+
53+
module: {
54+
rules: [
55+
{ test: /\.(png|svg|jpg|gif)$/, use: ['file-loader'] },
56+
{ test: /\.(csv|tsv)$/, use: ['csv-loader'] },
57+
{ test: /\.xml$/, use: ['xml-loader'] },
58+
{ test: /\.css$/, sideEffects: true, use: ['style-loader', 'css-loader'] },
59+
{
60+
test: /worker\.(ts|js)$/,
61+
use: [
62+
{ loader: 'worker-loader' },
63+
{
64+
loader: 'babel-loader', options: {
65+
"compact": isProd ? true : false,
66+
"presets": presets,
67+
"plugins": [
68+
"@babel/plugin-proposal-class-properties",
69+
"@babel/plugin-transform-runtime"
70+
]
71+
}
72+
}
73+
]
74+
},
75+
{
76+
test: /\.(ts|js)$/, loader: 'babel-loader',
77+
options: {
78+
"compact": isProd ? true : false,
79+
"presets": presets,
80+
"plugins": [
81+
"@babel/plugin-proposal-class-properties",
82+
"@babel/plugin-transform-runtime"
83+
]
84+
},
85+
exclude:
86+
function (modulePath) {
87+
return /node_modules/.test(modulePath) &&
88+
!/igniteui-webcomponents/.test(modulePath) &&
89+
!/lit-html/.test(modulePath);
90+
}
91+
}],
92+
},
93+
94+
plugins: [
95+
new webpack.DefinePlugin({
96+
'process.env.NODE_ENV': JSON.stringify(nodeEnv)
97+
}),
98+
new HtmlWebpackPlugin({
99+
title: 'for-cs',
100+
template: 'index.html'
101+
}),
102+
new ForkTsCheckerWebpackPlugin()
103+
]
104+
};
105+
};
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+
}

0 commit comments

Comments
 (0)