diff --git a/samples/charts/data-chart/user-annotation-layer/.prettierrc b/samples/charts/data-chart/user-annotation-layer/.prettierrc new file mode 100644 index 000000000..15a7c7c6c --- /dev/null +++ b/samples/charts/data-chart/user-annotation-layer/.prettierrc @@ -0,0 +1,11 @@ +{ + "printWidth": 250, + "tabWidth": 4, + "useTabs": false, + "semi": true, + "singleQuote": false, + "trailingComma": "none", + "bracketSpacing": true, + "jsxBracketSameLine": false, + "fluid": false +} \ No newline at end of file diff --git a/samples/charts/data-chart/user-annotation-layer/ReadMe.md b/samples/charts/data-chart/user-annotation-layer/ReadMe.md new file mode 100644 index 000000000..d013f37d4 --- /dev/null +++ b/samples/charts/data-chart/user-annotation-layer/ReadMe.md @@ -0,0 +1,56 @@ + + + +This folder contains implementation of Web Components application with example of Actions Built In Data Chart feature using [Toolbar](https://infragistics.com/webcomponentssite/components/general-getting-started.html) component. + + + + + + View Docs + + + View Code + + + Run Sample + + + Run Sample + + + + +## 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/charts/toolbar/actions-built-in-data-chart +``` + +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). diff --git a/samples/charts/data-chart/user-annotation-layer/index.html b/samples/charts/data-chart/user-annotation-layer/index.html new file mode 100644 index 000000000..ba5326888 --- /dev/null +++ b/samples/charts/data-chart/user-annotation-layer/index.html @@ -0,0 +1,74 @@ + + + + Sample | Ignite UI | Web Components | infragistics + + + + + + + + + + + + +
+
+ +
+
+ + +
+
+ +
+ + + + + + + + + + + + + +
+
+ + +
+ +
+ + +
+ +
+ + + + + +
+ +
+ + +
+
+
+
+ +
+ + + <% if (false) { %><% } %> + + \ No newline at end of file diff --git a/samples/charts/data-chart/user-annotation-layer/package.json b/samples/charts/data-chart/user-annotation-layer/package.json new file mode 100644 index 000000000..b06d5ae51 --- /dev/null +++ b/samples/charts/data-chart/user-annotation-layer/package.json @@ -0,0 +1,61 @@ +{ + "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": { + "babel-runtime": "^6.26.0", + "igniteui-webcomponents": "^6.3.6", + "igniteui-webcomponents-charts": "6.3.0-beta.0", + "igniteui-webcomponents-core": "6.3.0-beta.0", + "igniteui-webcomponents-inputs": "6.3.0-beta.0", + "igniteui-webcomponents-layouts": "6.3.0-beta.0", + "lit-html": "^3.3.1", + "tslib": "^2.8.1" + }, + "devDependencies": { + "@babel/cli": "^7.28.3", + "@babel/core": "^7.28.4", + "@babel/plugin-transform-class-properties": "^7.27.1", + "@babel/plugin-transform-class-static-block": "^7.28.3", + "@babel/plugin-transform-runtime": "^7.28.3", + "@babel/preset-env": "^7.28.3", + "@babel/preset-typescript": "^7.27.1", + "@types/source-map": "^0.5.7", + "babel-loader": "^10.0.0", + "babel-plugin-transform-custom-element-classes": "^0.1.0", + "css-loader": "^7.1.2", + "csv-loader": "^3.0.5", + "file-loader": "^6.2.0", + "fork-ts-checker-webpack-plugin": "^9.1.0", + "html-webpack-plugin": "^5.6.4", + "parcel-bundler": "^1.12.5", + "source-map": "^0.7.6", + "style-loader": "^4.0.0", + "tsconfig-paths-webpack-plugin": "^4.2.0", + "typescript": "^5.9.2", + "webpack": "^5.101.3", + "webpack-cli": "^6.0.1", + "webpack-dev-server": "^5.2.2", + "worker-loader": "^3.0.8", + "xml-loader": "^1.2.1" + } +} diff --git a/samples/charts/data-chart/user-annotation-layer/sandbox.config.json b/samples/charts/data-chart/user-annotation-layer/sandbox.config.json new file mode 100644 index 000000000..52c787510 --- /dev/null +++ b/samples/charts/data-chart/user-annotation-layer/sandbox.config.json @@ -0,0 +1,6 @@ +{ + "infiniteLoopProtection": false, + "hardReloadOnChange": false, + "view": "browser", + "template": "parcel" +} \ No newline at end of file diff --git a/samples/charts/data-chart/user-annotation-layer/src/CountryRenewableElectricity.ts b/samples/charts/data-chart/user-annotation-layer/src/CountryRenewableElectricity.ts new file mode 100644 index 000000000..21a29ab22 --- /dev/null +++ b/samples/charts/data-chart/user-annotation-layer/src/CountryRenewableElectricity.ts @@ -0,0 +1,34 @@ +export class CountryRenewableElectricityItem { + public constructor(init: Partial) { + Object.assign(this, init); + } + + public year: string; + public europe: number; + public china: number; + public america: number; + +} +export class CountryRenewableElectricity extends Array { + public constructor(items: Array | number = -1) { + if (Array.isArray(items)) { + super(...items); + } else { + const newItems = [ + new CountryRenewableElectricityItem({ year: `2009`, europe: 34, china: 21, america: 19 }), + new CountryRenewableElectricityItem({ year: `2010`, europe: 43, china: 26, america: 24 }), + new CountryRenewableElectricityItem({ year: `2011`, europe: 66, china: 29, america: 28 }), + new CountryRenewableElectricityItem({ year: `2012`, europe: 69, china: 32, america: 26 }), + new CountryRenewableElectricityItem({ year: `2013`, europe: 58, china: 47, america: 38 }), + new CountryRenewableElectricityItem({ year: `2014`, europe: 40, china: 46, america: 31 }), + new CountryRenewableElectricityItem({ year: `2015`, europe: 78, china: 50, america: 19 }), + new CountryRenewableElectricityItem({ year: `2016`, europe: 13, china: 90, america: 52 }), + new CountryRenewableElectricityItem({ year: `2017`, europe: 78, china: 132, america: 50 }), + new CountryRenewableElectricityItem({ year: `2018`, europe: 40, china: 134, america: 34 }), + new CountryRenewableElectricityItem({ year: `2018`, europe: 40, china: 134, america: 34 }), + new CountryRenewableElectricityItem({ year: `2019`, europe: 80, china: 96, america: 38 }), + ]; + super(...newItems.slice(0)); + } + } +} diff --git a/samples/charts/data-chart/user-annotation-layer/src/index.css b/samples/charts/data-chart/user-annotation-layer/src/index.css new file mode 100644 index 000000000..c32768340 --- /dev/null +++ b/samples/charts/data-chart/user-annotation-layer/src/index.css @@ -0,0 +1,36 @@ +/* shared styles are loaded from: */ +/* https://static.infragistics.com/xplatform/css/samples */ + +.aboveContentSplit { + display: flex; + flex-direction: row; +} +.aboveContentLeftContainer { + margin-left: 1.25rem; + display: flex; + flex-grow: 1; + justify-content: flex-start; + align-items: flex-end; +} +.aboveContentRightContainer { + margin-right: 1.25rem; + display: flex; + flex-grow: 1; + justify-content: flex-end; + align-items: flex-end; +} + +.annotationPopup { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 20%; + height: 350px; + background-color: white; + border: 1px black solid; + display: none; + border-radius: 5px; + padding-left: 10px; + padding-right: 10px; +} diff --git a/samples/charts/data-chart/user-annotation-layer/src/index.ts b/samples/charts/data-chart/user-annotation-layer/src/index.ts new file mode 100644 index 000000000..76166bd29 --- /dev/null +++ b/samples/charts/data-chart/user-annotation-layer/src/index.ts @@ -0,0 +1,137 @@ +import { IgcToolbarModule } from 'igniteui-webcomponents-layouts'; +import { IgcDataChartToolbarModule, IgcDataChartCoreModule, IgcDataChartCategoryModule, IgcDataChartAnnotationModule, IgcDataChartInteractivityModule, IgcAnnotationLayerProxyModule, IgcDataChartCategoryTrendLineModule, IgcUserAnnotationInformation } from 'igniteui-webcomponents-charts'; +import { IgcToolbarComponent } from 'igniteui-webcomponents-layouts'; +import { IgcDataChartComponent, IgcCategoryXAxisComponent, IgcNumericYAxisComponent, IgcLineSeriesComponent, + IgcSeriesViewerComponent, IgcUserAnnotationInformationEventArgs, + IgcUserAnnotationToolTipContentUpdatingEventArgs } from 'igniteui-webcomponents-charts'; +import { CountryRenewableElectricity } from './CountryRenewableElectricity'; +import { defineComponents, IgcInputComponent, IgcTextareaComponent } from 'igniteui-webcomponents'; +import { IgcColorEditorComponent, IgcColorEditorModule } from 'igniteui-webcomponents-inputs'; + +import { ModuleManager } from 'igniteui-webcomponents-core'; +import "./index.css"; +import "igniteui-webcomponents/themes/light/bootstrap.css"; + +defineComponents(IgcTextareaComponent, IgcInputComponent); + +ModuleManager.register( + IgcToolbarModule, + IgcDataChartToolbarModule, + IgcDataChartCoreModule, + IgcDataChartCategoryModule, + IgcDataChartAnnotationModule, + IgcDataChartInteractivityModule, + IgcAnnotationLayerProxyModule, + IgcDataChartCategoryTrendLineModule, + IgcColorEditorModule +); + +export class Sample { + private chart: IgcDataChartComponent + private xAxis: IgcCategoryXAxisComponent + private yAxis: IgcNumericYAxisComponent + private annotationInput: IgcInputComponent; + private annotationTextArea: IgcTextareaComponent; + private annotationBadgeColorEditor: IgcColorEditorComponent; + private annotationMainColorEditor: IgcColorEditorComponent; + private currentAnnotationInfo: IgcUserAnnotationInformation; + + private _bind: () => void; + + constructor() { + var toolbar = document.getElementById('toolbar') as IgcToolbarComponent; + this.chart = document.getElementById('chart') as IgcDataChartComponent; + this.xAxis = document.getElementById('xAxis') as IgcCategoryXAxisComponent; + this.yAxis = document.getElementById('yAxis') as IgcNumericYAxisComponent; + var lineSeries1 = document.getElementById('lineSeries1') as IgcLineSeriesComponent; + var lineSeries2 = document.getElementById('lineSeries2') as IgcLineSeriesComponent; + var lineSeries3 = document.getElementById('lineSeries3') as IgcLineSeriesComponent; + this.annotationInput = document.getElementById('annotationInput') as IgcInputComponent; + this.annotationTextArea = document.getElementById('annotationTextArea') as IgcTextareaComponent; + this.annotationMainColorEditor = document.getElementById('annotationMainColorEditor') as IgcColorEditorComponent; + this.annotationBadgeColorEditor = document.getElementById('annotationBadgeColorEditor') as IgcColorEditorComponent; + + var doneButton = document.getElementById('doneButton') as HTMLButtonElement; + var cancelButton = document.getElementById('cancelButton') as HTMLButtonElement; + + this.chart.userAnnotationInformationRequested = this.onUserAnnotationInformationRequested.bind(this); + this.chart.userAnnotationToolTipContentUpdating = this.onUserAnnotationToolTipContentUpdating.bind(this); + + doneButton.onclick = this.onDoneBtnClick.bind(this); + cancelButton.onclick = this.onCancelBtnClick.bind(this); + + this._bind = () => { + toolbar.target = this.chart; + this.xAxis.dataSource = this.countryRenewableElectricity; + lineSeries1.xAxis = this.xAxis; + lineSeries1.yAxis = this.yAxis; + lineSeries1.dataSource = this.countryRenewableElectricity; + lineSeries2.xAxis = this.xAxis; + lineSeries2.yAxis = this.yAxis; + lineSeries2.dataSource = this.countryRenewableElectricity; + lineSeries3.xAxis = this.xAxis; + lineSeries3.yAxis = this.yAxis; + lineSeries3.dataSource = this.countryRenewableElectricity; + } + + this._bind(); + } + + public onUserAnnotationInformationRequested(s: IgcSeriesViewerComponent, e: IgcUserAnnotationInformationEventArgs){ + this.currentAnnotationInfo = e.annotationInfo; + this.toggleDialogState(true); + } + + public onUserAnnotationToolTipContentUpdating(s: IgcSeriesViewerComponent, e: IgcUserAnnotationToolTipContentUpdatingEventArgs) { + var tooltipText = e.annotationInfo.annotationData; + + if (e.content.children.length == 0) { + var element = document.createElement("div"); + element.textContent = tooltipText; + e.content.appendChild(element); + } + else { + var element: HTMLDivElement = e.content.children[0]; + element.textContent = tooltipText; + } + } + + public onDoneBtnClick() { + + this.currentAnnotationInfo.label = this.annotationInput.value; + this.currentAnnotationInfo.annotationData = this.annotationTextArea.value; + this.currentAnnotationInfo.mainColor = this.annotationMainColorEditor.value; + this.currentAnnotationInfo.badgeColor = this.annotationBadgeColorEditor.value; + + this.chart.finishAnnotationFlow(this.currentAnnotationInfo); + this.toggleDialogState(false); + } + + public onCancelBtnClick(){ + this.chart.cancelAnnotationFlow(this.currentAnnotationInfo.annotationId); + this.toggleDialogState(false); + } + + public toggleDialogState(open: boolean) : void{ + var popup = document.getElementsByClassName('annotationPopup')[0] as HTMLDivElement; + + if(open){ + popup.style.display = "block"; + } + else{ + popup.style.display = "none"; + } + } + + private _countryRenewableElectricity: CountryRenewableElectricity = null; + public get countryRenewableElectricity(): CountryRenewableElectricity { + if (this._countryRenewableElectricity == null) + { + this._countryRenewableElectricity = new CountryRenewableElectricity(); + } + return this._countryRenewableElectricity; + } + +} + +new Sample(); diff --git a/samples/charts/data-chart/user-annotation-layer/tsconfig.json b/samples/charts/data-chart/user-annotation-layer/tsconfig.json new file mode 100644 index 000000000..e7c370def --- /dev/null +++ b/samples/charts/data-chart/user-annotation-layer/tsconfig.json @@ -0,0 +1,41 @@ +{ + "compilerOptions": { + "noImplicitReturns": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "noImplicitAny": true, + "declarationDir": "dist/types", + "moduleResolution": "node", + "declaration": true, + "target": "es2015", + "module": "es2015", + "strict": true, + "strictNullChecks": false, + "baseUrl": ".", + "paths": { + "igniteui-webcomponents-core": [ "node_modules/igniteui-webcomponents-core", "node_modules/@infragistics/igniteui-webcomponents-core" ], + "igniteui-webcomponents-charts": [ "node_modules/igniteui-webcomponents-charts", "node_modules/@infragistics/igniteui-webcomponents-charts" ], + "igniteui-webcomponents-gauges": [ "node_modules/igniteui-webcomponents-gauges", "node_modules/@infragistics/igniteui-webcomponents-gauges" ], + "igniteui-webcomponents-datasources": [ "node_modules/igniteui-webcomponents-datasources", "node_modules/@infragistics/igniteui-webcomponents-datasources" ], + "igniteui-webcomponents-excel": [ "node_modules/igniteui-webcomponents-excel", "node_modules/@infragistics/igniteui-webcomponents-excel" ], + "igniteui-webcomponents-inputs": [ "node_modules/igniteui-webcomponents-inputs", "node_modules/@infragistics/igniteui-webcomponents-inputs" ], + "igniteui-webcomponents-grids": [ "node_modules/igniteui-webcomponents-grids", "node_modules/@infragistics/igniteui-webcomponents-grids" ], + "igniteui-webcomponents-maps": [ "node_modules/igniteui-webcomponents-maps", "node_modules/@infragistics/igniteui-webcomponents-maps" ], + "igniteui-webcomponents-spreadsheet": [ "node_modules/igniteui-webcomponents-spreadsheet", "node_modules/@infragistics/igniteui-webcomponents-spreadsheet" ], + "igniteui-webcomponents-spreadsheet-chart-adapter": [ "node_modules/igniteui-webcomponents-spreadsheet-chart-adapter", "node_modules/@infragistics/igniteui-webcomponents-spreadsheet-chart-adapter" ], + "igniteui-webcomponents-grids/*": [ "node_modules/igniteui-webcomponents-grids/*", "node_modules/@infragistics/igniteui-webcomponents-grids/*" ], + "igniteui-webcomponents-grids/grids": [ "node_modules/igniteui-webcomponents-grids/grids", "node_modules/@infragistics/igniteui-webcomponents-grids/grids" ], + "igniteui-webcomponents-grids/grids/*": [ "node_modules/igniteui-webcomponents-grids/grids/*", "node_modules/@infragistics/igniteui-webcomponents-grids/grids/*" ], + "igniteui-webcomponents-grids/grids/combined": [ "node_modules/igniteui-webcomponents-grids/grids/combined", "node_modules/@infragistics/igniteui-webcomponents-grids/grids/combined" ], + "igniteui-webcomponents-layouts": [ "node_modules/igniteui-webcomponents-layouts", "node_modules/@infragistics/igniteui-webcomponents-layouts" ], + "igniteui-webcomponents-dashboards": [ "node_modules/igniteui-webcomponents-dashboards", "node_modules/@infragistics/igniteui-webcomponents-dashboards" ] + } + }, + "include": [ + "src/**/*" + ], + "exclude": [ + "node_modules", + "dist" + ] +} \ No newline at end of file diff --git a/samples/charts/data-chart/user-annotation-layer/tslint.json b/samples/charts/data-chart/user-annotation-layer/tslint.json new file mode 100644 index 000000000..e3b56e93a --- /dev/null +++ b/samples/charts/data-chart/user-annotation-layer/tslint.json @@ -0,0 +1,54 @@ +{ + "extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"], + "linterOptions": { + "exclude": [ + "node_modules/**/*.ts", + "**/odatajs-4.0.0.js", + "src/images/*.*" + ] + }, + "rules": { + "curly": [false, "ignore-same-line"], + "jsx-no-lambda": false, + "jsx-self-close": false, + "jsx-wrap-multiline": false, + "max-classes-per-file": [true, 10], + "member-ordering": false, + "no-console": false, + "no-string-literal": false, + "no-unused-vars": false, + "no-useless-constructor": false, + "no-trailing-whitespace": false, + "no-var": false, + "no-var-requires": false, + "no-var-keyword": false, + "ordered-imports": false, + "object-literal-sort-keys": false, + "object-literal-shorthand": false, + "only-arrow-functions": false, + "prefer-const": false, + "prefer-for-of": false, + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/no-useless-constructor": "off", + "@typescript-eslint/type-annotation-spacing": "off" + }, + "jsRules": { + "curly": [false, "ignore-same-line"], + "jsx-no-lambda": false, + "jsx-self-close": false, + "jsx-wrap-multiline": false, + "max-classes-per-file": [true, 10], + "no-console": false, + "no-unused-vars": false, + "no-useless-constructor": false, + "no-var-requires": false, + "object-literal-sort-keys": false, + "object-literal-shorthand": false, + "only-arrow-functions": false, + "ordered-imports": false, + "prefer-const": false, + "prefer-for-of": false, + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/no-useless-constructor": "off" + } + } \ No newline at end of file diff --git a/samples/charts/data-chart/user-annotation-layer/webpack.config.js b/samples/charts/data-chart/user-annotation-layer/webpack.config.js new file mode 100644 index 000000000..e90479cd7 --- /dev/null +++ b/samples/charts/data-chart/user-annotation-layer/webpack.config.js @@ -0,0 +1,105 @@ +const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); +const path = require('path'); +const webpack = require('webpack'); + +module.exports = env => { + const nodeEnv = process.env.NODE_ENV || 'development'; + const isProd = nodeEnv === 'production'; + const isLegacy = !!process.env.legacy && !(process.env.legacy == "false"); + console.log(">> webpack nodeEnv=" + nodeEnv); + console.log(">> webpack isProd=" + isProd); + console.log(">> webpack isLegacy=" + isLegacy); + const presets = [ + ["@babel/preset-env", { + "useBuiltIns": "usage", + "corejs": 3, + "targets": { + "browsers": isLegacy ? ["defaults"] : [ + "last 2 Chrome versions", + "last 2 Safari versions", + "last 2 iOS versions", + "last 2 Firefox versions", + "last 2 Edge versions"] + } + }], + "@babel/preset-typescript" + ]; + + return { + entry: isLegacy ? [ + path.resolve(__dirname, 'src') + ] : path.resolve(__dirname, 'src'), + devtool: isProd ? false : 'source-map', + output: { + filename: isProd ? '[fullhash].bundle.js' : '[fullhash].bundle.js', + globalObject: 'this', + path: path.resolve(__dirname, 'dist'), + }, + + resolve: { + mainFields: ['esm2015', 'module', 'main'], + extensions: ['.ts', '.js', '.json'], + plugins: [new TsconfigPathsPlugin({ + configFile: './tsconfig.json', + extensions: ['.ts', '.js'], + mainFields: ['esm2015', 'module', 'main'] + })] + }, + + module: { + rules: [ + { test: /\.(png|svg|jpg|gif)$/, use: ['file-loader'] }, + { test: /\.(csv|tsv)$/, use: ['csv-loader'] }, + { test: /\.xml$/, use: ['xml-loader'] }, + { test: /\.css$/, sideEffects: true, use: ['style-loader', 'css-loader'] }, + { + test: /worker\.(ts|js)$/, + use: [ + { loader: 'worker-loader' }, + { + loader: 'babel-loader', options: { + "compact": isProd ? true : false, + "presets": presets, + "plugins": [ + "@babel/plugin-transform-class-static-block", + "@babel/plugin-transform-class-properties", + "@babel/plugin-transform-runtime" + ] + } + } + ] + }, + { + test: /\.(ts|js)$/, loader: 'babel-loader', + options: { + "compact": isProd ? true : false, + "presets": presets, + "plugins": [ + "@babel/plugin-transform-class-static-block", + "@babel/plugin-transform-class-properties", + "@babel/plugin-transform-runtime" + ] + }, + exclude: + function (modulePath) { + return /node_modules/.test(modulePath) && + !/igniteui-webcomponents/.test(modulePath) && + !/lit-html/.test(modulePath); + } + }], + }, + + plugins: [ + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify(nodeEnv) + }), + new HtmlWebpackPlugin({ + title: 'for-cs', + template: 'index.html' + }), + new ForkTsCheckerWebpackPlugin() + ] + }; +};