This commit is contained in:
Dimo Dimov 2021-04-07 10:10:44 +03:00
Родитель c9429fa412
Коммит bbb818f890
30 изменённых файлов: 35974 добавлений и 0 удалений

17
.browserslistrc Normal file
Просмотреть файл

@ -0,0 +1,17 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

49
.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,49 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out
# dependencies
/node_modules
# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db
# Kendo UI Angular license file
kendo-ui-license.txt

28
CONTRIBUTNG.md Normal file
Просмотреть файл

@ -0,0 +1,28 @@
# Guidelines to Contribution
We accept third-party contributions.
## Ways to Contribute
You can contribute by:
* Submitting bug-fixes.
* Proposing changes in documentation or updates to existing code.
* Adding features or missing functionalities.
## Steps to Contribute
To submit your suggestions:
1. If a first-time contributor, read and sign the [Kendo UI for Angular Contribution License Agreement (CLA)](https://docs.google.com/forms/d/e/1FAIpQLSdSzuLLij8dtytTeiXCzlHcTmHYZIxgrAa7BSaO_fno79ua1A/viewform?c=0&w=1). The Agreement confirms that you acknowledge the legal aspects of your contributions.
1. Branch out the repo you want to update.
1. Add your contribution.
1. Submit a [Pull Request](https://help.github.com/articles/creating-a-pull-request/).
## Support-Related Issues
Refer to our [**Community & Support**](http://www.telerik.com/kendo-angular-ui/support/) page for more information on:
* How to report a bug
* New upcoming features
* Support-related questions

67
LICENSE.md Normal file
Просмотреть файл

@ -0,0 +1,67 @@
End User License Agreement for Progress Telerik UI Product Sample/Demo Code
(Last Updated May 21, 2020)
IMPORTANT – PLEASE READ THIS END USER LICENSE AGREEMENT (THE "AGREEMENT") CAREFULLY BEFORE ATTEMPTING TO DOWNLOAD OR USE ANY SOFTWARE, DOCUMENTATION, OR OTHER MATERIALS MADE AVAILABLE BY PROGRESS SOFTWARE CORPORATION THROUGH THIS REPOSITORY. THIS AGREEMENT CONSTITUTES A LEGALLY BINDING AGREEMENT BETWEEN YOU OR THE COMPANY WHICH YOU REPRESENT AND ARE AUTHORIZED TO BIND (the "Licensee" or "You"), AND PROGRESS SOFTWARE CORPORATION ("Progress" or "Licensor"). BY DOWNLOADING, INSTALLING, OR OTHERWISE USING THE SOFTWARE (AS DEFINED BELOW) YOU ACKNOWLEDGE (1) THAT YOU HAVE READ THIS AGREEMENT, (2) THAT YOU UNDERSTAND IT, (3) THAT YOU AGREE TO BE BOUND BY ITS TERMS AND CONDITIONS, AND (4) TO THE EXTENT YOU ARE ENTERING INTO THIS AGREEMENT ON BEHALF OF A COMPANY, YOU HAVE THE POWER AND AUTHORITY TO BIND THAT COMPANY.
This Software (as defined below) is licensed to You for use with validly licensed Telerik UI Products only. Telerik UI Products are those Progress Products containing the designation "UI" within the product name. This Agreement is a license agreement and not an agreement for sale. This Agreement does not grant You a license or any rights to use or distribute Telerik UI Products. To obtain more information about Telerik UI Products and/or to obtain a license for one or more Telerik UI Products please visit www.telerik.com or www.progress.com.
You are granted the following limited license rights while You maintain, and are in compliance with the terms of, a valid license to one or more Telerik UI Product(s) (a "UI Product License").
1. Software License
1.1 License Grant. Subject to the terms and conditions set forth in this Agreement, Progress hereby grants to Licensee and Licensee hereby accepts, a limited, non-transferable, perpetual, sublicenseable (solely as set forth in Section 1.2), non-exclusive license (the "License") to use the software code and documentation which this Agreement accompanied (the "Software") solely in connection with your licensed use of the Telerik UI Product(s).
1.2 Scope of Use. You may use the Software for the purposes of exploring and understanding the capabilities and functionality of the Telerik UI Product(s). You may also use the Software as a starting point to build or to enhance Your Integrated Products. You may embed copies of certain portions the Programs in Your Integrated Products that You license and distribute solely in accordance with the requirements set forth in the UI Product License. For purposes of this Agreement "Integrated Products" has the meaning provided in Your UI Product License.
1.3 Source Code for the Software. In cases where the Softwares source code is provided to You by Progress, it is provided so that You can create modifications under the terms of this Agreement. While Progress does not claim any ownership rights in Your Integrated Products, any modifications You develop to the Software source code will be the exclusive property of Progress, and You agree to and hereby do assign all right, title and interest in and to such modifications and all rights associated therewith to Progress. You will be entitled to use modifications of the Softwares source code developed by You under the terms of this Agreement and Progress hereby grants You a license to use such modifications pursuant to the terms of this Agreement. Except to the limited extent as is permitted by law notwithstanding contractual prohibition, You are not allowed to disassemble, decompile or "unlock", decode or otherwise reverse translate or engineer, or attempt in any manner to reconstruct or discover any source code or underlying algorithms of Software that is provided to You in object code form only.
2. Term and Termination
This Agreement and the License granted hereunder shall continue for as long as You use the Software in compliance with the terms herein and shall automatically self-terminate upon Your noncompliance with the terms of this Agreement.
3. Intellectual Property
All title and ownership rights in and to the Software and content (including but not limited to any images, photographs, animations, video, audio, music, or text embedded in the Software), the intellectual property embodied in the Software and content, and any trademarks or service marks of Progress that are used in connection with the Software and/or content are and shall at all times remain exclusively owned by Progress and its licensors. All title and intellectual property rights in and to the content that may be accessed through use of the Software is the property of the respective content owner and may be protected by applicable copyright or other intellectual property laws and treaties. This Agreement grants You no rights to use or redistribute such content. Any open source software that may be delivered by Progress embedded in or in association with the Software is provided pursuant to the open source license applicable to the software and subject to the disclaimers and limitations on liability set forth in such license.
4. Collection and Use of Data.
Progress uses tools to deliver certain Software features and extensions, identify trends and bugs, collect activation information, usage statistics and track other data related to Your use of the Software as further described in the most current version of Progresss Privacy Policy (located at: https://www.progress.com/legal/privacy-policy). By Your acceptance of the terms of this Agreement and/or use of the Software, You authorize the collection, use and disclosure of this data for the purposes provided for in this Agreement and/or the Privacy Policy.
5. No Warranty
THE SOFTWARE IS LICENSED AS IS. YOU BEAR THE RISK OF USING IT. PROGRESS GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL RIGHTS UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, PROGRESS EXCLUDES THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
6. Limitation of Liability
To the maximum extent permitted by applicable law, in no event will Progress be liable for any indirect, special, incidental, or consequential damages arising out of this Agreement, including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if advised of the possibility thereof, and regardless of the legal or equitable theory (contract, tort or otherwise) upon which the claim is based. In any case, Progresss entire liability under any provision of this Agreement shall not exceed in the aggregate the sum of the license fees Licensee paid to Progress for the Software giving rise to such damages, or in the case of a free (no fee) License, shall not exceed $5, notwithstanding any failure of essential purpose of any limited remedy. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not be applicable. Progress is not responsible for any liability arising out of content provided by Licensee or a third party that is accessed through the Software and/or any material linked through such content. Any data or content included in the Software upon shipment from Progress is for testing use only and Progress hereby disclaims any and all liability arising therefrom.
7. Indemnity
You agree to indemnify, hold harmless, and defend Progress and its resellers from and against any and all claims, lawsuits and proceedings (collectively "Claims"), and all expenses, costs (including attorney's fees), judgments, damages and other liabilities resulting from such Claims, that arise or result from (i) Your use of the Software in violation of this Agreement, (ii) the use or distribution of Your Integrated Product or (iii) Your modification of the Softwares source code.
8. Governing Law
This License will be governed by the law of the Commonwealth of Massachusetts, U.S.A., without regard to the conflict of laws principles thereof. If any dispute, controversy, or claim cannot be resolved by a good faith discussion between the parties, then it shall be submitted for resolution to a state or Federal court or competent jurisdiction in Boston, Massachusetts, USA, and the parties hereby agree to submit to the jurisdiction and venue of such court. The Uniform Computer Information Transactions Act and the United Nations Convention on the International Sale of Goods shall not apply to this Agreement. Failure of a party to enforce any provision of this Agreement shall not constitute or be construed as a waiver of such provision or of the right to enforce such provision.
9. Entire Agreement
This Agreement shall constitute the entire agreement between the parties with respect to the subject matter hereof and supersedes all prior and contemporaneous communications regarding the subject matter hereof. Use of any purchase order or other Licensee document in connection herewith shall be for administrative convenience only and all terms and conditions stated therein shall be void and of no effect unless otherwise agreed to in writing by both parties. In cases where this license is being obtained through an approved third party, these terms shall supersede any third-party license or purchase agreement.
10. No Assignment
You may not assign, sublicense, sub-contract, or otherwise transfer this Agreement, or any rights or obligations under it, without Progresss prior written consent.
11. Survival
Any provisions of the Agreement containing license restrictions, including but not limited to those related to the Program source code, warranties and warranty disclaimers, limitations of liability and/or indemnity terms, and any provision of the Agreement which, by its nature, is intended to survive shall remain in effect following any termination or expiration of the Agreement.
12. Severability
If a particular provision of this Agreement is terminated or held by a court of competent jurisdiction to be invalid, illegal, or unenforceable, this Agreement shall remain in full force and effect as to the remaining provisions.
13. Export Classifications
You expressly agree not to export or re-export Progress Software or Your Integrated Product to any country, person, entity or end user subject to U.S. export restrictions. You specifically agree not to export, re-export, or transfer the Software to any country to which the U.S. has embargoed or restricted the export of goods or services, or to any national of any such country, wherever located, who intends to transmit or transport the products back to such country, or to any person or entity who has been prohibited from participating in U.S. export transactions by any federal agency of the U.S. government. You warrant and represent that neither the U.S.A. Bureau of Export Administration nor any other federal agency has suspended, revoked or denied Your export privileges.
YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, THAT YOU UNDERSTAND THIS AGREEMENT, AND UNDERSTAND THAT BY CONTINUING THE DOWNLOAD, INSTALLATION AND/OR USE OF THE SOFTWARE PRODUCT, BY LOADING OR RUNNING THE SOFTWARE PRODUCT, OR BY PLACING OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE, YOU AGREE TO BE BOUND BY THIS AGREEMENTS TERMS AND CONDITIONS. YOU FURTHER AGREE THAT, EXCEPT FOR WRITTEN SEPARATE AGREEMENTS BETWEEN PROGRESS AND YOU, THIS AGREEMENT IS A COMPLETE AND EXCLUSIVE STATEMENT OF THE RIGHTS AND LIABILITIES OF THE PARTIES.

49
README.md Normal file
Просмотреть файл

@ -0,0 +1,49 @@
# Kendo UI for Angular: Angular CLI
This project is part of the [Getting Started guide](https://www.telerik.com/kendo-angular-ui/components/getting-started/) in the [Kendo UI for Angular documentation](https://www.telerik.com/kendo-angular-ui/components/). The app was generated with the [Angular CLI](https://github.com/angular/angular-cli).
## Install the app
1. Clone this repository with your Git client or by executing
`git clone https://github.com/telerik/kendo-angular-getting-started.git`
1. Enter the project directory, e.g. `cd kendo-angular-getting-started`
1. Run `npm install` to install the project dependencies.
## Table of Contents
* [Development Server](#development-server)
* [Code Scaffolding](#code-scaffolding)
* [Build](#build)
* [Angular CLI Help](#angular-cli-help)
* [Other Sample Projects with Kendo UI for Angular](#other-sample-projects-with-kendo-ui-for-angular)
## Development Server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code Scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
## Angular CLI Help
For additional support on the Angular CLI:
* Run the `ng help` command, or
* Refer to the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
## Other Sample Projects with Kendo UI for Angular
| Project Repository | Documentation |
|:--- |:--- |
| [Kendo UI for Angular with Angular QuickStart](https://github.com/telerik/kendo-angular-quickstart) | [Using with SystemJS](http://www.telerik.com/kendo-angular-ui/components/installation/system-js/) |
| [Kendo UI for Angular with Angular Seed](https://github.com/telerik/kendo-angular-quickstart-seed) | Not documented |
| [Kendo UI for Angular with Angular Universal](https://github.com/telerik/kendo-angular-universal-demo) | [Universal Rendering](http://www.telerik.com/kendo-angular-ui/components/framework/universal/) |
| [Kendo UI for Angular with UI for ASP.NET Core](https://github.com/telerik/kendo-angular-demo-aspnetcore-data/tree/master) |[UI for ASP.NET Core Integration](https://www.telerik.com/kendo-angular-ui/components/data-query/mvc-integration/) |
| [Kendo UI for Angular with NativeScript](https://github.com/telerik/ng2-dashboard) | Not documented |
| [Translating the custom messages of the Kendo UI components for Angular](https://github.com/telerik/kendo-angular-i18n-sample) | [Translation of Messages](http://www.telerik.com/kendo-angular-ui/components/localization/messages/)|

130
angular.json Normal file
Просмотреть файл

@ -0,0 +1,130 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"kendo-angular-getting-started": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/kendo-angular-getting-started",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
{
"input": "node_modules/@progress/kendo-theme-default/dist/all.css"
},
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "kendo-angular-getting-started:build"
},
"configurations": {
"production": {
"browserTarget": "kendo-angular-getting-started:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "kendo-angular-getting-started: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",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
{
"input": "node_modules/@progress/kendo-theme-default/dist/all.css"
},
"src/styles.css"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "kendo-angular-getting-started:serve"
},
"configurations": {
"production": {
"devServerTarget": "kendo-angular-getting-started:serve:production"
}
}
}
}
}
},
"defaultProject": "kendo-angular-getting-started"
}

44
karma.conf.js Normal file
Просмотреть файл

@ -0,0 +1,44 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/kendo-angular-getting-started'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};

33654
package-lock.json сгенерированный Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

63
package.json Normal file
Просмотреть файл

@ -0,0 +1,63 @@
{
"name": "kendo-angular-getting-started",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~11.2.7",
"@angular/common": "~11.2.7",
"@angular/compiler": "~11.2.7",
"@angular/core": "~11.2.7",
"@angular/forms": "~11.2.7",
"@angular/localize": "~11.2.7",
"@angular/platform-browser": "~11.2.7",
"@angular/platform-browser-dynamic": "~11.2.7",
"@angular/router": "~11.2.7",
"@progress/kendo-angular-buttons": "^6.0.0",
"@progress/kendo-angular-common": "^2.0.0",
"@progress/kendo-angular-dateinputs": "^5.0.0",
"@progress/kendo-angular-dropdowns": "^5.0.0",
"@progress/kendo-angular-excel-export": "^4.0.0",
"@progress/kendo-angular-grid": "^5.0.3",
"@progress/kendo-angular-inputs": "^7.0.0",
"@progress/kendo-angular-intl": "^3.0.0",
"@progress/kendo-angular-l10n": "^3.0.0",
"@progress/kendo-angular-label": "^3.0.0",
"@progress/kendo-angular-pdf-export": "^3.0.0",
"@progress/kendo-angular-popup": "^4.0.0",
"@progress/kendo-angular-treeview": "^5.0.0",
"@progress/kendo-data-query": "^1.0.0",
"@progress/kendo-drawing": "^1.0.0",
"@progress/kendo-licensing": "^1.0.2",
"@progress/kendo-theme-default": "^4.34.0",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1102.6",
"@angular/cli": "~11.2.6",
"@angular/compiler-cli": "~11.2.7",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.1.2"
}
}

Просмотреть файл

@ -0,0 +1,10 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
const routes: Routes = [];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }

Просмотреть файл

Просмотреть файл

@ -0,0 +1,33 @@
<h1>Hello Kendo UI for Angular!</h1>
<p>
<kendo-dropdownlist [data]="dropDownItems" textField="text" valueField="value" [defaultItem]="defaultItem"
(valueChange)="handleFilterChange($event)">
</kendo-dropdownlist>
</p>
<kendo-grid [data]="gridItems | async" [pageSize]="pageSize" [skip]="skip" [pageable]="true"
(pageChange)="pageChange($event)" [sortable]="true" [sort]="sortDescriptor" (sortChange)="handleSortChange($event)"
[height]="400">
<kendo-grid-column field="ProductID" title="ID" width="50">
</kendo-grid-column>
<kendo-grid-column field="ProductName" title="Product Name">
</kendo-grid-column>
<kendo-grid-column field="Category.CategoryName" title="Category">
</kendo-grid-column>
<kendo-grid-column field="UnitPrice" title="Unit Price" width="140" format="{0:c}">
</kendo-grid-column>
<kendo-grid-column field="Discontinued" width="140" filter="boolean">
<ng-template kendoGridCellTemplate let-dataItem>
<input type="checkbox" [checked]="dataItem.Discontinued" disabled />
</ng-template>
</kendo-grid-column>
</kendo-grid>
<h2>Resources</h2>
<ul>
<li><a href="https://www.telerik.com/kendo-angular-ui/components/getting-started/">Kendo UI for Angular -
Getting Started Documentation</a></li>
<li><a href="https://github.com/telerik/kendo-angular-quickstart-cli">GitHub repo for this app</a></li>
</ul>

Просмотреть файл

@ -0,0 +1,35 @@
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'kendo-angular-getting-started'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('kendo-angular-getting-started');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement;
expect(compiled.querySelector('.content span').textContent).toContain('kendo-angular-getting-started app is running!');
});
});

61
src/app/app.component.ts Normal file
Просмотреть файл

@ -0,0 +1,61 @@
import { Component } from '@angular/core';
import { categories } from "./data.categories";
import { GridDataResult, PageChangeEvent } from "@progress/kendo-angular-grid";
import { SortDescriptor } from "@progress/kendo-data-query";
// import { FilterDescriptor } from "@progress/kendo-data-query";
import { ProductService } from "./product.service";
import { Observable } from "rxjs";
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
providers: [ProductService]
})
export class AppComponent {
// used for the DropDownList
public dropDownItems = categories;
public defaultItem = { text: "Filter by Category", value: null };
// used for the Grid
public gridItems: Observable<GridDataResult>;
public pageSize: number = 10;
public skip: number = 0;
public sortDescriptor: SortDescriptor[] = [];
// public filterDescriptor: FilterDescriptor[] = [];
public filterTerm: number = null;
constructor(private service: ProductService) {
this.loadGridItems();
}
public pageChange(event: PageChangeEvent): void {
this.skip = event.skip;
this.loadGridItems();
}
private loadGridItems(): void {
this.gridItems = this.service.getProducts(
this.skip,
this.pageSize,
this.sortDescriptor,
this.filterTerm
);
}
public handleSortChange(descriptor: SortDescriptor[]): void {
this.sortDescriptor = descriptor;
this.loadGridItems();
}
public handleFilterChange(item: {
text: string;
value: number | null;
}): void {
this.filterTerm = item.value;
this.skip = 0;
this.loadGridItems();
}
}

25
src/app/app.module.ts Normal file
Просмотреть файл

@ -0,0 +1,25 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { GridModule } from '@progress/kendo-angular-grid';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
DropDownsModule,
BrowserAnimationsModule,
GridModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

Просмотреть файл

@ -0,0 +1,10 @@
export const categories: Array<{ text: string; value: number }> = [
{ text: "Beverages", value: 1 },
{ text: "Condiments", value: 2 },
{ text: "Confections", value: 3 },
{ text: "Dairy Products", value: 4 },
{ text: "Grains/Cereals", value: 5 },
{ text: "Meat/Poultry", value: 6 },
{ text: "Produce", value: 7 },
{ text: "Seafood", value: 8 },
];

1311
src/app/data.products.ts Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,41 @@
import { Injectable } from "@angular/core";
import {
DataResult,
orderBy,
process,
SortDescriptor
} from "@progress/kendo-data-query";
import { Observable, of } from "rxjs";
import { products } from "./data.products";
@Injectable()
export class ProductService {
public getProducts(
skip: number,
pageSize: number,
sortDescriptor: SortDescriptor[],
filterTerm: number
): Observable<DataResult> {
let data;
if (filterTerm) {
data = process(orderBy(products, sortDescriptor), {
filter: {
logic: "and",
filters: [
{
field: "CategoryID",
operator: "eq",
value: filterTerm
}
]
}
}).data;
} else {
data = orderBy(products, sortDescriptor);
}
return of({
data: data.slice(skip, skip + pageSize),
total: data.length
});
}
}

Просмотреть файл

@ -0,0 +1,3 @@
export const environment = {
production: true
};

Просмотреть файл

@ -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.

Двоичные данные
src/favicon.ico Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 948 B

13
src/index.html Normal file
Просмотреть файл

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>KendoAngularGettingStarted</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>

12
src/main.ts Normal file
Просмотреть файл

@ -0,0 +1,12 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));

69
src/polyfills.ts Normal file
Просмотреть файл

@ -0,0 +1,69 @@
/***************************************************************************************************
* Load `$localize` onto the global scope - used if i18n tags appear in Angular templates.
*/
import '@angular/localize/init';
/**
* 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
*/
/**
* IE11 requires the following for NgClass support on SVG elements
*/
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
* because those flags need to be set before `zone.js` being loaded, and webpack
* will put import in the top of bundle, so user need to create a separate file
* in this directory (for example: zone-flags.ts), and put the following flags
* into that file, and then add the following code before importing zone.js.
* import './zone-flags';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*
* (window as any).__Zone_enable_cross_context_check = true;
*
*/
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/

1
src/styles.css Normal file
Просмотреть файл

@ -0,0 +1 @@
/* You can add global styles to this file, and also import other style files */

25
src/test.ts Normal file
Просмотреть файл

@ -0,0 +1,25 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

15
tsconfig.app.json Normal file
Просмотреть файл

@ -0,0 +1,15 @@
/* 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"
]
}

23
tsconfig.json Normal file
Просмотреть файл

@ -0,0 +1,23 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"module": "es2020",
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false
}
}

18
tsconfig.spec.json Normal file
Просмотреть файл

@ -0,0 +1,18 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine"
]
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}

152
tslint.json Normal file
Просмотреть файл

@ -0,0 +1,152 @@
{
"extends": "tslint:recommended",
"rulesDirectory": [
"codelyzer"
],
"rules": {
"align": {
"options": [
"parameters",
"statements"
]
},
"array-type": false,
"arrow-return-shorthand": true,
"curly": true,
"deprecation": {
"severity": "warning"
},
"eofline": true,
"import-blacklist": [
true,
"rxjs/Rx"
],
"import-spacing": true,
"indent": {
"options": [
"spaces"
]
},
"max-classes-per-file": false,
"max-line-length": [
true,
140
],
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-empty": false,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-non-null-assertion": true,
"no-redundant-jsdoc": true,
"no-switch-case-fall-through": true,
"no-var-requires": false,
"object-literal-key-quotes": [
true,
"as-needed"
],
"quotemark": [
true,
"single"
],
"semicolon": {
"options": [
"always"
]
},
"space-before-function-paren": {
"options": {
"anonymous": "never",
"asyncArrow": "always",
"constructor": "never",
"method": "never",
"named": "never"
}
},
"typedef": [
true,
"call-signature"
],
"typedef-whitespace": {
"options": [
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
}
]
},
"variable-name": {
"options": [
"ban-keywords",
"check-format",
"allow-pascal-case"
]
},
"whitespace": {
"options": [
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast"
]
},
"component-class-suffix": true,
"contextual-lifecycle": true,
"directive-class-suffix": true,
"no-conflicting-lifecycle": true,
"no-host-metadata-property": true,
"no-input-rename": true,
"no-inputs-metadata-property": true,
"no-output-native": true,
"no-output-on-prefix": true,
"no-output-rename": true,
"no-outputs-metadata-property": true,
"template-banana-in-box": true,
"template-no-negated-async": true,
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true,
"directive-selector": [
true,
"attribute",
"app",
"camelCase"
],
"component-selector": [
true,
"element",
"app",
"kebab-case"
]
}
}