From d3800ab0da7966a39669af7d6a1d02add98e7e8e Mon Sep 17 00:00:00 2001 From: HUSSAR-mtrela Date: Mon, 3 Jun 2024 14:20:17 -0400 Subject: [PATCH] test codesandbox --- tests/donut/.stackblitzrc | 1 + tests/donut/ReadMe.md | 58 ++++++++ tests/donut/angular.json | 106 +++++++++++++++ tests/donut/package.json | 44 ++++++ tests/donut/sandbox.config.json | 5 + tests/donut/src/EnergyGlobalDemand.ts | 51 +++++++ tests/donut/src/app.component.html | 33 +++++ tests/donut/src/app.component.scss | 3 + tests/donut/src/app.component.ts | 39 ++++++ tests/donut/src/app.module.ts | 26 ++++ tests/donut/src/config/tsconfig-es5.app.json | 6 + tests/donut/src/config/tsconfig.app.json | 12 ++ tests/donut/src/config/tsconfig.base.json | 24 ++++ tests/donut/src/config/tsconfig.spec.json | 19 +++ tests/donut/src/config/tsconfig.worker.json | 14 ++ .../src/environments/environment.prod.ts | 3 + tests/donut/src/environments/environment.ts | 16 +++ tests/donut/src/index.html | 23 ++++ tests/donut/src/main.ts | 15 +++ tests/donut/src/polyfills.ts | 65 +++++++++ tests/donut/src/styles.scss | 9 ++ tests/donut/src/typings.d.ts | 5 + tests/donut/tsconfig.json | 21 +++ tests/donut/tslint.json | 31 +++++ tests/donut2/.codesandbox/Dockerfile | 1 + tests/donut2/.codesandbox/tasks.json | 17 +++ tests/donut2/.stackblitzrc | 1 + tests/donut2/ReadMe.md | 58 ++++++++ tests/donut2/angular.json | 106 +++++++++++++++ tests/donut2/package.json | 44 ++++++ tests/donut2/src/EnergyGlobalDemand.ts | 51 +++++++ tests/donut2/src/app.component.html | 33 +++++ tests/donut2/src/app.component.scss | 3 + tests/donut2/src/app.component.ts | 39 ++++++ tests/donut2/src/app.module.ts | 26 ++++ tests/donut2/src/config/tsconfig-es5.app.json | 6 + tests/donut2/src/config/tsconfig.app.json | 12 ++ tests/donut2/src/config/tsconfig.base.json | 24 ++++ tests/donut2/src/config/tsconfig.spec.json | 19 +++ tests/donut2/src/config/tsconfig.worker.json | 14 ++ .../src/environments/environment.prod.ts | 3 + tests/donut2/src/environments/environment.ts | 16 +++ tests/donut2/src/index.html | 23 ++++ tests/donut2/src/main.ts | 15 +++ tests/donut2/src/polyfills.ts | 65 +++++++++ tests/donut2/src/styles.scss | 9 ++ tests/donut2/src/typings.d.ts | 5 + tests/donut2/tsconfig.json | 21 +++ tests/donut2/tslint.json | 31 +++++ tests/donut3/.codesandbox/Dockerfile | 1 + tests/donut3/.codesandbox/tasks.json | 17 +++ tests/donut3/.stackblitzrc | 1 + tests/donut3/ReadMe.md | 58 ++++++++ tests/donut3/angular.json | 106 +++++++++++++++ tests/donut3/package.json | 44 ++++++ tests/donut3/sandbox.config.json | 5 + tests/donut3/src/EnergyGlobalDemand.ts | 51 +++++++ tests/donut3/src/app.component.html | 33 +++++ tests/donut3/src/app.component.scss | 3 + tests/donut3/src/app.component.ts | 39 ++++++ tests/donut3/src/app.module.ts | 26 ++++ tests/donut3/src/config/tsconfig-es5.app.json | 6 + tests/donut3/src/config/tsconfig.app.json | 12 ++ tests/donut3/src/config/tsconfig.base.json | 24 ++++ tests/donut3/src/config/tsconfig.spec.json | 19 +++ tests/donut3/src/config/tsconfig.worker.json | 14 ++ .../src/environments/environment.prod.ts | 3 + tests/donut3/src/environments/environment.ts | 16 +++ tests/donut3/src/index.html | 23 ++++ tests/donut3/src/main.ts | 15 +++ tests/donut3/src/polyfills.ts | 65 +++++++++ tests/donut3/src/styles.scss | 9 ++ tests/donut3/src/typings.d.ts | 5 + tests/donut3/tsconfig.json | 21 +++ tests/donut3/tslint.json | 31 +++++ tests/treegrid/.codesandbox/Dockerfile | 1 + tests/treegrid/.codesandbox/tasks.json | 17 +++ tests/treegrid/.stackblitzrc | 1 + tests/treegrid/angular.json | 110 +++++++++++++++ tests/treegrid/package.json | 30 +++++ tests/treegrid/src/_app-layout.scss | 84 ++++++++++++ tests/treegrid/src/_variables.scss | 18 +++ tests/treegrid/src/app/app.component.html | 1 + tests/treegrid/src/app/app.component.scss | 0 tests/treegrid/src/app/app.component.ts | 8 ++ tests/treegrid/src/app/app.module.ts | 41 ++++++ .../directives/prevent-scroll.directive.ts | 62 +++++++++ .../app/tree-grid-childdatakey-sample/data.ts | 125 ++++++++++++++++++ ...ee-grid-childdatakey-sample.component.html | 32 +++++ ...ee-grid-childdatakey-sample.component.scss | 3 + ...tree-grid-childdatakey-sample.component.ts | 58 ++++++++ .../src/environments/environment.prod.ts | 3 + .../treegrid/src/environments/environment.ts | 16 +++ tests/treegrid/src/index.html | 31 +++++ tests/treegrid/src/main.ts | 16 +++ tests/treegrid/src/polyfills.ts | 58 ++++++++ tests/treegrid/src/styles.scss | 49 +++++++ tests/treegrid/tsconfig.app.json | 10 ++ tests/treegrid/tsconfig.json | 25 ++++ 99 files changed, 2717 insertions(+) create mode 100644 tests/donut/.stackblitzrc create mode 100644 tests/donut/ReadMe.md create mode 100644 tests/donut/angular.json create mode 100644 tests/donut/package.json create mode 100644 tests/donut/sandbox.config.json create mode 100644 tests/donut/src/EnergyGlobalDemand.ts create mode 100644 tests/donut/src/app.component.html create mode 100644 tests/donut/src/app.component.scss create mode 100644 tests/donut/src/app.component.ts create mode 100644 tests/donut/src/app.module.ts create mode 100644 tests/donut/src/config/tsconfig-es5.app.json create mode 100644 tests/donut/src/config/tsconfig.app.json create mode 100644 tests/donut/src/config/tsconfig.base.json create mode 100644 tests/donut/src/config/tsconfig.spec.json create mode 100644 tests/donut/src/config/tsconfig.worker.json create mode 100644 tests/donut/src/environments/environment.prod.ts create mode 100644 tests/donut/src/environments/environment.ts create mode 100644 tests/donut/src/index.html create mode 100644 tests/donut/src/main.ts create mode 100644 tests/donut/src/polyfills.ts create mode 100644 tests/donut/src/styles.scss create mode 100644 tests/donut/src/typings.d.ts create mode 100644 tests/donut/tsconfig.json create mode 100644 tests/donut/tslint.json create mode 100644 tests/donut2/.codesandbox/Dockerfile create mode 100644 tests/donut2/.codesandbox/tasks.json create mode 100644 tests/donut2/.stackblitzrc create mode 100644 tests/donut2/ReadMe.md create mode 100644 tests/donut2/angular.json create mode 100644 tests/donut2/package.json create mode 100644 tests/donut2/src/EnergyGlobalDemand.ts create mode 100644 tests/donut2/src/app.component.html create mode 100644 tests/donut2/src/app.component.scss create mode 100644 tests/donut2/src/app.component.ts create mode 100644 tests/donut2/src/app.module.ts create mode 100644 tests/donut2/src/config/tsconfig-es5.app.json create mode 100644 tests/donut2/src/config/tsconfig.app.json create mode 100644 tests/donut2/src/config/tsconfig.base.json create mode 100644 tests/donut2/src/config/tsconfig.spec.json create mode 100644 tests/donut2/src/config/tsconfig.worker.json create mode 100644 tests/donut2/src/environments/environment.prod.ts create mode 100644 tests/donut2/src/environments/environment.ts create mode 100644 tests/donut2/src/index.html create mode 100644 tests/donut2/src/main.ts create mode 100644 tests/donut2/src/polyfills.ts create mode 100644 tests/donut2/src/styles.scss create mode 100644 tests/donut2/src/typings.d.ts create mode 100644 tests/donut2/tsconfig.json create mode 100644 tests/donut2/tslint.json create mode 100644 tests/donut3/.codesandbox/Dockerfile create mode 100644 tests/donut3/.codesandbox/tasks.json create mode 100644 tests/donut3/.stackblitzrc create mode 100644 tests/donut3/ReadMe.md create mode 100644 tests/donut3/angular.json create mode 100644 tests/donut3/package.json create mode 100644 tests/donut3/sandbox.config.json create mode 100644 tests/donut3/src/EnergyGlobalDemand.ts create mode 100644 tests/donut3/src/app.component.html create mode 100644 tests/donut3/src/app.component.scss create mode 100644 tests/donut3/src/app.component.ts create mode 100644 tests/donut3/src/app.module.ts create mode 100644 tests/donut3/src/config/tsconfig-es5.app.json create mode 100644 tests/donut3/src/config/tsconfig.app.json create mode 100644 tests/donut3/src/config/tsconfig.base.json create mode 100644 tests/donut3/src/config/tsconfig.spec.json create mode 100644 tests/donut3/src/config/tsconfig.worker.json create mode 100644 tests/donut3/src/environments/environment.prod.ts create mode 100644 tests/donut3/src/environments/environment.ts create mode 100644 tests/donut3/src/index.html create mode 100644 tests/donut3/src/main.ts create mode 100644 tests/donut3/src/polyfills.ts create mode 100644 tests/donut3/src/styles.scss create mode 100644 tests/donut3/src/typings.d.ts create mode 100644 tests/donut3/tsconfig.json create mode 100644 tests/donut3/tslint.json create mode 100644 tests/treegrid/.codesandbox/Dockerfile create mode 100644 tests/treegrid/.codesandbox/tasks.json create mode 100644 tests/treegrid/.stackblitzrc create mode 100644 tests/treegrid/angular.json create mode 100644 tests/treegrid/package.json create mode 100644 tests/treegrid/src/_app-layout.scss create mode 100644 tests/treegrid/src/_variables.scss create mode 100644 tests/treegrid/src/app/app.component.html create mode 100644 tests/treegrid/src/app/app.component.scss create mode 100644 tests/treegrid/src/app/app.component.ts create mode 100644 tests/treegrid/src/app/app.module.ts create mode 100644 tests/treegrid/src/app/directives/prevent-scroll.directive.ts create mode 100644 tests/treegrid/src/app/tree-grid-childdatakey-sample/data.ts create mode 100644 tests/treegrid/src/app/tree-grid-childdatakey-sample/tree-grid-childdatakey-sample.component.html create mode 100644 tests/treegrid/src/app/tree-grid-childdatakey-sample/tree-grid-childdatakey-sample.component.scss create mode 100644 tests/treegrid/src/app/tree-grid-childdatakey-sample/tree-grid-childdatakey-sample.component.ts create mode 100644 tests/treegrid/src/environments/environment.prod.ts create mode 100644 tests/treegrid/src/environments/environment.ts create mode 100644 tests/treegrid/src/index.html create mode 100644 tests/treegrid/src/main.ts create mode 100644 tests/treegrid/src/polyfills.ts create mode 100644 tests/treegrid/src/styles.scss create mode 100644 tests/treegrid/tsconfig.app.json create mode 100644 tests/treegrid/tsconfig.json diff --git a/tests/donut/.stackblitzrc b/tests/donut/.stackblitzrc new file mode 100644 index 000000000..65efbb4fd --- /dev/null +++ b/tests/donut/.stackblitzrc @@ -0,0 +1 @@ +{"installDependencies":true,"startCommand":"turbo start","env":{"ENABLE_CJS_IMPORTS":true}} \ No newline at end of file diff --git a/tests/donut/ReadMe.md b/tests/donut/ReadMe.md new file mode 100644 index 000000000..88e6723a3 --- /dev/null +++ b/tests/donut/ReadMe.md @@ -0,0 +1,58 @@ + + + +This folder contains Angular application with example of Legend feature using [DoughnutChart](https://www.infragistics.com/products/ignite-ui-angular/angular/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 + +Follow these instructions to run this example: + + +- clone and navigate to this sample in terminal window + +``` +git clone https://github.com/IgniteUI/igniteui-angular-examples.git +git checkout master +cd ../samples/charts/doughnut-chart/legend +``` + + +- open above folder in VS Code or type: +``` +code . +``` + +- In terminal window, run: +``` +npm install --legacy-peer-deps +npm run-script start +``` + +- open http://localhost:4200/ in your browser + + +## Learn More + +To learn more about **Ignite UI for Angular** components, check out the [Angular documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/general-getting-started.html). diff --git a/tests/donut/angular.json b/tests/donut/angular.json new file mode 100644 index 000000000..11ffb8c9c --- /dev/null +++ b/tests/donut/angular.json @@ -0,0 +1,106 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "demo": { + "root": "", + "sourceRoot": "src", + "projectType": "application", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/demo", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": [ + "zone.js", + "hammerjs" + ], + "tsConfig": "src/config/tsconfig.app.json", + "assets": [ + "src/assets" + ], + "styles": [ + "src/styles.scss" + ], + "scripts": [] + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "buildTarget": "demo:build" + }, + "configurations": { + "production": { + "buildTarget": "demo:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "buildTarget": "demo:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/config/tsconfig.spec.json", + "karmaConfig": "src/config/karma.conf.js", + "styles": [ + "styles.css" + ], + "scripts": [], + "assets": [ + "src/assets" + ] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "src/config/tsconfig.app.json", + "src/config/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + } + }, + "schematics": { + "@schematics/angular:component": { + "prefix": "app", + "style": "scss" + }, + "@schematics/angular:directive": { + "prefix": "app" + } + } +} diff --git a/tests/donut/package.json b/tests/donut/package.json new file mode 100644 index 000000000..fabb9adc1 --- /dev/null +++ b/tests/donut/package.json @@ -0,0 +1,44 @@ +{ + "scripts": { + "ng": "ng", + "update": "ng update", + "start": "node --max_old_space_size=12192 node_modules/@angular/cli/bin/ng serve -o", + "build": "node --max_old_space_size=12192 node_modules/@angular/cli/bin/ng build --configuration production", + "lint": "ng lint" + }, + "dependencies": { + "@angular/animations": "17.0.0", + "@angular/common": "17.0.0", + "@angular/compiler": "17.0.0", + "@angular/core": "17.0.0", + "@angular/forms": "17.0.0", + "@angular/platform-browser": "17.0.0", + "@angular/platform-browser-dynamic": "17.0.0", + "@types/hammerjs": "2.0.39", + "classlist.js": "1.1.20150312", + "core-js": "3.21.0", + "hammerjs": "2.0.8", + "igniteui-angular-charts": "17.3.1-alpha.0", + "igniteui-angular-core": "17.3.1-alpha.0", + "intl": "1.2.5", + "jszip": "3.8.0", + "rxjs": "6.6.7", + "tslib": "2.3.1", + "web-animations-js": "2.3.2", + "zone.js": "~0.14.1" + }, + "devDependencies": { + "@angular-devkit/build-angular": "17.0.0", + "@angular/cli": "17.0.0", + "@angular/compiler-cli": "17.0.0", + "@angular/language-service": "17.0.0", + "@types/node": "14.14.28", + "codelyzer": "6.0.2", + "jasmine-core": "3.7.1", + "jasmine-spec-reporter": "~4.2.1", + "sass.js": "0.11.1", + "ts-node": "9.1.1", + "tslint": "~6.1.3", + "typescript": "5.2.2" + } +} diff --git a/tests/donut/sandbox.config.json b/tests/donut/sandbox.config.json new file mode 100644 index 000000000..07f53508e --- /dev/null +++ b/tests/donut/sandbox.config.json @@ -0,0 +1,5 @@ +{ + "infiniteLoopProtection": false, + "hardReloadOnChange": false, + "view": "browser" +} \ No newline at end of file diff --git a/tests/donut/src/EnergyGlobalDemand.ts b/tests/donut/src/EnergyGlobalDemand.ts new file mode 100644 index 000000000..922fcf7a9 --- /dev/null +++ b/tests/donut/src/EnergyGlobalDemand.ts @@ -0,0 +1,51 @@ +export class EnergyGlobalDemandItem { + public constructor(init: Partial) { + Object.assign(this, init); + } + + public value: number; + public category: string; + public summary: string; + +} +export class EnergyGlobalDemand extends Array { + public constructor(items: Array | number = -1) { + if (Array.isArray(items)) { + super(...items); + } else { + const newItems = [ + new EnergyGlobalDemandItem( + { + value: 37, + category: `Cooling`, + summary: `Cooling 37%` + }), + new EnergyGlobalDemandItem( + { + value: 25, + category: `Residential`, + summary: `Residential 25%` + }), + new EnergyGlobalDemandItem( + { + value: 12, + category: `Heating`, + summary: `Heating 12%` + }), + new EnergyGlobalDemandItem( + { + value: 11, + category: `Lighting`, + summary: `Lighting 11%` + }), + new EnergyGlobalDemandItem( + { + value: 15, + category: `Other`, + summary: `Other 15%` + }), + ]; + super(...(newItems.slice(0, items))); + } + } +} diff --git a/tests/donut/src/app.component.html b/tests/donut/src/app.component.html new file mode 100644 index 000000000..3c78e15c6 --- /dev/null +++ b/tests/donut/src/app.component.html @@ -0,0 +1,33 @@ +
+
+ Global Electricity Demand by Energy Use +
+
+ + +
+
+ + + + +
+
diff --git a/tests/donut/src/app.component.scss b/tests/donut/src/app.component.scss new file mode 100644 index 000000000..cbff781da --- /dev/null +++ b/tests/donut/src/app.component.scss @@ -0,0 +1,3 @@ +/* styles are loaded the Shared CSS file located at: +https://static.infragistics.com/xplatform/css/samples/ +*/ diff --git a/tests/donut/src/app.component.ts b/tests/donut/src/app.component.ts new file mode 100644 index 000000000..d7720aa4b --- /dev/null +++ b/tests/donut/src/app.component.ts @@ -0,0 +1,39 @@ +import { AfterViewInit, Component, ViewChild, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core'; +import { EnergyGlobalDemandItem, EnergyGlobalDemand } from './EnergyGlobalDemand'; +import { IgxItemLegendComponent, IgxDoughnutChartComponent, IgxRingSeriesComponent } from 'igniteui-angular-charts'; + +@Component({ + selector: "app-root", + styleUrls: ["./app.component.scss"], + templateUrl: "./app.component.html", + changeDetection: ChangeDetectionStrategy.OnPush +}) + +export class AppComponent implements AfterViewInit +{ + + @ViewChild("legend", { static: true } ) + private legend: IgxItemLegendComponent + @ViewChild("chart", { static: true } ) + private chart: IgxDoughnutChartComponent + @ViewChild("series", { static: true } ) + private series: IgxRingSeriesComponent + private _energyGlobalDemand: EnergyGlobalDemand = null; + public get energyGlobalDemand(): EnergyGlobalDemand { + if (this._energyGlobalDemand == null) + { + this._energyGlobalDemand = new EnergyGlobalDemand(); + } + return this._energyGlobalDemand; + } + + public constructor(private _detector: ChangeDetectorRef) + { + } + + public ngAfterViewInit(): void + { + } + +} + diff --git a/tests/donut/src/app.module.ts b/tests/donut/src/app.module.ts new file mode 100644 index 000000000..7d4332c43 --- /dev/null +++ b/tests/donut/src/app.module.ts @@ -0,0 +1,26 @@ +import { NgModule } from "@angular/core"; +import { FormsModule } from "@angular/forms"; +import { CommonModule } from "@angular/common"; +import { BrowserModule } from "@angular/platform-browser"; +import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { AppComponent } from "./app.component"; + +import { IgxItemLegendModule, IgxDoughnutChartModule } from 'igniteui-angular-charts'; + +@NgModule({ + bootstrap: [AppComponent], + declarations: [ + AppComponent +], + imports: [ + BrowserModule, + BrowserAnimationsModule, + CommonModule, + FormsModule, + IgxItemLegendModule, + IgxDoughnutChartModule +], + providers: [], + schemas: [] +}) +export class AppModule {} diff --git a/tests/donut/src/config/tsconfig-es5.app.json b/tests/donut/src/config/tsconfig-es5.app.json new file mode 100644 index 000000000..7e8983eb4 --- /dev/null +++ b/tests/donut/src/config/tsconfig-es5.app.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.app.json", + "compilerOptions": { + "target": "ES2022" + } + } diff --git a/tests/donut/src/config/tsconfig.app.json b/tests/donut/src/config/tsconfig.app.json new file mode 100644 index 000000000..f722e3fe4 --- /dev/null +++ b/tests/donut/src/config/tsconfig.app.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "../../out-tsc/app", + "baseUrl": "./", + "types": [] + }, + "files": [ + "../main.ts", + "../polyfills.ts" + ] +} diff --git a/tests/donut/src/config/tsconfig.base.json b/tests/donut/src/config/tsconfig.base.json new file mode 100644 index 000000000..5574be5e5 --- /dev/null +++ b/tests/donut/src/config/tsconfig.base.json @@ -0,0 +1,24 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "importHelpers": true, + "module": "ES2022", + "outDir": "../../dist/out-tsc", + "sourceMap": false, + "declaration": false, + "moduleResolution": "node", + "experimentalDecorators": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "downlevelIteration": true, // required for excel library + "target": "ES2022", + "typeRoots": [ + "../../node_modules/@types" + ], + "lib": [ + "ES2022", + "dom" + ], + "useDefineForClassFields": false + } +} diff --git a/tests/donut/src/config/tsconfig.spec.json b/tests/donut/src/config/tsconfig.spec.json new file mode 100644 index 000000000..6eb8c055c --- /dev/null +++ b/tests/donut/src/config/tsconfig.spec.json @@ -0,0 +1,19 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "../../out-tsc/spec", + "baseUrl": "./", + "types": [ + "jasmine", + "node" + ] + }, + "files": [ + "../test.ts", + "../polyfills.ts" + ], + "include": [ + "../**/*.spec.ts", + "../**/*.d.ts" + ] +} diff --git a/tests/donut/src/config/tsconfig.worker.json b/tests/donut/src/config/tsconfig.worker.json new file mode 100644 index 000000000..4867b1275 --- /dev/null +++ b/tests/donut/src/config/tsconfig.worker.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "../../out-tsc/worker", + "lib": [ + "ES2022", + "DOM" + ], + "types": [] + }, + "include": [ + "../**/*Worker.ts" + ] +} diff --git a/tests/donut/src/environments/environment.prod.ts b/tests/donut/src/environments/environment.prod.ts new file mode 100644 index 000000000..3612073bc --- /dev/null +++ b/tests/donut/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/tests/donut/src/environments/environment.ts b/tests/donut/src/environments/environment.ts new file mode 100644 index 000000000..7b4f817ad --- /dev/null +++ b/tests/donut/src/environments/environment.ts @@ -0,0 +1,16 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false +}; + +/* + * For easier debugging in development mode, you can import the following file + * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. + * + * This import should be commented out in production mode because it will have a negative impact + * on performance if an error is thrown. + */ +// import 'zone.js/dist/zone-error'; // Included with Angular CLI. diff --git a/tests/donut/src/index.html b/tests/donut/src/index.html new file mode 100644 index 000000000..7650dfb64 --- /dev/null +++ b/tests/donut/src/index.html @@ -0,0 +1,23 @@ + + + + + + IgniteUI for Angular | Example | infragistics + + + + + + + + + + + + + + + + + diff --git a/tests/donut/src/main.ts b/tests/donut/src/main.ts new file mode 100644 index 000000000..ec9adcd4a --- /dev/null +++ b/tests/donut/src/main.ts @@ -0,0 +1,15 @@ +// tslint:disable:no-string-literal +import "./polyfills"; +import { enableProdMode } from "@angular/core"; +import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; +import { AppModule } from "./app.module"; + +platformBrowserDynamic().bootstrapModule(AppModule).then(ref => { + // ensure Angular destroys itself on hot reloads. + if (window["ngRef"]) { + window["ngRef"].destroy(); + } + window["ngRef"] = ref; + + // otherwise, log the boot error +}).catch(err => console.error(err)); diff --git a/tests/donut/src/polyfills.ts b/tests/donut/src/polyfills.ts new file mode 100644 index 000000000..d583cff9c --- /dev/null +++ b/tests/donut/src/polyfills.ts @@ -0,0 +1,65 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** +* BROWSER POLYFILLS +*/ + +// import "core-js/es7/object"; + +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +//import "classlist.js"; // run `npm install --save classlist.js`. + +/** IE10 and IE11 requires the following for the Reflect API. */ +// import "core-js/es6/reflect"; + +/* Evergreen browsers require these. */ +// used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. +// import "core-js/es7/reflect"; + +/* + * Required to support Web Animations `@angular/platform-browser/animations`. + * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation + */ +//import "web-animations-js"; // run `npm install --save web-animations-js`. + +/*************************************************************************************************** + * Zone JS is required by Angular itself. + */ +import "hammerjs/hammer"; +import "zone.js"; // included with Angular CLI. + +/*************************************************************************************************** + * @angular/animations polyfill + */ +// if (!Element.prototype.matches) { +// Element.prototype.matches = (Element.prototype as any).msMatchesSelector; +// } + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ + +/** + * Date, currency, decimal and percent pipes. + * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 + */ +// import "intl"; // Run `npm install --save intl`. +// import "intl/locale-data/jsonp/de"; +/** + * Need to import at least one locale-data with intl. + */ +// import "intl/locale-data/jsonp/en"; diff --git a/tests/donut/src/styles.scss b/tests/donut/src/styles.scss new file mode 100644 index 000000000..9b431e92d --- /dev/null +++ b/tests/donut/src/styles.scss @@ -0,0 +1,9 @@ +/* autoprefixer grid: on */ +html, +body { + height: 100%; + width: 100%; + overflow: hidden; + margin: 0; + box-sizing: border-box; +} diff --git a/tests/donut/src/typings.d.ts b/tests/donut/src/typings.d.ts new file mode 100644 index 000000000..ef5c7bd62 --- /dev/null +++ b/tests/donut/src/typings.d.ts @@ -0,0 +1,5 @@ +/* SystemJS module definition */ +declare var module: NodeModule; +interface NodeModule { + id: string; +} diff --git a/tests/donut/tsconfig.json b/tests/donut/tsconfig.json new file mode 100644 index 000000000..1aaac63d3 --- /dev/null +++ b/tests/donut/tsconfig.json @@ -0,0 +1,21 @@ +/* + This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. + It is not intended to be used to perform a compilation. + + To learn more about this file see: https://angular.io/config/solution-tsconfig. +*/ +{ + "useDefineForClassFields": false, + "files": [], + "references": [ + { + "path": "./src/config/tsconfig.app.json" + }, + { + "path": "./src/config/tsconfig.worker.json" + }, + { + "path": "./src/config/tsconfig.spec.json" + } + ] +} \ No newline at end of file diff --git a/tests/donut/tslint.json b/tests/donut/tslint.json new file mode 100644 index 000000000..777c777d9 --- /dev/null +++ b/tests/donut/tslint.json @@ -0,0 +1,31 @@ +{ + "extends": "tslint:latest", + "rules": { + "deprecation": { + "severity": "warning" + }, + "arrow-parens": false, + "indent": [true, "spaces"], + "interface-name": [true, "always-prefix"], + "max-classes-per-file": false, + "no-bitwise": false, + "no-console": false, + "no-empty": false, + "no-duplicate-imports": false, + "no-implicit-dependencies": false, + "no-object-literal-type-assertion": false, + "no-submodule-imports": [false], + "no-string-literal": false, + "no-trailing-whitespace": false, + "no-var-keyword": false, + "object-literal-sort-keys": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-for-of": false, + "prefer-object-spread": false, + "space-within-parens": false, + "trailing-comma": [true, {"multiline": "never", "singleline": "never"}], + "variable-name": [true, "allow-leading-underscore"] + } +} diff --git a/tests/donut2/.codesandbox/Dockerfile b/tests/donut2/.codesandbox/Dockerfile new file mode 100644 index 000000000..adf04bd95 --- /dev/null +++ b/tests/donut2/.codesandbox/Dockerfile @@ -0,0 +1 @@ +FROM node:18 \ No newline at end of file diff --git a/tests/donut2/.codesandbox/tasks.json b/tests/donut2/.codesandbox/tasks.json new file mode 100644 index 000000000..8d92a54cd --- /dev/null +++ b/tests/donut2/.codesandbox/tasks.json @@ -0,0 +1,17 @@ +{ + // These tasks will run in order when initializing your CodeSandbox project. + "setupTasks": [ + { + "name": "Install Dependencies", + "command": "yarn install" + } + ], + // These tasks can be run from CodeSandbox. Running one will open a log in the app. + "tasks": { + "node node_modules/@angular/cli/bin/ng serve -o --disable-host-check": { + "name": "Start Project", + "command": "node node_modules/@angular/cli/bin/ng serve -o --disable-host-check", + "runAtStart": true + } + } +} \ No newline at end of file diff --git a/tests/donut2/.stackblitzrc b/tests/donut2/.stackblitzrc new file mode 100644 index 000000000..65efbb4fd --- /dev/null +++ b/tests/donut2/.stackblitzrc @@ -0,0 +1 @@ +{"installDependencies":true,"startCommand":"turbo start","env":{"ENABLE_CJS_IMPORTS":true}} \ No newline at end of file diff --git a/tests/donut2/ReadMe.md b/tests/donut2/ReadMe.md new file mode 100644 index 000000000..88e6723a3 --- /dev/null +++ b/tests/donut2/ReadMe.md @@ -0,0 +1,58 @@ + + + +This folder contains Angular application with example of Legend feature using [DoughnutChart](https://www.infragistics.com/products/ignite-ui-angular/angular/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 + +Follow these instructions to run this example: + + +- clone and navigate to this sample in terminal window + +``` +git clone https://github.com/IgniteUI/igniteui-angular-examples.git +git checkout master +cd ../samples/charts/doughnut-chart/legend +``` + + +- open above folder in VS Code or type: +``` +code . +``` + +- In terminal window, run: +``` +npm install --legacy-peer-deps +npm run-script start +``` + +- open http://localhost:4200/ in your browser + + +## Learn More + +To learn more about **Ignite UI for Angular** components, check out the [Angular documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/general-getting-started.html). diff --git a/tests/donut2/angular.json b/tests/donut2/angular.json new file mode 100644 index 000000000..11ffb8c9c --- /dev/null +++ b/tests/donut2/angular.json @@ -0,0 +1,106 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "demo": { + "root": "", + "sourceRoot": "src", + "projectType": "application", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/demo", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": [ + "zone.js", + "hammerjs" + ], + "tsConfig": "src/config/tsconfig.app.json", + "assets": [ + "src/assets" + ], + "styles": [ + "src/styles.scss" + ], + "scripts": [] + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "buildTarget": "demo:build" + }, + "configurations": { + "production": { + "buildTarget": "demo:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "buildTarget": "demo:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/config/tsconfig.spec.json", + "karmaConfig": "src/config/karma.conf.js", + "styles": [ + "styles.css" + ], + "scripts": [], + "assets": [ + "src/assets" + ] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "src/config/tsconfig.app.json", + "src/config/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + } + }, + "schematics": { + "@schematics/angular:component": { + "prefix": "app", + "style": "scss" + }, + "@schematics/angular:directive": { + "prefix": "app" + } + } +} diff --git a/tests/donut2/package.json b/tests/donut2/package.json new file mode 100644 index 000000000..fabb9adc1 --- /dev/null +++ b/tests/donut2/package.json @@ -0,0 +1,44 @@ +{ + "scripts": { + "ng": "ng", + "update": "ng update", + "start": "node --max_old_space_size=12192 node_modules/@angular/cli/bin/ng serve -o", + "build": "node --max_old_space_size=12192 node_modules/@angular/cli/bin/ng build --configuration production", + "lint": "ng lint" + }, + "dependencies": { + "@angular/animations": "17.0.0", + "@angular/common": "17.0.0", + "@angular/compiler": "17.0.0", + "@angular/core": "17.0.0", + "@angular/forms": "17.0.0", + "@angular/platform-browser": "17.0.0", + "@angular/platform-browser-dynamic": "17.0.0", + "@types/hammerjs": "2.0.39", + "classlist.js": "1.1.20150312", + "core-js": "3.21.0", + "hammerjs": "2.0.8", + "igniteui-angular-charts": "17.3.1-alpha.0", + "igniteui-angular-core": "17.3.1-alpha.0", + "intl": "1.2.5", + "jszip": "3.8.0", + "rxjs": "6.6.7", + "tslib": "2.3.1", + "web-animations-js": "2.3.2", + "zone.js": "~0.14.1" + }, + "devDependencies": { + "@angular-devkit/build-angular": "17.0.0", + "@angular/cli": "17.0.0", + "@angular/compiler-cli": "17.0.0", + "@angular/language-service": "17.0.0", + "@types/node": "14.14.28", + "codelyzer": "6.0.2", + "jasmine-core": "3.7.1", + "jasmine-spec-reporter": "~4.2.1", + "sass.js": "0.11.1", + "ts-node": "9.1.1", + "tslint": "~6.1.3", + "typescript": "5.2.2" + } +} diff --git a/tests/donut2/src/EnergyGlobalDemand.ts b/tests/donut2/src/EnergyGlobalDemand.ts new file mode 100644 index 000000000..922fcf7a9 --- /dev/null +++ b/tests/donut2/src/EnergyGlobalDemand.ts @@ -0,0 +1,51 @@ +export class EnergyGlobalDemandItem { + public constructor(init: Partial) { + Object.assign(this, init); + } + + public value: number; + public category: string; + public summary: string; + +} +export class EnergyGlobalDemand extends Array { + public constructor(items: Array | number = -1) { + if (Array.isArray(items)) { + super(...items); + } else { + const newItems = [ + new EnergyGlobalDemandItem( + { + value: 37, + category: `Cooling`, + summary: `Cooling 37%` + }), + new EnergyGlobalDemandItem( + { + value: 25, + category: `Residential`, + summary: `Residential 25%` + }), + new EnergyGlobalDemandItem( + { + value: 12, + category: `Heating`, + summary: `Heating 12%` + }), + new EnergyGlobalDemandItem( + { + value: 11, + category: `Lighting`, + summary: `Lighting 11%` + }), + new EnergyGlobalDemandItem( + { + value: 15, + category: `Other`, + summary: `Other 15%` + }), + ]; + super(...(newItems.slice(0, items))); + } + } +} diff --git a/tests/donut2/src/app.component.html b/tests/donut2/src/app.component.html new file mode 100644 index 000000000..3c78e15c6 --- /dev/null +++ b/tests/donut2/src/app.component.html @@ -0,0 +1,33 @@ +
+
+ Global Electricity Demand by Energy Use +
+
+ + +
+
+ + + + +
+
diff --git a/tests/donut2/src/app.component.scss b/tests/donut2/src/app.component.scss new file mode 100644 index 000000000..cbff781da --- /dev/null +++ b/tests/donut2/src/app.component.scss @@ -0,0 +1,3 @@ +/* styles are loaded the Shared CSS file located at: +https://static.infragistics.com/xplatform/css/samples/ +*/ diff --git a/tests/donut2/src/app.component.ts b/tests/donut2/src/app.component.ts new file mode 100644 index 000000000..d7720aa4b --- /dev/null +++ b/tests/donut2/src/app.component.ts @@ -0,0 +1,39 @@ +import { AfterViewInit, Component, ViewChild, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core'; +import { EnergyGlobalDemandItem, EnergyGlobalDemand } from './EnergyGlobalDemand'; +import { IgxItemLegendComponent, IgxDoughnutChartComponent, IgxRingSeriesComponent } from 'igniteui-angular-charts'; + +@Component({ + selector: "app-root", + styleUrls: ["./app.component.scss"], + templateUrl: "./app.component.html", + changeDetection: ChangeDetectionStrategy.OnPush +}) + +export class AppComponent implements AfterViewInit +{ + + @ViewChild("legend", { static: true } ) + private legend: IgxItemLegendComponent + @ViewChild("chart", { static: true } ) + private chart: IgxDoughnutChartComponent + @ViewChild("series", { static: true } ) + private series: IgxRingSeriesComponent + private _energyGlobalDemand: EnergyGlobalDemand = null; + public get energyGlobalDemand(): EnergyGlobalDemand { + if (this._energyGlobalDemand == null) + { + this._energyGlobalDemand = new EnergyGlobalDemand(); + } + return this._energyGlobalDemand; + } + + public constructor(private _detector: ChangeDetectorRef) + { + } + + public ngAfterViewInit(): void + { + } + +} + diff --git a/tests/donut2/src/app.module.ts b/tests/donut2/src/app.module.ts new file mode 100644 index 000000000..7d4332c43 --- /dev/null +++ b/tests/donut2/src/app.module.ts @@ -0,0 +1,26 @@ +import { NgModule } from "@angular/core"; +import { FormsModule } from "@angular/forms"; +import { CommonModule } from "@angular/common"; +import { BrowserModule } from "@angular/platform-browser"; +import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { AppComponent } from "./app.component"; + +import { IgxItemLegendModule, IgxDoughnutChartModule } from 'igniteui-angular-charts'; + +@NgModule({ + bootstrap: [AppComponent], + declarations: [ + AppComponent +], + imports: [ + BrowserModule, + BrowserAnimationsModule, + CommonModule, + FormsModule, + IgxItemLegendModule, + IgxDoughnutChartModule +], + providers: [], + schemas: [] +}) +export class AppModule {} diff --git a/tests/donut2/src/config/tsconfig-es5.app.json b/tests/donut2/src/config/tsconfig-es5.app.json new file mode 100644 index 000000000..7e8983eb4 --- /dev/null +++ b/tests/donut2/src/config/tsconfig-es5.app.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.app.json", + "compilerOptions": { + "target": "ES2022" + } + } diff --git a/tests/donut2/src/config/tsconfig.app.json b/tests/donut2/src/config/tsconfig.app.json new file mode 100644 index 000000000..f722e3fe4 --- /dev/null +++ b/tests/donut2/src/config/tsconfig.app.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "../../out-tsc/app", + "baseUrl": "./", + "types": [] + }, + "files": [ + "../main.ts", + "../polyfills.ts" + ] +} diff --git a/tests/donut2/src/config/tsconfig.base.json b/tests/donut2/src/config/tsconfig.base.json new file mode 100644 index 000000000..5574be5e5 --- /dev/null +++ b/tests/donut2/src/config/tsconfig.base.json @@ -0,0 +1,24 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "importHelpers": true, + "module": "ES2022", + "outDir": "../../dist/out-tsc", + "sourceMap": false, + "declaration": false, + "moduleResolution": "node", + "experimentalDecorators": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "downlevelIteration": true, // required for excel library + "target": "ES2022", + "typeRoots": [ + "../../node_modules/@types" + ], + "lib": [ + "ES2022", + "dom" + ], + "useDefineForClassFields": false + } +} diff --git a/tests/donut2/src/config/tsconfig.spec.json b/tests/donut2/src/config/tsconfig.spec.json new file mode 100644 index 000000000..6eb8c055c --- /dev/null +++ b/tests/donut2/src/config/tsconfig.spec.json @@ -0,0 +1,19 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "../../out-tsc/spec", + "baseUrl": "./", + "types": [ + "jasmine", + "node" + ] + }, + "files": [ + "../test.ts", + "../polyfills.ts" + ], + "include": [ + "../**/*.spec.ts", + "../**/*.d.ts" + ] +} diff --git a/tests/donut2/src/config/tsconfig.worker.json b/tests/donut2/src/config/tsconfig.worker.json new file mode 100644 index 000000000..4867b1275 --- /dev/null +++ b/tests/donut2/src/config/tsconfig.worker.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "../../out-tsc/worker", + "lib": [ + "ES2022", + "DOM" + ], + "types": [] + }, + "include": [ + "../**/*Worker.ts" + ] +} diff --git a/tests/donut2/src/environments/environment.prod.ts b/tests/donut2/src/environments/environment.prod.ts new file mode 100644 index 000000000..3612073bc --- /dev/null +++ b/tests/donut2/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/tests/donut2/src/environments/environment.ts b/tests/donut2/src/environments/environment.ts new file mode 100644 index 000000000..7b4f817ad --- /dev/null +++ b/tests/donut2/src/environments/environment.ts @@ -0,0 +1,16 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false +}; + +/* + * For easier debugging in development mode, you can import the following file + * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. + * + * This import should be commented out in production mode because it will have a negative impact + * on performance if an error is thrown. + */ +// import 'zone.js/dist/zone-error'; // Included with Angular CLI. diff --git a/tests/donut2/src/index.html b/tests/donut2/src/index.html new file mode 100644 index 000000000..7650dfb64 --- /dev/null +++ b/tests/donut2/src/index.html @@ -0,0 +1,23 @@ + + + + + + IgniteUI for Angular | Example | infragistics + + + + + + + + + + + + + + + + + diff --git a/tests/donut2/src/main.ts b/tests/donut2/src/main.ts new file mode 100644 index 000000000..ec9adcd4a --- /dev/null +++ b/tests/donut2/src/main.ts @@ -0,0 +1,15 @@ +// tslint:disable:no-string-literal +import "./polyfills"; +import { enableProdMode } from "@angular/core"; +import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; +import { AppModule } from "./app.module"; + +platformBrowserDynamic().bootstrapModule(AppModule).then(ref => { + // ensure Angular destroys itself on hot reloads. + if (window["ngRef"]) { + window["ngRef"].destroy(); + } + window["ngRef"] = ref; + + // otherwise, log the boot error +}).catch(err => console.error(err)); diff --git a/tests/donut2/src/polyfills.ts b/tests/donut2/src/polyfills.ts new file mode 100644 index 000000000..d583cff9c --- /dev/null +++ b/tests/donut2/src/polyfills.ts @@ -0,0 +1,65 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** +* BROWSER POLYFILLS +*/ + +// import "core-js/es7/object"; + +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +//import "classlist.js"; // run `npm install --save classlist.js`. + +/** IE10 and IE11 requires the following for the Reflect API. */ +// import "core-js/es6/reflect"; + +/* Evergreen browsers require these. */ +// used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. +// import "core-js/es7/reflect"; + +/* + * Required to support Web Animations `@angular/platform-browser/animations`. + * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation + */ +//import "web-animations-js"; // run `npm install --save web-animations-js`. + +/*************************************************************************************************** + * Zone JS is required by Angular itself. + */ +import "hammerjs/hammer"; +import "zone.js"; // included with Angular CLI. + +/*************************************************************************************************** + * @angular/animations polyfill + */ +// if (!Element.prototype.matches) { +// Element.prototype.matches = (Element.prototype as any).msMatchesSelector; +// } + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ + +/** + * Date, currency, decimal and percent pipes. + * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 + */ +// import "intl"; // Run `npm install --save intl`. +// import "intl/locale-data/jsonp/de"; +/** + * Need to import at least one locale-data with intl. + */ +// import "intl/locale-data/jsonp/en"; diff --git a/tests/donut2/src/styles.scss b/tests/donut2/src/styles.scss new file mode 100644 index 000000000..9b431e92d --- /dev/null +++ b/tests/donut2/src/styles.scss @@ -0,0 +1,9 @@ +/* autoprefixer grid: on */ +html, +body { + height: 100%; + width: 100%; + overflow: hidden; + margin: 0; + box-sizing: border-box; +} diff --git a/tests/donut2/src/typings.d.ts b/tests/donut2/src/typings.d.ts new file mode 100644 index 000000000..ef5c7bd62 --- /dev/null +++ b/tests/donut2/src/typings.d.ts @@ -0,0 +1,5 @@ +/* SystemJS module definition */ +declare var module: NodeModule; +interface NodeModule { + id: string; +} diff --git a/tests/donut2/tsconfig.json b/tests/donut2/tsconfig.json new file mode 100644 index 000000000..1aaac63d3 --- /dev/null +++ b/tests/donut2/tsconfig.json @@ -0,0 +1,21 @@ +/* + This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. + It is not intended to be used to perform a compilation. + + To learn more about this file see: https://angular.io/config/solution-tsconfig. +*/ +{ + "useDefineForClassFields": false, + "files": [], + "references": [ + { + "path": "./src/config/tsconfig.app.json" + }, + { + "path": "./src/config/tsconfig.worker.json" + }, + { + "path": "./src/config/tsconfig.spec.json" + } + ] +} \ No newline at end of file diff --git a/tests/donut2/tslint.json b/tests/donut2/tslint.json new file mode 100644 index 000000000..777c777d9 --- /dev/null +++ b/tests/donut2/tslint.json @@ -0,0 +1,31 @@ +{ + "extends": "tslint:latest", + "rules": { + "deprecation": { + "severity": "warning" + }, + "arrow-parens": false, + "indent": [true, "spaces"], + "interface-name": [true, "always-prefix"], + "max-classes-per-file": false, + "no-bitwise": false, + "no-console": false, + "no-empty": false, + "no-duplicate-imports": false, + "no-implicit-dependencies": false, + "no-object-literal-type-assertion": false, + "no-submodule-imports": [false], + "no-string-literal": false, + "no-trailing-whitespace": false, + "no-var-keyword": false, + "object-literal-sort-keys": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-for-of": false, + "prefer-object-spread": false, + "space-within-parens": false, + "trailing-comma": [true, {"multiline": "never", "singleline": "never"}], + "variable-name": [true, "allow-leading-underscore"] + } +} diff --git a/tests/donut3/.codesandbox/Dockerfile b/tests/donut3/.codesandbox/Dockerfile new file mode 100644 index 000000000..adf04bd95 --- /dev/null +++ b/tests/donut3/.codesandbox/Dockerfile @@ -0,0 +1 @@ +FROM node:18 \ No newline at end of file diff --git a/tests/donut3/.codesandbox/tasks.json b/tests/donut3/.codesandbox/tasks.json new file mode 100644 index 000000000..8d92a54cd --- /dev/null +++ b/tests/donut3/.codesandbox/tasks.json @@ -0,0 +1,17 @@ +{ + // These tasks will run in order when initializing your CodeSandbox project. + "setupTasks": [ + { + "name": "Install Dependencies", + "command": "yarn install" + } + ], + // These tasks can be run from CodeSandbox. Running one will open a log in the app. + "tasks": { + "node node_modules/@angular/cli/bin/ng serve -o --disable-host-check": { + "name": "Start Project", + "command": "node node_modules/@angular/cli/bin/ng serve -o --disable-host-check", + "runAtStart": true + } + } +} \ No newline at end of file diff --git a/tests/donut3/.stackblitzrc b/tests/donut3/.stackblitzrc new file mode 100644 index 000000000..65efbb4fd --- /dev/null +++ b/tests/donut3/.stackblitzrc @@ -0,0 +1 @@ +{"installDependencies":true,"startCommand":"turbo start","env":{"ENABLE_CJS_IMPORTS":true}} \ No newline at end of file diff --git a/tests/donut3/ReadMe.md b/tests/donut3/ReadMe.md new file mode 100644 index 000000000..88e6723a3 --- /dev/null +++ b/tests/donut3/ReadMe.md @@ -0,0 +1,58 @@ + + + +This folder contains Angular application with example of Legend feature using [DoughnutChart](https://www.infragistics.com/products/ignite-ui-angular/angular/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 + +Follow these instructions to run this example: + + +- clone and navigate to this sample in terminal window + +``` +git clone https://github.com/IgniteUI/igniteui-angular-examples.git +git checkout master +cd ../samples/charts/doughnut-chart/legend +``` + + +- open above folder in VS Code or type: +``` +code . +``` + +- In terminal window, run: +``` +npm install --legacy-peer-deps +npm run-script start +``` + +- open http://localhost:4200/ in your browser + + +## Learn More + +To learn more about **Ignite UI for Angular** components, check out the [Angular documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/general-getting-started.html). diff --git a/tests/donut3/angular.json b/tests/donut3/angular.json new file mode 100644 index 000000000..11ffb8c9c --- /dev/null +++ b/tests/donut3/angular.json @@ -0,0 +1,106 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "demo": { + "root": "", + "sourceRoot": "src", + "projectType": "application", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/demo", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": [ + "zone.js", + "hammerjs" + ], + "tsConfig": "src/config/tsconfig.app.json", + "assets": [ + "src/assets" + ], + "styles": [ + "src/styles.scss" + ], + "scripts": [] + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "buildTarget": "demo:build" + }, + "configurations": { + "production": { + "buildTarget": "demo:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "buildTarget": "demo:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/config/tsconfig.spec.json", + "karmaConfig": "src/config/karma.conf.js", + "styles": [ + "styles.css" + ], + "scripts": [], + "assets": [ + "src/assets" + ] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "src/config/tsconfig.app.json", + "src/config/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + } + }, + "schematics": { + "@schematics/angular:component": { + "prefix": "app", + "style": "scss" + }, + "@schematics/angular:directive": { + "prefix": "app" + } + } +} diff --git a/tests/donut3/package.json b/tests/donut3/package.json new file mode 100644 index 000000000..fabb9adc1 --- /dev/null +++ b/tests/donut3/package.json @@ -0,0 +1,44 @@ +{ + "scripts": { + "ng": "ng", + "update": "ng update", + "start": "node --max_old_space_size=12192 node_modules/@angular/cli/bin/ng serve -o", + "build": "node --max_old_space_size=12192 node_modules/@angular/cli/bin/ng build --configuration production", + "lint": "ng lint" + }, + "dependencies": { + "@angular/animations": "17.0.0", + "@angular/common": "17.0.0", + "@angular/compiler": "17.0.0", + "@angular/core": "17.0.0", + "@angular/forms": "17.0.0", + "@angular/platform-browser": "17.0.0", + "@angular/platform-browser-dynamic": "17.0.0", + "@types/hammerjs": "2.0.39", + "classlist.js": "1.1.20150312", + "core-js": "3.21.0", + "hammerjs": "2.0.8", + "igniteui-angular-charts": "17.3.1-alpha.0", + "igniteui-angular-core": "17.3.1-alpha.0", + "intl": "1.2.5", + "jszip": "3.8.0", + "rxjs": "6.6.7", + "tslib": "2.3.1", + "web-animations-js": "2.3.2", + "zone.js": "~0.14.1" + }, + "devDependencies": { + "@angular-devkit/build-angular": "17.0.0", + "@angular/cli": "17.0.0", + "@angular/compiler-cli": "17.0.0", + "@angular/language-service": "17.0.0", + "@types/node": "14.14.28", + "codelyzer": "6.0.2", + "jasmine-core": "3.7.1", + "jasmine-spec-reporter": "~4.2.1", + "sass.js": "0.11.1", + "ts-node": "9.1.1", + "tslint": "~6.1.3", + "typescript": "5.2.2" + } +} diff --git a/tests/donut3/sandbox.config.json b/tests/donut3/sandbox.config.json new file mode 100644 index 000000000..07f53508e --- /dev/null +++ b/tests/donut3/sandbox.config.json @@ -0,0 +1,5 @@ +{ + "infiniteLoopProtection": false, + "hardReloadOnChange": false, + "view": "browser" +} \ No newline at end of file diff --git a/tests/donut3/src/EnergyGlobalDemand.ts b/tests/donut3/src/EnergyGlobalDemand.ts new file mode 100644 index 000000000..922fcf7a9 --- /dev/null +++ b/tests/donut3/src/EnergyGlobalDemand.ts @@ -0,0 +1,51 @@ +export class EnergyGlobalDemandItem { + public constructor(init: Partial) { + Object.assign(this, init); + } + + public value: number; + public category: string; + public summary: string; + +} +export class EnergyGlobalDemand extends Array { + public constructor(items: Array | number = -1) { + if (Array.isArray(items)) { + super(...items); + } else { + const newItems = [ + new EnergyGlobalDemandItem( + { + value: 37, + category: `Cooling`, + summary: `Cooling 37%` + }), + new EnergyGlobalDemandItem( + { + value: 25, + category: `Residential`, + summary: `Residential 25%` + }), + new EnergyGlobalDemandItem( + { + value: 12, + category: `Heating`, + summary: `Heating 12%` + }), + new EnergyGlobalDemandItem( + { + value: 11, + category: `Lighting`, + summary: `Lighting 11%` + }), + new EnergyGlobalDemandItem( + { + value: 15, + category: `Other`, + summary: `Other 15%` + }), + ]; + super(...(newItems.slice(0, items))); + } + } +} diff --git a/tests/donut3/src/app.component.html b/tests/donut3/src/app.component.html new file mode 100644 index 000000000..3c78e15c6 --- /dev/null +++ b/tests/donut3/src/app.component.html @@ -0,0 +1,33 @@ +
+
+ Global Electricity Demand by Energy Use +
+
+ + +
+
+ + + + +
+
diff --git a/tests/donut3/src/app.component.scss b/tests/donut3/src/app.component.scss new file mode 100644 index 000000000..cbff781da --- /dev/null +++ b/tests/donut3/src/app.component.scss @@ -0,0 +1,3 @@ +/* styles are loaded the Shared CSS file located at: +https://static.infragistics.com/xplatform/css/samples/ +*/ diff --git a/tests/donut3/src/app.component.ts b/tests/donut3/src/app.component.ts new file mode 100644 index 000000000..d7720aa4b --- /dev/null +++ b/tests/donut3/src/app.component.ts @@ -0,0 +1,39 @@ +import { AfterViewInit, Component, ViewChild, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core'; +import { EnergyGlobalDemandItem, EnergyGlobalDemand } from './EnergyGlobalDemand'; +import { IgxItemLegendComponent, IgxDoughnutChartComponent, IgxRingSeriesComponent } from 'igniteui-angular-charts'; + +@Component({ + selector: "app-root", + styleUrls: ["./app.component.scss"], + templateUrl: "./app.component.html", + changeDetection: ChangeDetectionStrategy.OnPush +}) + +export class AppComponent implements AfterViewInit +{ + + @ViewChild("legend", { static: true } ) + private legend: IgxItemLegendComponent + @ViewChild("chart", { static: true } ) + private chart: IgxDoughnutChartComponent + @ViewChild("series", { static: true } ) + private series: IgxRingSeriesComponent + private _energyGlobalDemand: EnergyGlobalDemand = null; + public get energyGlobalDemand(): EnergyGlobalDemand { + if (this._energyGlobalDemand == null) + { + this._energyGlobalDemand = new EnergyGlobalDemand(); + } + return this._energyGlobalDemand; + } + + public constructor(private _detector: ChangeDetectorRef) + { + } + + public ngAfterViewInit(): void + { + } + +} + diff --git a/tests/donut3/src/app.module.ts b/tests/donut3/src/app.module.ts new file mode 100644 index 000000000..7d4332c43 --- /dev/null +++ b/tests/donut3/src/app.module.ts @@ -0,0 +1,26 @@ +import { NgModule } from "@angular/core"; +import { FormsModule } from "@angular/forms"; +import { CommonModule } from "@angular/common"; +import { BrowserModule } from "@angular/platform-browser"; +import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { AppComponent } from "./app.component"; + +import { IgxItemLegendModule, IgxDoughnutChartModule } from 'igniteui-angular-charts'; + +@NgModule({ + bootstrap: [AppComponent], + declarations: [ + AppComponent +], + imports: [ + BrowserModule, + BrowserAnimationsModule, + CommonModule, + FormsModule, + IgxItemLegendModule, + IgxDoughnutChartModule +], + providers: [], + schemas: [] +}) +export class AppModule {} diff --git a/tests/donut3/src/config/tsconfig-es5.app.json b/tests/donut3/src/config/tsconfig-es5.app.json new file mode 100644 index 000000000..7e8983eb4 --- /dev/null +++ b/tests/donut3/src/config/tsconfig-es5.app.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.app.json", + "compilerOptions": { + "target": "ES2022" + } + } diff --git a/tests/donut3/src/config/tsconfig.app.json b/tests/donut3/src/config/tsconfig.app.json new file mode 100644 index 000000000..f722e3fe4 --- /dev/null +++ b/tests/donut3/src/config/tsconfig.app.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "../../out-tsc/app", + "baseUrl": "./", + "types": [] + }, + "files": [ + "../main.ts", + "../polyfills.ts" + ] +} diff --git a/tests/donut3/src/config/tsconfig.base.json b/tests/donut3/src/config/tsconfig.base.json new file mode 100644 index 000000000..5574be5e5 --- /dev/null +++ b/tests/donut3/src/config/tsconfig.base.json @@ -0,0 +1,24 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "importHelpers": true, + "module": "ES2022", + "outDir": "../../dist/out-tsc", + "sourceMap": false, + "declaration": false, + "moduleResolution": "node", + "experimentalDecorators": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "downlevelIteration": true, // required for excel library + "target": "ES2022", + "typeRoots": [ + "../../node_modules/@types" + ], + "lib": [ + "ES2022", + "dom" + ], + "useDefineForClassFields": false + } +} diff --git a/tests/donut3/src/config/tsconfig.spec.json b/tests/donut3/src/config/tsconfig.spec.json new file mode 100644 index 000000000..6eb8c055c --- /dev/null +++ b/tests/donut3/src/config/tsconfig.spec.json @@ -0,0 +1,19 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "../../out-tsc/spec", + "baseUrl": "./", + "types": [ + "jasmine", + "node" + ] + }, + "files": [ + "../test.ts", + "../polyfills.ts" + ], + "include": [ + "../**/*.spec.ts", + "../**/*.d.ts" + ] +} diff --git a/tests/donut3/src/config/tsconfig.worker.json b/tests/donut3/src/config/tsconfig.worker.json new file mode 100644 index 000000000..4867b1275 --- /dev/null +++ b/tests/donut3/src/config/tsconfig.worker.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "../../out-tsc/worker", + "lib": [ + "ES2022", + "DOM" + ], + "types": [] + }, + "include": [ + "../**/*Worker.ts" + ] +} diff --git a/tests/donut3/src/environments/environment.prod.ts b/tests/donut3/src/environments/environment.prod.ts new file mode 100644 index 000000000..3612073bc --- /dev/null +++ b/tests/donut3/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/tests/donut3/src/environments/environment.ts b/tests/donut3/src/environments/environment.ts new file mode 100644 index 000000000..7b4f817ad --- /dev/null +++ b/tests/donut3/src/environments/environment.ts @@ -0,0 +1,16 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false +}; + +/* + * For easier debugging in development mode, you can import the following file + * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. + * + * This import should be commented out in production mode because it will have a negative impact + * on performance if an error is thrown. + */ +// import 'zone.js/dist/zone-error'; // Included with Angular CLI. diff --git a/tests/donut3/src/index.html b/tests/donut3/src/index.html new file mode 100644 index 000000000..7650dfb64 --- /dev/null +++ b/tests/donut3/src/index.html @@ -0,0 +1,23 @@ + + + + + + IgniteUI for Angular | Example | infragistics + + + + + + + + + + + + + + + + + diff --git a/tests/donut3/src/main.ts b/tests/donut3/src/main.ts new file mode 100644 index 000000000..ec9adcd4a --- /dev/null +++ b/tests/donut3/src/main.ts @@ -0,0 +1,15 @@ +// tslint:disable:no-string-literal +import "./polyfills"; +import { enableProdMode } from "@angular/core"; +import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; +import { AppModule } from "./app.module"; + +platformBrowserDynamic().bootstrapModule(AppModule).then(ref => { + // ensure Angular destroys itself on hot reloads. + if (window["ngRef"]) { + window["ngRef"].destroy(); + } + window["ngRef"] = ref; + + // otherwise, log the boot error +}).catch(err => console.error(err)); diff --git a/tests/donut3/src/polyfills.ts b/tests/donut3/src/polyfills.ts new file mode 100644 index 000000000..d583cff9c --- /dev/null +++ b/tests/donut3/src/polyfills.ts @@ -0,0 +1,65 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** +* BROWSER POLYFILLS +*/ + +// import "core-js/es7/object"; + +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +//import "classlist.js"; // run `npm install --save classlist.js`. + +/** IE10 and IE11 requires the following for the Reflect API. */ +// import "core-js/es6/reflect"; + +/* Evergreen browsers require these. */ +// used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. +// import "core-js/es7/reflect"; + +/* + * Required to support Web Animations `@angular/platform-browser/animations`. + * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation + */ +//import "web-animations-js"; // run `npm install --save web-animations-js`. + +/*************************************************************************************************** + * Zone JS is required by Angular itself. + */ +import "hammerjs/hammer"; +import "zone.js"; // included with Angular CLI. + +/*************************************************************************************************** + * @angular/animations polyfill + */ +// if (!Element.prototype.matches) { +// Element.prototype.matches = (Element.prototype as any).msMatchesSelector; +// } + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ + +/** + * Date, currency, decimal and percent pipes. + * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 + */ +// import "intl"; // Run `npm install --save intl`. +// import "intl/locale-data/jsonp/de"; +/** + * Need to import at least one locale-data with intl. + */ +// import "intl/locale-data/jsonp/en"; diff --git a/tests/donut3/src/styles.scss b/tests/donut3/src/styles.scss new file mode 100644 index 000000000..9b431e92d --- /dev/null +++ b/tests/donut3/src/styles.scss @@ -0,0 +1,9 @@ +/* autoprefixer grid: on */ +html, +body { + height: 100%; + width: 100%; + overflow: hidden; + margin: 0; + box-sizing: border-box; +} diff --git a/tests/donut3/src/typings.d.ts b/tests/donut3/src/typings.d.ts new file mode 100644 index 000000000..ef5c7bd62 --- /dev/null +++ b/tests/donut3/src/typings.d.ts @@ -0,0 +1,5 @@ +/* SystemJS module definition */ +declare var module: NodeModule; +interface NodeModule { + id: string; +} diff --git a/tests/donut3/tsconfig.json b/tests/donut3/tsconfig.json new file mode 100644 index 000000000..1aaac63d3 --- /dev/null +++ b/tests/donut3/tsconfig.json @@ -0,0 +1,21 @@ +/* + This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. + It is not intended to be used to perform a compilation. + + To learn more about this file see: https://angular.io/config/solution-tsconfig. +*/ +{ + "useDefineForClassFields": false, + "files": [], + "references": [ + { + "path": "./src/config/tsconfig.app.json" + }, + { + "path": "./src/config/tsconfig.worker.json" + }, + { + "path": "./src/config/tsconfig.spec.json" + } + ] +} \ No newline at end of file diff --git a/tests/donut3/tslint.json b/tests/donut3/tslint.json new file mode 100644 index 000000000..777c777d9 --- /dev/null +++ b/tests/donut3/tslint.json @@ -0,0 +1,31 @@ +{ + "extends": "tslint:latest", + "rules": { + "deprecation": { + "severity": "warning" + }, + "arrow-parens": false, + "indent": [true, "spaces"], + "interface-name": [true, "always-prefix"], + "max-classes-per-file": false, + "no-bitwise": false, + "no-console": false, + "no-empty": false, + "no-duplicate-imports": false, + "no-implicit-dependencies": false, + "no-object-literal-type-assertion": false, + "no-submodule-imports": [false], + "no-string-literal": false, + "no-trailing-whitespace": false, + "no-var-keyword": false, + "object-literal-sort-keys": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-for-of": false, + "prefer-object-spread": false, + "space-within-parens": false, + "trailing-comma": [true, {"multiline": "never", "singleline": "never"}], + "variable-name": [true, "allow-leading-underscore"] + } +} diff --git a/tests/treegrid/.codesandbox/Dockerfile b/tests/treegrid/.codesandbox/Dockerfile new file mode 100644 index 000000000..adf04bd95 --- /dev/null +++ b/tests/treegrid/.codesandbox/Dockerfile @@ -0,0 +1 @@ +FROM node:18 \ No newline at end of file diff --git a/tests/treegrid/.codesandbox/tasks.json b/tests/treegrid/.codesandbox/tasks.json new file mode 100644 index 000000000..8d92a54cd --- /dev/null +++ b/tests/treegrid/.codesandbox/tasks.json @@ -0,0 +1,17 @@ +{ + // These tasks will run in order when initializing your CodeSandbox project. + "setupTasks": [ + { + "name": "Install Dependencies", + "command": "yarn install" + } + ], + // These tasks can be run from CodeSandbox. Running one will open a log in the app. + "tasks": { + "node node_modules/@angular/cli/bin/ng serve -o --disable-host-check": { + "name": "Start Project", + "command": "node node_modules/@angular/cli/bin/ng serve -o --disable-host-check", + "runAtStart": true + } + } +} \ No newline at end of file diff --git a/tests/treegrid/.stackblitzrc b/tests/treegrid/.stackblitzrc new file mode 100644 index 000000000..dd44ea00f --- /dev/null +++ b/tests/treegrid/.stackblitzrc @@ -0,0 +1 @@ +{"installDependencies":true, "startCommand":"npm start"} \ No newline at end of file diff --git a/tests/treegrid/angular.json b/tests/treegrid/angular.json new file mode 100644 index 000000000..f2ace893e --- /dev/null +++ b/tests/treegrid/angular.json @@ -0,0 +1,110 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "example-app": { + "projectType": "application", + "schematics": { + "@schematics/angular:component": { + "style": "scss" + }, + "@schematics/angular:application": { + "strict": true + } + }, + "root": "", + "sourceRoot": "src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/example-app", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.app.json", + "inlineStyleLanguage": "scss", + "assets": ["src/favicon.ico", "src/assets"], + "styles": ["src/styles.scss"], + "stylePreprocessorOptions": { + "includePaths": ["node_modules/"] + }, + "scripts": [] + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "outputHashing": "all" + }, + "development": { + "buildOptimizer": false, + "optimization": false, + "vendorChunk": true, + "extractLicenses": false, + "sourceMap": true, + "namedChunks": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "configurations": { + "production": { + "browserTarget": "example-app:build:production" + }, + "development": { + "browserTarget": "example-app:build:development" + } + }, + "defaultConfiguration": "development" + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "example-app:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.spec.json", + "karmaConfig": "karma.conf.js", + "inlineStyleLanguage": "scss", + "assets": ["src/favicon.ico", "src/assets"], + "stylePreprocessorOptions": { + "includePaths": ["node_modules/"] + }, + "styles": ["src/styles.scss", "src/theme.scss"], + "scripts": [] + } + } + } + } + }, + "defaultProject": "example-app", + "cli": { + "analytics": false + } +} diff --git a/tests/treegrid/package.json b/tests/treegrid/package.json new file mode 100644 index 000000000..958b9ca33 --- /dev/null +++ b/tests/treegrid/package.json @@ -0,0 +1,30 @@ +{ + "dependencies": { + "@angular/animations": "^17.2.1", + "@angular/common": "^17.2.1", + "@angular/compiler": "^17.2.1", + "@angular/core": "^17.2.1", + "@angular/forms": "^17.2.1", + "@angular/platform-browser": "^17.2.1", + "@angular/platform-browser-dynamic": "^17.2.1", + "@angular/router": "^17.2.1", + "@types/hammerjs": "^2.0.39", + "hammerjs": "^2.0.8", + "igniteui-angular": "17.1.0-rc.0", + "igniteui-angular-charts": "17.2.1", + "igniteui-angular-core": "17.2.1", + "rxjs": "^7.8.1", + "tslib": "^2.6.1", + "zone.js": "~0.14.4" + }, + "devDependencies": { + "@angular-devkit/build-angular": "17.2.0", + "@angular/cli": "17.2.0", + "@angular/compiler-cli": "17.2.1", + "@angular/language-service": "17.2.1", + "@types/node": "18.17.0", + "jasmine-core": "5.1.1", + "ts-node": "10.9.1", + "typescript": "5.3.3" + } +} \ No newline at end of file diff --git a/tests/treegrid/src/_app-layout.scss b/tests/treegrid/src/_app-layout.scss new file mode 100644 index 000000000..b5329f55b --- /dev/null +++ b/tests/treegrid/src/_app-layout.scss @@ -0,0 +1,84 @@ +.sample-wrapper { + width: inherit; + position: relative; + height: 100%; + margin: 0 auto; + background: transparent; +} + +.sample-content { + display: flex; + flex-grow: 1; + flex-flow: row wrap; + justify-content: flex-start; + padding: 0; + -webkit-animation: fade-in .3s cubic-bezier(0.390, 0.575, 0.565, 1.000) both; + -moz-animation: fade-in .3s cubic-bezier(0.390, 0.575, 0.565, 1.000) both; + animation: fade-in .3s cubic-bezier(0.390, 0.575, 0.565, 1.000) both; +} + +.sample-column { + display: flex; + flex-flow: column nowrap; + flex: 1 0 25%; + align-content: flex-start; + margin: 16px; + min-width: 280px; +} + +.sample-title { + color: #0375be; + margin-bottom: 12px; + margin-top: 12px; +} + +.sample-title .light { + font-weight: 400; +} + +.sample-description { + font-size: 14px; + font-weight: normal; + color: #717171; +} + +@-webkit-keyframes color-change-2x { + 0% { + background: #fdf8f0; + } + 100% { + background: #f6e7ec; + } +} + +@keyframes color-change-2x { + 0% { + background: #fdf8f0; + } + 100% { + background: #f6e7ec; + } +} + +@-webkit-keyframes fade-in { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + +@keyframes fade-in { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + +.headerAlignSyle { + text-align: right !important; +} + diff --git a/tests/treegrid/src/_variables.scss b/tests/treegrid/src/_variables.scss new file mode 100644 index 000000000..011944da5 --- /dev/null +++ b/tests/treegrid/src/_variables.scss @@ -0,0 +1,18 @@ +@use 'igniteui-angular/theming' as *; +@forward 'igniteui-angular/theming'; + +$palette: $light-material-palette; +$schema: $light-material-schema; + +$green-palette: palette( + $primary: #09f, + $secondary: #72da67, + $gray: #fff, + $surface: #333, + $info: color($palette, 'info'), + $success: color($palette, 'success'), + $warn: color($palette, 'warn'), + $error: color($palette, 'error'), +); + +$gray-btn-color: color($green-palette, 'gray', 800); diff --git a/tests/treegrid/src/app/app.component.html b/tests/treegrid/src/app/app.component.html new file mode 100644 index 000000000..3ae58c22c --- /dev/null +++ b/tests/treegrid/src/app/app.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/treegrid/src/app/app.component.scss b/tests/treegrid/src/app/app.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/tests/treegrid/src/app/app.component.ts b/tests/treegrid/src/app/app.component.ts new file mode 100644 index 000000000..0fd0d7e3a --- /dev/null +++ b/tests/treegrid/src/app/app.component.ts @@ -0,0 +1,8 @@ +import { Component } from "@angular/core"; + +@Component({ + selector: "app-root", + styleUrls: ["./app.component.scss"], + templateUrl: "./app.component.html" +}) +export class AppComponent {} \ No newline at end of file diff --git a/tests/treegrid/src/app/app.module.ts b/tests/treegrid/src/app/app.module.ts new file mode 100644 index 000000000..d12cc778f --- /dev/null +++ b/tests/treegrid/src/app/app.module.ts @@ -0,0 +1,41 @@ +import { NgModule } from "@angular/core"; +import { FormsModule } from "@angular/forms"; +import { BrowserModule } from "@angular/platform-browser"; +import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { AppComponent } from "./app.component"; +import { IgxPreventDocumentScrollModule } from "./directives/prevent-scroll.directive"; +import { + IgxTreeGridModule, + IgxExcelExporterService, + IgxCsvExporterService + } from "igniteui-angular"; +import { TreeGridChilddatakeySampleComponent } from "./tree-grid-childdatakey-sample/tree-grid-childdatakey-sample.component"; +import { + IgxSparklineCoreModule, + IgxSparklineModule + } from "igniteui-angular-charts"; + + + +@NgModule({ + bootstrap: [AppComponent], + declarations: [ + AppComponent, + TreeGridChilddatakeySampleComponent +], + imports: [ + BrowserModule, + BrowserAnimationsModule, + FormsModule, + IgxPreventDocumentScrollModule, + IgxTreeGridModule, + IgxSparklineCoreModule, + IgxSparklineModule +], + providers: [ + IgxExcelExporterService, + IgxCsvExporterService +], + schemas: [] +}) +export class AppModule {} diff --git a/tests/treegrid/src/app/directives/prevent-scroll.directive.ts b/tests/treegrid/src/app/directives/prevent-scroll.directive.ts new file mode 100644 index 000000000..11c97caa1 --- /dev/null +++ b/tests/treegrid/src/app/directives/prevent-scroll.directive.ts @@ -0,0 +1,62 @@ +import { AfterViewInit, Directive, Host, Input, NgModule, Optional, OnDestroy, Inject } from '@angular/core'; +import { GridType, IGX_GRID_BASE } from 'igniteui-angular'; + +@Directive({ + // eslint-disable-next-line @angular-eslint/directive-selector + selector: '[igxPreventDocumentScroll]' +}) +export class IgxPreventDocumentScrollDirective implements AfterViewInit, OnDestroy { + private _preventScroll = true; + private gridBody: HTMLElement; + + /** + * A boolean indicating if page scroll should be prevented while mouse wheeling over the grid, + * when grid scroll has reached top or bottom. Defaults to true. + * ```html + * + * + * ``` + */ + @Input('igxPreventDocumentScroll') + public set preventScroll(val: boolean) { + if (val === false) { this._preventScroll = false; } + } + + /** + * @hidden + */ + constructor(@Host() @Optional() @Inject(IGX_GRID_BASE) private grid: GridType) { + } + + public ngAfterViewInit() { + this.gridBody = this.getGridTBody(); + if (this._preventScroll) { + this.gridBody.addEventListener('wheel', this.preventDocumentScroll, { passive: false }); + } + } + + public ngOnDestroy() { + this.gridBody.removeEventListener('wheel', this.preventDocumentScroll); + } + + /** + * Prevents scrolling the page, when mouse wheel over the grid body. + */ + private preventDocumentScroll(event) { + event.preventDefault(); + } + + private getGridTBody(): HTMLElement { + return this.grid.tbody.nativeElement; + } +} + +/** + * @hidden + */ +@NgModule({ + declarations: [IgxPreventDocumentScrollDirective], + exports: [IgxPreventDocumentScrollDirective] +}) + +export class IgxPreventDocumentScrollModule { } diff --git a/tests/treegrid/src/app/tree-grid-childdatakey-sample/data.ts b/tests/treegrid/src/app/tree-grid-childdatakey-sample/data.ts new file mode 100644 index 000000000..f8e385339 --- /dev/null +++ b/tests/treegrid/src/app/tree-grid-childdatakey-sample/data.ts @@ -0,0 +1,125 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +export const EMPLOYEE_DATA = [ + { + Age: 55, + Employees: [ + { + Age: 43, + Employees: [], + HireDate: new Date(2011, 6, 3), + ID: 3, + Name: 'Michael Burke' + }, + { + Age: 29, + Employees: undefined, + HireDate: new Date(2009, 6, 19), + ID: 2, + Name: 'Thomas Anderson' + }, + { + Age: 31, + Employees: [ + { + Age: 35, + HireDate: new Date(2015, 9, 17), + ID: 6, + Name: 'Roland Mendel' + }, + { + Age: 44, + HireDate: new Date(2009, 10, 11), + ID: 12, + Name: 'Sven Cooper' + } + ], + HireDate: new Date(2014, 8, 18), + ID: 11, + Name: 'Monica Reyes' + }], + HireDate: new Date(2008, 3, 20), + ID: 1, + Name: 'Johnathan Winchester' + }, + { + Age: 42, + Employees: [ + { + Age: 44, + HireDate: new Date(2014, 4, 4), + ID: 14, + Name: 'Laurence Johnson' + }, + { + Age: 25, + Employees: [ + { + Age: 39, + HireDate: new Date(2010, 3, 22), + ID: 13, + Name: 'Trevor Ashworth' + } + ], + HireDate: new Date(2017, 11, 9), + ID: 5, + Name: 'Elizabeth Richards' + }], + HireDate: new Date(2014, 1, 22), + ID: 4, + Name: 'Ana Sanders' + }, + { + Age: 49, + Employees: [ + { + Age: 44, + Employees: [], + HireDate: new Date(2014, 4, 4), + ID: 17, + Name: 'Antonio Moreno' + }], + HireDate: new Date(2014, 1, 22), + ID: 18, + Name: 'Victoria Lincoln' + }, + { + Age: 61, + Employees: [ + { + Age: 50, + Employees: [ + { + Age: 25, + Employees: [], + HireDate: new Date(2017, 11, 9), + ID: 15, + Name: 'Patricia Simpson' + }, + { + Age: 39, + HireDate: new Date(2010, 3, 22), + ID: 9, + Name: 'Francisco Chang' + }, + { + Age: 25, + HireDate: new Date(2018, 3, 18), + ID: 16, + Name: 'Peter Lewis' + } + ], + HireDate: new Date(2007, 11, 18), + ID: 7, + Name: 'Pedro Rodriguez' + }, + { + Age: 27, + HireDate: new Date(2016, 2, 19), + ID: 8, + Name: 'Casey Harper' + }], + HireDate: new Date(2010, 1, 1), + ID: 10, + Name: 'Yang Wang' + } +]; diff --git a/tests/treegrid/src/app/tree-grid-childdatakey-sample/tree-grid-childdatakey-sample.component.html b/tests/treegrid/src/app/tree-grid-childdatakey-sample/tree-grid-childdatakey-sample.component.html new file mode 100644 index 000000000..e7880eef7 --- /dev/null +++ b/tests/treegrid/src/app/tree-grid-childdatakey-sample/tree-grid-childdatakey-sample.component.html @@ -0,0 +1,32 @@ +
+ + + + Employees + + + + + Export to Excel + Export to CSV + + + + + + + + + + + + + + +
diff --git a/tests/treegrid/src/app/tree-grid-childdatakey-sample/tree-grid-childdatakey-sample.component.scss b/tests/treegrid/src/app/tree-grid-childdatakey-sample/tree-grid-childdatakey-sample.component.scss new file mode 100644 index 000000000..2649777ff --- /dev/null +++ b/tests/treegrid/src/app/tree-grid-childdatakey-sample/tree-grid-childdatakey-sample.component.scss @@ -0,0 +1,3 @@ +.grid__wrapper { + margin: 15px; +} diff --git a/tests/treegrid/src/app/tree-grid-childdatakey-sample/tree-grid-childdatakey-sample.component.ts b/tests/treegrid/src/app/tree-grid-childdatakey-sample/tree-grid-childdatakey-sample.component.ts new file mode 100644 index 000000000..99bb75fc3 --- /dev/null +++ b/tests/treegrid/src/app/tree-grid-childdatakey-sample/tree-grid-childdatakey-sample.component.ts @@ -0,0 +1,58 @@ +import { Component, OnInit } from '@angular/core'; +import { GridSelectionMode, IColumnExportingEventArgs, IgxCsvExporterService, IgxExcelExporterService } from 'igniteui-angular'; +import { EMPLOYEE_DATA } from './data'; + +@Component({ + selector: 'app-tree-grid-childdatakey-sample', + styleUrls: ['./tree-grid-childdatakey-sample.component.scss'], + templateUrl: './tree-grid-childdatakey-sample.component.html' +}) +export class TreeGridChilddatakeySampleComponent implements OnInit { + public localData: any[]; + public selectionMode: GridSelectionMode = 'multiple'; + constructor(private excelExporter: IgxExcelExporterService, private csvExporter: IgxCsvExporterService) { + const skipColumnExport = (eventArgs: IColumnExportingEventArgs) => { + eventArgs.cancel = eventArgs.header === 'Performance'; + }; + + this.excelExporter.columnExporting.subscribe(skipColumnExport); + this.csvExporter.columnExporting.subscribe(skipColumnExport); + } + + public ngOnInit() { + const employees = EMPLOYEE_DATA; + for (const employee of employees) { + this.getPerformance(employee); + } + this.localData = employees; + } + + public getPerformance(employee: any): any { + employee['Performance'] = this.getPerformanceData(12); + const hasEmployees = employee.Employees === undefined; + if (hasEmployees) { + return employee; + } else { + for (const employer of employee.Employees) { + this.getPerformance(employer); + } + } + } + + public getPerformanceData(weeks?: number): any[] { + if (weeks === undefined) { + weeks = 20; + } + const performance: any[] = []; + for (let w = 0; w < weeks; w++) { + const value = this.getRandomNumber(0, 100); + // eslint-disable-next-line @typescript-eslint/naming-convention + performance.push({Points: value, Week: w}); + } + return performance; + } + + public getRandomNumber(min: number, max: number): number { + return Math.round(min + Math.random() * (max - min)); + } +} diff --git a/tests/treegrid/src/environments/environment.prod.ts b/tests/treegrid/src/environments/environment.prod.ts new file mode 100644 index 000000000..c9669790b --- /dev/null +++ b/tests/treegrid/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true, +}; diff --git a/tests/treegrid/src/environments/environment.ts b/tests/treegrid/src/environments/environment.ts new file mode 100644 index 000000000..66998ae9a --- /dev/null +++ b/tests/treegrid/src/environments/environment.ts @@ -0,0 +1,16 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false, +}; + +/* + * For easier debugging in development mode, you can import the following file + * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. + * + * This import should be commented out in production mode because it will have a negative impact + * on performance if an error is thrown. + */ +// import 'zone.js/plugins/zone-error'; // Included with Angular CLI. diff --git a/tests/treegrid/src/index.html b/tests/treegrid/src/index.html new file mode 100644 index 000000000..44cb36c74 --- /dev/null +++ b/tests/treegrid/src/index.html @@ -0,0 +1,31 @@ + + + + + + + + + $OG_TITLE + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/treegrid/src/main.ts b/tests/treegrid/src/main.ts new file mode 100644 index 000000000..551d91605 --- /dev/null +++ b/tests/treegrid/src/main.ts @@ -0,0 +1,16 @@ +import './polyfills'; + +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; + +platformBrowserDynamic().bootstrapModule(AppModule).then(ref => { + // Ensure Angular destroys itself on hot reloads. + if (window['ngRef']) { + window['ngRef'].destroy(); + } + window['ngRef'] = ref; + + // Otherwise, log the boot error +}).catch(err => console.error(err)); diff --git a/tests/treegrid/src/polyfills.ts b/tests/treegrid/src/polyfills.ts new file mode 100644 index 000000000..665b7dacb --- /dev/null +++ b/tests/treegrid/src/polyfills.ts @@ -0,0 +1,58 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called 'evergreen' browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** +* BROWSER POLYFILLS +*/ + +//import 'core-js/es7/object'; + +//import 'core-js/es7/array'; // for Array.includes() // Run `npm install --save classlist.js`. + +/** IE10 and IE11 requires the following for the Reflect API. */ +//import 'core-js/es6/reflect'; + +/* Evergreen browsers require these. */ +// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. +//import 'core-js/es7/reflect'; // Run `npm install --save web-animations-js`. + +/*************************************************************************************************** + * Zone JS is required by Angular itself. + */ +import 'hammerjs/hammer'; +import 'zone.js'; // Included with Angular CLI. + +/*************************************************************************************************** + * @angular/animations polyfill + */ +// if (!Element.prototype.matches) { +// Element.prototype.matches = (Element.prototype as any).msMatchesSelector; +// } + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ + +/** + * Date, currency, decimal and percent pipes. + * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 + */ +// import 'intl'; // Run `npm install --save intl`. +// import 'intl/locale-data/jsonp/de'; +/** + * Need to import at least one locale-data with intl. + */ +// import 'intl/locale-data/jsonp/en'; diff --git a/tests/treegrid/src/styles.scss b/tests/treegrid/src/styles.scss new file mode 100644 index 000000000..aae2eec21 --- /dev/null +++ b/tests/treegrid/src/styles.scss @@ -0,0 +1,49 @@ +@use 'igniteui-angular/theming' as *; +@use 'variables' as *; +@use 'app-layout'; +/* autoprefixer grid: on */ +html, +body { + height: 100%; + overflow: hidden; + margin: 0; +} +@include core(); +@include typography(); +@include theme( + $palette: $palette, + $schema: $schema +); +:root { + @include palette($palette); +} +.light-theme { + @include light-theme($palette); +} +.dark-theme { + background: #333; + color: #fff; + @include dark-theme( + $palette: $green-palette + ); + .grid-chart-contextmenu-wrapper { + @include fluent-dark-theme($fluent-excel-palette); + } + // remove this workaround after resolving https://github.com/IgniteUI/igniteui-angular/issues/13039 + igx-grid, + igx-hierarchical-grid, + igx-pivot-grid, + igx-tree-grid { + --igx-chip-disabled-background: #616161; + --igx-chip-disabled-border-color: #616161; + --igx-chip-disabled-text-color: #BDBDBD; + } +} +.fin-dark-theme { + @include dark-theme($green-palette); + background: #333; + + ::-moz-placeholder { + opacity: 1; + } +} \ No newline at end of file diff --git a/tests/treegrid/tsconfig.app.json b/tests/treegrid/tsconfig.app.json new file mode 100644 index 000000000..ff396d4ce --- /dev/null +++ b/tests/treegrid/tsconfig.app.json @@ -0,0 +1,10 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/app", + "types": [] + }, + "files": ["src/main.ts", "src/polyfills.ts"], + "include": ["src/**/*.d.ts"] +} diff --git a/tests/treegrid/tsconfig.json b/tests/treegrid/tsconfig.json new file mode 100644 index 000000000..3e90bf364 --- /dev/null +++ b/tests/treegrid/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "downlevelIteration": true, + "experimentalDecorators": true, + "module": "esnext", + "moduleResolution": "node", + "importHelpers": true, + "target": "es2015", + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2018", + "dom" + ] + }, + "angularCompilerOptions": { + "enableIvy": true + } +} \ No newline at end of file