diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 000000000..4f9ac2698 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,16 @@ +# 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 diff --git a/.editorconfig b/.editorconfig index 54e4850b2..0a592d43d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,14 +1,17 @@ -# Editor configuration, see http://editorconfig.org +# Editor configuration, see https://editorconfig.org root = true [*] charset = utf-8 end_of_line = lf -indent_size = 2 indent_style = space +indent_size = 2 insert_final_newline = true trim_trailing_whitespace = true +[*.ts] +quote_type = single + [*.md] max_line_length = off trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 9725934af..941084510 100644 --- a/.gitignore +++ b/.gitignore @@ -2,14 +2,18 @@ # compiled output /dist -/dist-server /tmp /out-tsc +# Only exists if Bazel was run +/bazel-out # dependencies /node_modules package-lock.json +# profiling files +chrome-profiler-events*.json + # IDEs and editors /.idea .project @@ -25,8 +29,10 @@ package-lock.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json +.history/* # misc +/.angular/cache /.sass-cache /connect.lock /coverage diff --git a/CHANGELOG.md b/CHANGELOG.md index 0312954e6..ecd0e9536 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,298 @@ ## [CoreUI for Angular](./README.md) version `changelog` +###### `v2.13.0` + +- chore: update to `Angular 13.3` + +###### dependencies update +- update `@angular/animations` to `^13.3.0` +- update `@angular/cdk` to `^13.3.0` +- update `@angular/common` to `^13.3.0` +- update `@angular/compiler` to `^13.3.0` +- update `@angular/core` to `^13.3.0` +- update `@angular/forms` to `^13.3.0` +- update `@angular/localize` to `^13.3.0` +- update `@angular/platform-browser` to `^13.3.0` +- update `@angular/platform-browser-dynamic` to `^13.3.0` +- update `@angular/router` to `^13.3.0` +- update `@coreui/angular` to `~2.13.0` +- update `@angular-devkit/build-angular` to `^13.3.0` +- update `@angular/cli` to `^13.3.0` +- update `@angular/compiler-cli` to `^13.3.0` +- update `@angular/language-service` to `^13.3.0` +- update `typescript` to `~4.6.2` +- remove: `classlist.js` +- remove: `web-animations-js` + +###### `v2.12.0` + +- chore: update to `Angular 12.2` +- refactor: icons cleanup + +###### dependencies update +- update `@angular/animations` to `^12.2.16` +- update `@angular/cdk` to `^12.2.13` +- update `@angular/common` to `^12.2.16` +- update `@angular/compiler` to `^12.2.16` +- update `@angular/core` to `^12.2.16` +- update `@angular/forms` to `^12.2.16` +- update `@angular/localize` to `^12.2.16` +- update `@angular/platform-browser` to `^12.2.16` +- update `@angular/platform-browser-dynamic` to `^12.2.16` +- update `@angular/router` to `^12.2.16` +- update `@coreui/angular` to `~2.12.0` +- update `zone.js` to `~0.11.4` +- update `@angular-devkit/build-angular` to `^12.2.16` +- update `@angular/cli` to `^12.2.16` +- update `@angular/compiler-cli` to `^12.2.16` +- update `@angular/language-service` to `^12.2.16` +- update `jasmine-spec-reporter` to `~7.0.0` +- update `karma` to `~6.3.17` +- update `typescript` to `~4.3.5` + +###### `v2.11.3` + +- chore: dependencies update + +###### `v2.11.2` + +- chore: update to `Angular 11.2` + +###### dependencies update +- update `@angular/animations` to `^11.2.5` +- update `@angular/cdk` to `^11.2.4 +- update `@angular/common` to `^11.2.5` +- update `@angular/compiler` to `^11.2.5` +- update `@angular/core` to `^11.2.5` +- update `@angular/forms` to `^11.2.5` +- update `@angular/localize` to `^11.2.5` +- update `@angular/platform-browser` to `^11.2.5` +- update `@angular/platform-browser-dynamic` to `^11.2.5` +- update `@angular/router` to `^11.2.5` +- update `@coreui/angular` to `^2.11.2` +- update `core-js` to `^3.9.1` +- update `rxjs` to `^6.6.6` +- update `@angular-devkit/build-angular` to `^0.1102.4` +- update `@angular/cli` to `^11.2.4` +- update `@angular/compiler-cli` to `^11.2.5` +- update `@angular/language-service` to `^11.2.5` +- update `@types/jasmine` to `^3.6.6` +- update `@types/node` to `^14.14.33` +- update `typescript` to `^4.1.5` + +###### `v2.11.1` + +- chore: update to `Angular 11.1` + +###### dependencies update +- update `@angular/animations` to `^11.1.0` +- update `@angular/cdk` to `^11.1.0` +- update `@angular/common` to `^11.1.0` +- update `@angular/compiler` to `^11.1.0` +- update `@angular/core` to `^11.1.0` +- update `@angular/forms` to `^11.1.0` +- update `@angular/localize` to `^11.1.0` +- update `@angular/platform-browser` to `^11.1.0` +- update `@angular/platform-browser-dynamic` to `^11.1.0` +- update `@angular/router` to `^11.1.0` +- update `@coreui/angular` to `~2.11.1` +- update `bootstrap` to `^4.6.0` +- update `core-js` to `^3.8.3` +- update `@angular-devkit/build-angular` to `^0.1101.1` +- update `@angular/cli` to `^11.1.1` +- update `@angular/compiler-cli` to `^11.1.0` +- update `@angular/language-service` to `^11.1.0` +- update `@types/jasmine` to `^3.6.3` +- update `@types/node` to `^14.14.22` + +###### `v2.11.0` + +- chore: update to `Angular 11` and `TypeScript 4` + - [https://update.angular.io/](https://update.angular.io/?v=10.2-11.0) + - [https://v11.angular.io/guide/updating-to-version-11](https://v11.angular.io/guide/updating-to-version-11) + - [TypeScript: Documentation - TypeScript 4](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html) + - remove deprecated support for IE 9, 10, and IE mobile + +###### dependencies update +- update `@angular/animations` to `^11.0.9` +- update `@angular/cdk` to `^11.0.4` +- update `@angular/common` to `^11.0.9` +- update `@angular/compiler` to `^11.0.9` +- update `@angular/core` to `^11.0.9` +- update `@angular/forms` to `^11.0.9` +- update `@angular/localize` to `^11.0.9` +- update `@angular/platform-browser` to `^11.0.9` +- update `@angular/platform-browser-dynamic` to `^11.0.9` +- update `@angular/router` to `^11.0.9` +- update `@coreui/angular` to `~2.11.0` +- update `@angular-devkit/build-angular` to `^0.1100.7` +- update `@angular/cli` to `^11.0.7` +- update `@angular/compiler-cli` to `^11.0.9` +- update `@angular/language-service` to `^11.0.9` +- update `@types/jasmine` to `~3.6.0` +- update `codelyzer` to `^6.0.0` +- update `karma-coverage` to `~2.0.3` +- update `typescript` to `~4.0.5` + +###### `v2.10.0` + +- chore: update to `Angular 10` and `TypeScript 3.9` + - [https://update.angular.io/](https://update.angular.io/?v=9.1-10.2) + - [https://v10.angular.io/guide/updating-to-version-10](https://v10.angular.io/guide/updating-to-version-10) + - [TypeScript: Documentation - TypeScript 3.9](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html) + + +- test: deprecate `async()` in favour of `waitForAsync()` + +###### dependencies update +- update `@angular/animations` to `^10.2.4` +- update `@angular/cdk` to `^10.2.7` +- update `@angular/common` to `^10.2.4` +- update `@angular/compiler` to `^10.2.4` +- update `@angular/core` to `^10.2.4` +- update `@angular/forms` to `^10.2.4` +- update `@angular/localize` to `^10.2.4` +- update `@angular/platform-browser` to `^10.2.4` +- update `@angular/platform-browser-dynamic` to `^10.2.4` +- update `@angular/router` to `^10.2.4` +- update `@coreui/angular` to `~2.10.0` +- update `classlist.js` to `^1.1.20150312` +- update `ng2-charts` to `^2.4.2` +- update `ngx-bootstrap` to `^6.2.0` +- update `ngx-perfect-scrollbar` to `^10.1.0` +- update `tslib` to `^2.0.0` +- update `@angular-devkit/build-angular` to `^0.1002.1` +- update `@angular/cli` to `^10.2.1` +- update `@angular/compiler-cli` to `^10.2.4` +- update `@angular/language-service` to `^10.2.4` +- update `jasmine-core` to `~3.6.0` +- update `jasmine-spec-reporter` to `~5.0.0` +- update `karma` to `~5.2.0` +- update `karma-chrome-launcher` to `~3.1.0` +- update `karma-coverage-istanbul-reporter` to `~3.0.2` +- update `karma-jasmine` to `~4.0.0` +- update `karma-jasmine-html-reporter` to `^1.5.0` +- update `protractor` to `~7.0.0` +- update `tslint` to `~6.1.0` +- update `typescript` to `^3.9.7` + + +###### `v2.9.6` +- feat(icons): update to @coreui/icons v2 and @coreui/icons-angular + +###### dependencies update +- update `@angular/animations` to `^9.1.13` +- update `@angular/cdk` to `^9.2.4` +- update `@angular/common` to `^9.1.13` +- update `@angular/compiler` to `^9.1.13` +- update `@angular/core` to `^9.1.13` +- update `@angular/forms` to `^9.1.13` +- update `@angular/platform-browser` to `^9.1.13` +- update `@angular/platform-browser-dynamic` to `^9.1.13` +- update `@angular/router` to `^9.1.13` +- update `@coreui/angular`: `~2.9.6` +- update `@coreui/icons` to `^2.0.0-rc.0` +- update `@coreui/icons-angular` to `1.0.0-alpha.3` +- update `bootstrap` to `^4.5.3` +- update `chart.js` to `^2.9.4` +- update `core-js` to `^3.8.2` +- update `ng2-charts` to `~2.3.3` +- update `ngx-bootstrap` to `^5.6.2` +- update `rxjs` to `^6.6.3` +- update `simple-line-icons` to `^2.5.5` +- update `tslib` to `^1.14.1` +- update `@angular-devkit/build-angular` to `^0.901.13` +- update `@angular/cli` to `^9.1.13` +- update `@angular/compiler-cli` to `^9.1.13` +- update `@angular/language-service` to `^9.1.13` +- update `@types/jasmine` to `^3.6.2` +- update `@types/node` to `^14.14.20` +- update `karma` to `^5.2.3` + +###### `v2.9.5` +- fix(simple-line-icons): Can't resolve simple-line-icons.css - fixes #196 + +###### dependencies update +- update `simple-line-icons` to `^2.5.2` +- update `@angular-devkit/build-angular` to `^0.901.12` +- update `@angular/cli` to `^9.1.12` +- update `@types/jasmine` to `^3.5.12` +- update `jasmine-core` to `^3.6.0` +- update `jasmine-spec-reporter` to `^5.0.2` +- update `karma` to `^5.1.1` +- update `karma-coverage-istanbul-reporter` to `^3.0.3` +- update `tslint` to `^6.1.3` + +###### `v2.9.4` +- refactor(polyfills): update core-js polyfills imports + +###### dependencies update +- update `@angular/animations` to `^9.1.12` +- update `@angular/common` to `^9.1.12` +- update `@angular/compiler` to `^9.1.12` +- update `@angular/core` to `^9.1.12` +- update `@angular/forms` to `^9.1.12` +- update `@angular/platform-browser` to `^9.1.12` +- update `@angular/platform-browser-dynamic` to `^9.1.12` +- update `@angular/router` to `^9.1.12` +- update `@coreui/angular` to `~2.9.4` +- update `bootstrap` to `^4.5.0` +- update `core-js` to `^3.6.5` +- update `flag-icon-css` to `^3.5.0` +- update `moment` to `^2.27.0` +- update `mutationobserver-shim` to `^0.3.7` +- update `ng2-charts` to `^2.3.2` +- update `rxjs` to `^6.6.0` +- update `tslib` to `^1.13.0` +- update `@angular-devkit/build-angular` to `^0.901.11` +- update `@angular/cli` to `^9.1.11` +- update `@angular/compiler-cli` to `^9.1.12` +- update `@angular/language-service` to `^9.1.12` +- update `@types/jasmine` to `^3.5.11` +- update `@types/node` to `^13.13.14` +- update `karma` to `^5.1.0` +- update `karma-jasmine` to `^3.3.1` +- update `karma-jasmine-html-reporter` to `^1.5.4` +- update `protractor` to `^7.0.0` +- update `ts-node` to `^8.10.2` + +###### `v2.9.2` +- fix(navbars): cannot find module `ngx-bootstrap` + +###### dependencies update +- update `@angular/animations` to `^9.1.1` +- update `@angular/common` to `^9.1.1` +- update `@angular/compiler` to `^9.1.1` +- update `@angular/core` to `^9.1.1` +- update `@angular/forms` to `^9.1.1` +- update `@angular/platform-browser` to `^9.1.1` +- update `@angular/platform-browser-dynamic` to `^9.1.1` +- update `@angular/router` to `^9.1.1` +- update `@coreui/angular` to `^2.9.2` +- update `bootstrap` to `^4.4.1` +- update `chart.js` to `^2.9.3` +- update `mutationobserver-shim` to `^0.3.5` +- update `ngx-bootstrap` to `^5.6.1` +- update `ngx-perfect-scrollbar` to `^9.0.0` +- update `rxjs` to `^6.5.5` +- update `tslib` to `^1.11.1` +- update `zone.js` to `~0.10.3` +- update `@angular-devkit/build-angular` to `~0.901.1` +- update `@angular/cli` to `^9.1.1` +- update `@angular/compiler-cli` to `^9.1.1` +- update `@angular/language-service` to `^9.1.1` +- update `@types/jasmine` to `^3.5.10` +- update `@types/node` to `^13.11.1` +- update `codelyzer` to `^5.2.2` +- update `jasmine-spec-reporter` to `^5.0.1` +- update `karma` to `^5.0.1` +- update `karma-coverage-istanbul-reporter` to `^2.1.1` +- update `karma-jasmine` to `^3.1.1` +- update `karma-jasmine-html-reporter` to `^1.5.3` +- update `protractor` to `^5.4.3` +- update `ts-node` to `^8.8.2` +- update `tslint` to `^6.1.1` + ###### `v2.9.0` - chore: update to `Angular 9.0.0` - [https://update.angular.io/](https://update.angular.io/#8.0:9.0) diff --git a/LICENSE b/LICENSE index 0e8afdb39..b9c1de91a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 creativeLabs Łukasz Holeczek. +Copyright (c) 2017-2022 creativeLabs Łukasz Holeczek. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index fc60fa9f5..4040c1d62 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,22 @@ -[![@coreui angular](https://img.shields.io/badge/@coreui%20-angular-lightgrey.svg?style=flat-square)](https://github.com/coreui/angular) -[![npm package][npm-coreui-angular-badge]][npm-coreui-angular] +![angular](https://img.shields.io/badge/angular-^13.3.0-lightgrey.svg?style=flat-square&logo=angular) +[![npm package][npm-coreui-angular-badge-v2]][npm-coreui-angular] +[![npm package][npm-coreui-angular-badge-latest]][npm-coreui-angular] [![NPM downloads][npm-coreui-angular-download]][npm-coreui-angular] [![@coreui coreui](https://img.shields.io/badge/@coreui%20-coreui-lightgrey.svg?style=flat-square)](https://github.com/coreui/coreui) +[![npm package][npm-coreui-badge-v2]][npm-coreui] [![npm package][npm-coreui-badge]][npm-coreui] -[![NPM downloads][npm-coreui-download]][npm-coreui] -![angular](https://img.shields.io/badge/angular-^9.0.0-lightgrey.svg?style=flat-square&logo=angular) +[![NPM downloads][npm-coreui-download]][npm-coreui] -[npm-coreui-angular]: https://www.npmjs.com/package/@coreui/angular -[npm-coreui-angular-badge]: https://img.shields.io/npm/v/@coreui/angular.png?style=flat-square -[npm-coreui-angular-download]: https://img.shields.io/npm/dm/@coreui/angular.svg?style=flat-square + +[npm-coreui-angular]: https://www.npmjs.com/package/@coreui/angular +[npm-coreui-angular-badge-v2]: https://img.shields.io/npm/v/@coreui/angular/v2-lts?style=flat-square&color=red +[npm-coreui-angular-badge-latest]: https://img.shields.io/npm/v/@coreui/angular/latest?style=flat-square&color=red +[npm-coreui-angular-badge-next]: https://img.shields.io/npm/v/@coreui/angular/next?style=flat-square&color=red +[npm-coreui-angular-download]: https://img.shields.io/npm/dm/@coreui/angular.svg?style=flat-square +[npm-coreui-angular-next]: https://img.shields.io/npm/v/@coreui/angular/next?style=flat-square [npm-coreui]: https://www.npmjs.com/package/@coreui/coreui -[npm-coreui-badge]: https://img.shields.io/npm/v/@coreui/coreui.png?style=flat-square +[npm-coreui-badge]: https://img.shields.io/npm/v/@coreui/coreui/latest?style=flat-square +[npm-coreui-badge-v2]: https://img.shields.io/npm/v/@coreui/coreui/v2-lts?style=flat-square [npm-coreui-download]: https://img.shields.io/npm/dm/@coreui/coreui.svg?style=flat-square # CoreUI Free Angular 2+ Admin Template [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&logo=twitter)](https://twitter.com/intent/tweet?text=CoreUI%20-%20Free%20Bootstrap%204%20Admin%20Template%20&url=https://coreui.io&hashtags=bootstrap,admin,template,dashboard,panel,free,angular,react,vue) @@ -21,13 +27,11 @@ Curious why I decided to create CoreUI? Please read this article: [Jack of all t CoreUI is an Open Source Bootstrap Admin Template. But CoreUI is not just another Admin Template. It goes way beyond hitherto admin templates thanks to transparent code and file structure. And if that's not enough, let’s just add that CoreUI consists bunch of unique features and over 1000 high quality icons. -CoreUI is based on Bootstrap 4 and offers 6 versions: -[HTML5 AJAX](https://github.com/coreui/coreui-free-bootstrap-admin-template-ajax), -[HTML5](https://github.com/coreui/coreui-free-angular-admin-template), +CoreUI is based on Bootstrap 4 and offers 4 versions: +[HTML5](https://github.com/coreui/coreui-free-bootstrap-admin-template), [Angular 2+](https://github.com/coreui/coreui-free-angular-admin-template), [React.js](https://github.com/coreui/coreui-free-react-admin-template), -[Vue.js](https://github.com/coreui/coreui-free-vue-admin-template) - & [.NET Core 2](https://github.com/mrholek/CoreUI-NET). +[Vue.js](https://github.com/coreui/coreui-free-vue-admin-template). CoreUI is meant to be the UX game changer. Pure & transparent code is devoid of redundant components, so the app is light enough to offer ultimate user experience. This means mobile devices also, where the navigation is just as easy and intuitive as on a desktop or laptop. The CoreUI Layout API lets you customize your project for almost any device – be it Mobile, Web or WebApp – CoreUI covers them all! @@ -41,7 +45,7 @@ CoreUI is meant to be the UX game changer. Pure & transparent code is devoid of - [Prerequisites](#prerequisites) - [Node.js](#nodejs) - [Angular CLI](#angular-cli) - - [Update to Angular 9](#update-to-angular-9) + - [Update to Angular 13](#update-to-angular-13) - [Installation](#installation) - [Clone repo](#clone-repo) - [Usage](#usage) @@ -60,31 +64,22 @@ CoreUI is meant to be the UX game changer. Pure & transparent code is devoid of CoreUI is built on top of Bootstrap 4 and supports popular frameworks. * [CoreUI Free Bootstrap Admin Template](https://github.com/coreui/coreui-free-bootstrap-admin-template) -* [CoreUI Free Bootstrap Admin Template (Ajax)](https://github.com/coreui/coreui-free-bootstrap-admin-template-ajax) * [CoreUI Free Angular 2+ Admin Template](https://github.com/coreui/coreui-free-angular-admin-template) -* 🚧 CoreUI Free .NET Core 2 Admin Template (Available Soon) * [CoreUI Free React.js Admin Template](https://github.com/coreui/coreui-free-react-admin-template) * [CoreUI Free Vue.js Admin Template](https://github.com/coreui/coreui-free-vue-admin-template) ## CoreUI Pro * 💪 [CoreUI Pro Bootstrap Admin Template](https://coreui.io/pro/) -* 💪 [CoreUI Pro Bootstrap Admin Template (Ajax)](https://coreui.io/pro/) * 💪 [CoreUI Pro Angular Admin Template](https://coreui.io/pro/angular) * 💪 [CoreUI Pro React Admin Template](https://coreui.io/pro/react) * 💪 [CoreUI Pro Vue Admin Template](https://coreui.io/pro/vue) -## Admin Templates built on top of CoreUI Pro - -| CoreUI Pro | Prime | Root | Alba | Leaf | -| --- | --- | --- | --- | --- | -| [![CoreUI Pro Admin Template](https://coreui.io/assets/img/example-coureui.jpg)](https://coreui.io/pro/angular/)| [![Prime Admin Template](https://coreui.io/assets/img/responsive-prime.png)](https://coreui.io/admin-templates/angular/prime/?support=1)| [![Root Admin Template](https://coreui.io/assets/img/responsive-root.png)](https://coreui.io/admin-templates/angular/root/?support=1)| [![Alba Admin Template](https://coreui.io/assets/img/responsive-alba.png)](https://coreui.io/admin-templates/angular/alba/?support=1)| [![Leaf Admin Template](https://coreui.io/assets/img/responsive-leaf.png)](https://coreui.io/admin-templates/angular/leaf/?support=1) - #### Prerequisites Before you begin, make sure your development environment includes `Node.js®` and an `npm` package manager. ###### Node.js -Angular 9 requires `Node.js` version 10.13 or later. +Angular 13 requires `Node.js` version 12.20 or later. - To check your version, run `node -v` in a terminal/console window. - To get `Node.js`, go to [nodejs.org](https://nodejs.org/). @@ -95,8 +90,8 @@ Install the Angular CLI globally using a terminal/console window. npm install -g @angular/cli ``` -##### Update to Angular 9 -Angular 9 requires `Node.js` version 10.x or newer +##### Update to Angular 13 +Angular 13 requires `Node.js` version 12.20 or newer Update guide - see: [https://update.angular.io](https://update.angular.io) ## Installation @@ -187,11 +182,11 @@ Some of projects created by community but not maintained by CoreUI team. ## Copyright and license -copyright 2017-2020 creativeLabs Łukasz Holeczek. Code released under [the MIT license](https://github.com/coreui/coreui-free-angular-admin-template/blob/master/LICENSE). +copyright 2017-2022 creativeLabs Łukasz Holeczek. Code released under [the MIT license](https://github.com/coreui/coreui-free-angular-admin-template/blob/master/LICENSE). There is only one limitation you can't re-distribute the CoreUI as stock. You can’t do this if you modify the CoreUI. In past we faced some problems with persons who tried to sell CoreUI based templates. ## Support CoreUI Development CoreUI is an MIT licensed open source project and completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing. You can support development by donating on [PayPal](https://www.paypal.me/holeczek), buying [CoreUI Pro Version](https://coreui.io/pro) or buying one of our [premium admin templates](https://genesisui.com/?support=1). -As of now I am exploring the possibility of working on CoreUI fulltime - if you are a business that is building core products using CoreUI, I am also open to conversations regarding custom sponsorship / consulting arrangements. Get in touch on [Twitter](https://twitter.com/lukaszholeczek). +As of now I am exploring the possibility of working on CoreUI full-time - if you are a business that is building core products using CoreUI, I am also open to conversations regarding custom sponsorship / consulting arrangements. Get in touch on [Twitter](https://twitter.com/lukaszholeczek). diff --git a/angular.json b/angular.json index c74440df8..450da9e54 100644 --- a/angular.json +++ b/angular.json @@ -4,9 +4,18 @@ "newProjectRoot": "projects", "projects": { "ng": { + "projectType": "application", + "schematics": { + "@schematics/angular:component": { + "style": "scss" + }, + "@schematics/angular:application": { + "strict": false + } + }, "root": "", "sourceRoot": "src", - "projectType": "application", + "prefix": "app", "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", @@ -14,16 +23,19 @@ "outputPath": "dist", "index": "src/index.html", "main": "src/main.ts", - "tsConfig": "src/tsconfig.app.json", "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.app.json", + "inlineStyleLanguage": "scss", + "preserveSymlinks": true, "assets": [ + "src/favicon.ico", "src/assets" ], "styles": [ - "node_modules/@coreui/icons/css/coreui-icons.css", + "node_modules/@coreui/icons/css/free.css", "node_modules/flag-icon-css/css/flag-icon.css", "node_modules/font-awesome/css/font-awesome.css", - "node_modules/simple-line-icons/css/simple-line-icons.css", + "node_modules/simple-line-icons/dist/styles/simple-line-icons.css", "src/scss/style.scss" ], "stylePreprocessorOptions": { @@ -31,46 +43,56 @@ "./node_modules" ] }, - "scripts": [ - "node_modules/chart.js/dist/Chart.min.js" + "scripts": [], + "allowedCommonJsDependencies": [ + "chart.js", + "classnames" ] }, "configurations": { "production": { "budgets": [ + { + "type": "initial", + "maximumWarning": "1500kb", + "maximumError": "2mb" + }, { "type": "anyComponentStyle", - "maximumWarning": "6kb" + "maximumWarning": "6kb", + "maximumError": "12kb" } ], - "optimization": true, - "outputHashing": "all", - "sourceMap": false, - "extractCss": true, - "namedChunks": false, - "aot": true, - "extractLicenses": true, - "vendorChunk": false, - "buildOptimizer": true, "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", - "options": { - "browserTarget": "ng:build" - }, "configurations": { "production": { "browserTarget": "ng:build:production" + }, + "development": { + "browserTarget": "ng:build:development" } - } + }, + "defaultConfiguration": "development" }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", @@ -82,39 +104,26 @@ "builder": "@angular-devkit/build-angular:karma", "options": { "main": "src/test.ts", - "karmaConfig": "./karma.conf.js", "polyfills": "src/polyfills.ts", - "tsConfig": "src/tsconfig.spec.json", - "scripts": [ - "node_modules/chart.js/dist/Chart.min.js" + "tsConfig": "tsconfig.spec.json", + "karmaConfig": "karma.conf.js", + "inlineStyleLanguage": "scss", + "assets": [ + "src/favicon.ico", + "src/assets" ], "styles": [ + "node_modules/@coreui/icons/css/free.css", "node_modules/flag-icon-css/css/flag-icon.css", "node_modules/font-awesome/css/font-awesome.css", - "node_modules/simple-line-icons/css/simple-line-icons.css", + "node_modules/simple-line-icons/dist/styles/simple-line-icons.css", "src/scss/style.scss" ], "stylePreprocessorOptions": { "includePaths": [ "./node_modules" ] - }, - "assets": [ - "src/assets", - "src/favicon.ico" - ] - } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "src/tsconfig.app.json", - "src/tsconfig.spec.json" - ], - "exclude": [ - "**/node_modules/**" - ] + } } } } @@ -130,32 +139,12 @@ "protractorConfig": "./protractor.conf.js", "devServerTarget": "ng:serve" } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "e2e/tsconfig.e2e.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } } } } }, "defaultProject": "ng", - "schematics": { - "@schematics/angular:component": { - "prefix": "app", - "styleext": "scss" - }, - "@schematics/angular:directive": { - "prefix": "app" - } - }, "cli": { "analytics": false } -} \ No newline at end of file +} diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts index 488895941..15b73d541 100644 --- a/e2e/app.e2e-spec.ts +++ b/e2e/app.e2e-spec.ts @@ -36,8 +36,6 @@ describe('CoreUI template', () => { button.click(); browser.sleep(sleep); expect(body.getAttribute('class')).not.toContain('sidebar-minimized'); - browser.driver.manage().window().setSize(600, 800); - browser.sleep(1000); }); it('should toggle `sidebar-show` body.class on `navbar-toggler` click', () => { @@ -56,4 +54,19 @@ describe('CoreUI template', () => { browser.sleep(sleep); expect(body.getAttribute('class')).not.toContain('sidebar-show'); }); + + it('should toggle `aside-menu-lg-show` body.class on `navbar-toggler` click', () => { + browser.manage().window().maximize(); + browser.sleep(1000); + const body = page.getBody(); + expect(body.getAttribute('class')).not.toContain('aside-menu-lg-show'); + const button1 = page.getByCss('.navbar-toggler.d-none.d-lg-block').last(); + button1.click(); + browser.sleep(sleep); + expect(body.getAttribute('class')).toContain('aside-menu-lg-show'); + browser.sleep(sleep); + button1.click(); + browser.sleep(sleep); + expect(body.getAttribute('class')).not.toContain('aside-menu-lg-show'); + }); }); diff --git a/karma.conf.js b/karma.conf.js index 84af9d19a..b97545491 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -9,18 +9,28 @@ module.exports = function (config) { require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), - require('karma-coverage-istanbul-reporter'), + require('karma-coverage'), require('@angular-devkit/build-angular/plugins/karma') ], - client:{ + 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 }, - coverageIstanbulReporter: { - dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ], - fixWebpackSourcePaths: true + jasmineHtmlReporter: { + suppressAll: true // removes the duplicated traces }, - angularCli: { - environment: 'dev' + coverageReporter: { + dir: require('path').join(__dirname, './coverage/coreui-free-angular-admin-template'), + subdir: '.', + reporters: [ + { type: 'html' }, + { type: 'text-summary' } + ] }, reporters: ['progress', 'kjhtml'], port: 9876, @@ -28,6 +38,7 @@ module.exports = function (config) { logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], - singleRun: false + singleRun: false, + restartOnFileChange: true }); }; diff --git a/package.json b/package.json index 413b4071f..4322b81ae 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@coreui/coreui-free-angular-admin-template", - "version": "2.9.0", - "description": "CoreUI Free Angular 2+ Admin Template", + "version": "2.13.0", + "description": "CoreUI Free Angular 13 Admin Template", "author": { "name": "Łukasz Holeczek", "url": "http://holeczek.pl/", @@ -15,71 +15,68 @@ } ], "homepage": "https://coreui.io/angular", - "copyright": "Copyright 2020 creativeLabs Łukasz Holeczek", + "copyright": "Copyright 2017-2022 creativeLabs Łukasz Holeczek", "license": "MIT", "scripts": { "ng": "ng", - "postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points", "start": "ng serve", - "build": "ng build --prod --aot --buildOptimizer --commonChunk --vendorChunk --optimization --progress", + "build": "ng build", + "watch": "ng build --watch --configuration development", "test": "ng test", - "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { - "@angular/animations": "^9.0.0", - "@angular/common": "^9.0.0", - "@angular/compiler": "^9.0.0", - "@angular/core": "^9.0.0", - "@angular/forms": "^9.0.0", - "@angular/platform-browser": "^9.0.0", - "@angular/platform-browser-dynamic": "^9.0.0", - "@angular/router": "^9.0.0", - "@coreui/angular": "^2.9.0", + "@angular/animations": "^13.3.0", + "@angular/cdk": "^13.3.0", + "@angular/common": "^13.3.0", + "@angular/compiler": "^13.3.0", + "@angular/core": "^13.3.0", + "@angular/forms": "^13.3.0", + "@angular/localize": "^13.3.0", + "@angular/platform-browser": "^13.3.0", + "@angular/platform-browser-dynamic": "^13.3.0", + "@angular/router": "^13.3.0", + "@coreui/angular": "~2.13.0", "@coreui/coreui": "^2.1.16", "@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.3.1", - "@coreui/icons": "0.3.0", - "bootstrap": "^4.3.1", - "chart.js": "^2.9.2", - "core-js": "^2.6.11", - "flag-icon-css": "^3.4.6", + "@coreui/icons": "^2.1.0", + "@coreui/icons-angular": "1.0.0-alpha.3", + "bootstrap": "^4.6.1", + "chart.js": "^2.9.4", + "core-js": "^3.21.1", + "flag-icon-css": "^3.5.0", "font-awesome": "^4.7.0", - "moment": "^2.24.0", - "mutationobserver-shim": "^0.3.3", - "ng2-charts": "^2.3.0", - "ngx-bootstrap": "^5.2.0", - "ngx-perfect-scrollbar": "^8.0.0", - "rxjs": "^6.5.3", - "simple-line-icons": "^2.4.1", + "ng2-charts": "^2.4.3", + "ngx-bootstrap": "^6.2.0", + "ngx-perfect-scrollbar": "^10.1.1", + "rxjs": "^6.6.7", + "simple-line-icons": "^2.5.5", "ts-helpers": "^1.1.2", - "tslib": "^1.10.0", - "web-animations-js": "^2.3.2", - "zone.js": "~0.10.2" + "tslib": "^2.3.1", + "zone.js": "~0.11.4" }, "devDependencies": { - "@angular-devkit/build-angular": "^0.900.1", - "@angular/cli": "^9.0.1", - "@angular/compiler-cli": "^9.0.0", - "@angular/language-service": "^9.0.0", - "@types/jasmine": "^3.5.3", - "@types/jasminewd2": "^2.0.8", - "@types/node": "^12.11.1", - "codelyzer": "^5.2.1", - "jasmine-core": "^3.5.0", - "jasmine-spec-reporter": "^4.2.1", - "karma": "^4.4.1", - "karma-chrome-launcher": "^3.1.0", - "karma-coverage-istanbul-reporter": "^2.1.0", - "karma-jasmine": "^2.0.1", - "karma-jasmine-html-reporter": "^1.5.2", - "protractor": "^5.4.2", - "ts-node": "^8.4.1", - "tslint": "^5.20.0", - "typescript": "~3.7.5" + "@angular-devkit/build-angular": "^13.3.0", + "@angular/cli": "^13.3.0", + "@angular/compiler-cli": "^13.3.0", + "@angular/language-service": "^13.3.0", + "@types/jasmine": "~3.8.0", + "@types/jasminewd2": "^2.0.10", + "@types/node": "^14.18.12", + "jasmine-core": "~3.8.0", + "jasmine-spec-reporter": "^7.0.0", + "karma": "~6.3.17", + "karma-chrome-launcher": "~3.1.1", + "karma-coverage": "~2.0.3", + "karma-jasmine": "~4.0.1", + "karma-jasmine-html-reporter": "^1.7.0", + "protractor": "~7.0.0", + "ts-node": "^9.1.1", + "typescript": "~4.6.2" }, "engines": { - "node": ">= 10", + "node": "^12.20.0 || ^14.15.0 || >=16.10.0", "npm": ">= 6" } } diff --git a/protractor.conf.js b/protractor.conf.js index 7ee3b5ee8..eed36ab59 100644 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -12,7 +12,7 @@ exports.config = { 'browserName': 'chrome' }, directConnect: true, - baseUrl: 'http://localhost:4200/', + baseUrl: 'http://localhost:4202/', framework: 'jasmine', jasmineNodeOpts: { showColors: true, diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index cb29357ee..5193e129a 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,8 +1,8 @@ import { RouterTestingModule } from '@angular/router/testing'; -import { TestBed, async } from '@angular/core/testing'; +import { TestBed, waitForAsync } from '@angular/core/testing'; import { AppComponent } from './app.component'; describe('AppComponent', () => { - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [ AppComponent @@ -10,7 +10,7 @@ describe('AppComponent', () => { imports: [ RouterTestingModule ] }).compileComponents(); })); - it('should create the app', async(() => { + it('should create the app', waitForAsync(() => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index dcaa7f252..818c47b23 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,13 +1,23 @@ import { Component, OnInit } from '@angular/core'; import { Router, NavigationEnd } from '@angular/router'; +import { IconSetService } from '@coreui/icons-angular'; +import { cilUser } from '@coreui/icons'; + @Component({ // tslint:disable-next-line selector: 'body', - template: '' + template: '', + providers: [IconSetService], }) export class AppComponent implements OnInit { - constructor(private router: Router) { } + constructor( + private router: Router, + public iconSet: IconSetService + ) { + // iconSet singleton + iconSet.icons = { cilUser }; + } ngOnInit() { this.router.events.subscribe((evt) => { diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9dde556f9..22c295d12 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -7,6 +7,8 @@ import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar'; import { PERFECT_SCROLLBAR_CONFIG } from 'ngx-perfect-scrollbar'; import { PerfectScrollbarConfigInterface } from 'ngx-perfect-scrollbar'; +import { IconModule, IconSetModule, IconSetService } from '@coreui/icons-angular'; + const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { suppressScrollX: true }; @@ -54,7 +56,9 @@ import { ChartsModule } from 'ng2-charts'; PerfectScrollbarModule, BsDropdownModule.forRoot(), TabsModule.forRoot(), - ChartsModule + ChartsModule, + IconModule, + IconSetModule.forRoot(), ], declarations: [ AppComponent, @@ -64,10 +68,13 @@ import { ChartsModule } from 'ng2-charts'; LoginComponent, RegisterComponent ], - providers: [{ - provide: LocationStrategy, - useClass: HashLocationStrategy - }], + providers: [ + { + provide: LocationStrategy, + useClass: HashLocationStrategy + }, + IconSetService, + ], bootstrap: [ AppComponent ] }) export class AppModule { } diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts index 3ae09886e..fdd62cbc6 100644 --- a/src/app/app.routing.ts +++ b/src/app/app.routing.ts @@ -88,7 +88,7 @@ export const routes: Routes = [ ]; @NgModule({ - imports: [ RouterModule.forRoot(routes) ], + imports: [ RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' }) ], exports: [ RouterModule ] }) export class AppRoutingModule {} diff --git a/src/app/containers/default-layout/default-layout.component.html b/src/app/containers/default-layout/default-layout.component.html index c700d80ee..9a58e200c 100644 --- a/src/app/containers/default-layout/default-layout.component.html +++ b/src/app/containers/default-layout/default-layout.component.html @@ -336,6 +336,6 @@
System Utilization
- CoreUI © 2018 creativeLabs. + CoreUI © 2022 creativeLabs. Powered by CoreUI for Angular diff --git a/src/app/containers/default-layout/default-layout.component.spec.ts b/src/app/containers/default-layout/default-layout.component.spec.ts new file mode 100644 index 000000000..a67201cac --- /dev/null +++ b/src/app/containers/default-layout/default-layout.component.spec.ts @@ -0,0 +1,30 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; + +import { TabsModule } from 'ngx-bootstrap/tabs'; +import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar'; +import { AppAsideModule, AppBreadcrumbModule, AppFooterModule, AppHeaderModule, AppSidebarModule } from '@coreui/angular'; +import { DefaultLayoutComponent } from './default-layout.component'; + +describe('DefaultLayoutComponent', () => { + let component: DefaultLayoutComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [DefaultLayoutComponent], + imports: [AppSidebarModule, AppHeaderModule, AppFooterModule, AppAsideModule, RouterTestingModule, AppBreadcrumbModule, TabsModule, PerfectScrollbarModule], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DefaultLayoutComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/containers/default-layout/default-layout.component.ts b/src/app/containers/default-layout/default-layout.component.ts index 1fa811d86..0e20d2f99 100644 --- a/src/app/containers/default-layout/default-layout.component.ts +++ b/src/app/containers/default-layout/default-layout.component.ts @@ -1,4 +1,4 @@ -import {Component } from '@angular/core'; +import {Component} from '@angular/core'; import { navItems } from '../../_nav'; @Component({ diff --git a/src/app/views/base/navbars/navbars.component.spec.ts b/src/app/views/base/navbars/navbars.component.spec.ts index 0166f2609..da2fd72cb 100644 --- a/src/app/views/base/navbars/navbars.component.spec.ts +++ b/src/app/views/base/navbars/navbars.component.spec.ts @@ -1,4 +1,7 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { CollapseDirective } from 'ngx-bootstrap/collapse'; +import { BsDropdownDirective, BsDropdownModule } from 'ngx-bootstrap/dropdown'; import { NavbarsComponent } from './navbars.component'; @@ -6,11 +9,12 @@ describe('NavbarsComponent', () => { let component: NavbarsComponent; let fixture: ComponentFixture; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ NavbarsComponent ] + declarations: [NavbarsComponent, CollapseDirective, BsDropdownDirective], + imports: [NoopAnimationsModule, BsDropdownModule.forRoot()] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/views/base/navbars/navbars.component.ts b/src/app/views/base/navbars/navbars.component.ts index 7b92610e4..e3ce1d221 100644 --- a/src/app/views/base/navbars/navbars.component.ts +++ b/src/app/views/base/navbars/navbars.component.ts @@ -1,5 +1,5 @@ import {AfterViewChecked, Component, ElementRef, OnInit, Renderer2, ViewChild} from '@angular/core'; -import {CollapseDirective} from 'ngx-bootstrap'; +import {CollapseDirective} from 'ngx-bootstrap/collapse'; @Component({ selector: 'app-navbars', diff --git a/src/app/views/icons/coreui-icons.component.html b/src/app/views/icons/coreui-icons.component.html index ef9afe81e..d3e43a0d1 100644 --- a/src/app/views/icons/coreui-icons.component.html +++ b/src/app/views/icons/coreui-icons.component.html @@ -3,413 +3,26 @@
CoreUI Icons New
-
- -
account-logout
-
-
- -
action-redo
-
-
- -
action-undo
-
-
- -
align-center
-
-
- -
align-left
-
-
- -
align-right
-
-
- -
arrow-bottom
-
-
- -
arrow-left
-
-
- -
arrow-right
-
-
- -
arrow-top
-
-
- -
ban
-
-
- -
basket-loaded
-
-
- -
bell
-
-
- -
bold
-
-
- -
bookmark
-
-
- -
briefcase
-
-
- -
british-pound
-
-
- -
brush
-
-
- -
calculator
-
-
- -
calendar
-
-
- -
cart
-
-
- -
chart
-
-
- -
check
-
-
- -
chevron-bottom
-
-
- -
chevron-left
-
-
- -
chevron-right
-
-
- -
chevron-top
-
-
- -
circle-check
-
-
- -
circle-x
-
-
- -
cloud
-
-
- -
cloud-download
-
-
- -
cloud-upload
-
-
- -
code
-
-
- -
cog
-
-
- -
comment-square
-
-
- -
credit-card
-
-
- -
cursor
-
-
- -
dashboard
-
-
- -
delete
-
-
- -
dollar
-
-
- -
drop
-
-
- -
envelope-closed
-
-
- -
envelope-letter
-
-
- -
envelope-open
-
-
- -
euro
-
-
- -
file
-
-
- -
globe
-
-
- -
graph
-
-
- -
home
-
-
- -
inbox
-
-
- -
info
-
-
- -
italic
-
-
- -
justify-center
-
-
- -
justify-left
-
-
- -
justify-right
-
-
- -
laptop
-
-
- -
layers
-
-
- -
lightbulb
-
-
- -
list
-
-
- -
location-pin
-
-
- -
lock-locked
-
-
- -
lock-unlocked
-
-
- -
magnifying-glass
-
-
- -
map
-
-
- -
monitor
-
-
- -
moon
-
-
- -
note
-
-
- -
options
-
-
- -
paperclip
-
-
- -
pencil
-
-
- -
people
-
-
- -
phone
-
-
- -
pie-chart
-
-
- -
print
-
-
- -
puzzle
-
-
- -
rss
-
-
- -
screen-desktop
-
-
- -
screen-smartphone
-
-
- -
settings
-
-
- -
share
-
-
- -
shield
-
-
- -
sort-ascending
-
-
- -
sort-descending
-
-
- -
speech
-
-
- -
speedometer
-
-
- -
star
-
-
- -
sun
-
-
- -
tablet
-
-
- -
tags
-
-
- -
task
-
-
- -
thumb-down
-
-
- -
thumb-up
-
-
- -
trash
-
-
- -
underline
-
-
- -
user
-
-
- -
user-female
-
-
- -
user-follow
-
-
- -
user-unfollow
-
-
- -
wrench
-
-
- -
yen
+
+ + + + +
{{ toKebabCase(icon[0]) }}
-
diff --git a/src/app/views/icons/coreui-icons.component.scss b/src/app/views/icons/coreui-icons.component.scss new file mode 100644 index 000000000..4457c38af --- /dev/null +++ b/src/app/views/icons/coreui-icons.component.scss @@ -0,0 +1,88 @@ +.c-icon-fix { + color: rgb(92 104 115); + fill: rgb(92 104 115); +} + +.c-icon { + display: inline-block; + color: inherit; + text-align: center; + fill: currentColor; +} + +.c-icon:not(.c-icon-c-s):not(.c-icon-custom-size) { + width: 1rem; + height: 1rem; + font-size: 1rem; +} + +.c-icon:not(.c-icon-c-s):not(.c-icon-custom-size).c-icon-2xl { + width: 2rem; + height: 2rem; + font-size: 2rem; +} + +.c-icon:not(.c-icon-c-s):not(.c-icon-custom-size).c-icon-3xl { + width: 3rem; + height: 3rem; + font-size: 3rem; +} + +.c-icon:not(.c-icon-c-s):not(.c-icon-custom-size).c-icon-4xl { + width: 4rem; + height: 4rem; + font-size: 4rem; +} + +.c-icon:not(.c-icon-c-s):not(.c-icon-custom-size).c-icon-5xl { + width: 5rem; + height: 5rem; + font-size: 5rem; +} + +.c-icon:not(.c-icon-c-s):not(.c-icon-custom-size).c-icon-6xl { + width: 6rem; + height: 6rem; + font-size: 6rem; +} + +.c-icon:not(.c-icon-c-s):not(.c-icon-custom-size).c-icon-7xl { + width: 7rem; + height: 7rem; + font-size: 7rem; +} + +.c-icon:not(.c-icon-c-s):not(.c-icon-custom-size).c-icon-8xl { + width: 8rem; + height: 8rem; + font-size: 8rem; +} + +.c-icon:not(.c-icon-c-s):not(.c-icon-custom-size).c-icon-9xl { + width: 9rem; + height: 9rem; + font-size: 9rem; +} + +.c-icon:not(.c-icon-c-s):not(.c-icon-custom-size).c-icon-xl { + width: 1.5rem; + height: 1.5rem; + font-size: 1.5rem; +} + +.c-icon:not(.c-icon-c-s):not(.c-icon-custom-size).c-icon-lg { + width: 1.25rem; + height: 1.25rem; + font-size: 1.25rem; +} + +.c-icon:not(.c-icon-c-s):not(.c-icon-custom-size).c-icon-sm { + width: .875rem; + height: .875rem; + font-size: .875rem; +} + +.c-icon-c-s, .c-icon-custom-size { + width: initial !important; + height: initial !important; +} diff --git a/src/app/views/icons/coreui-icons.component.ts b/src/app/views/icons/coreui-icons.component.ts index 6d63719d3..9c81005f3 100644 --- a/src/app/views/icons/coreui-icons.component.ts +++ b/src/app/views/icons/coreui-icons.component.ts @@ -1,10 +1,50 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { Platform } from '@angular/cdk/platform'; + +import { IconSetService } from '@coreui/icons-angular'; +import { freeSet } from '@coreui/icons'; @Component({ - templateUrl: 'coreui-icons.component.html' + templateUrl: 'coreui-icons.component.html', + styleUrls: ['coreui-icons.component.scss'], + providers: [IconSetService], }) -export class CoreUIIconsComponent { +export class CoreUIIconsComponent implements OnInit { + public title = 'CoreUI Icons'; + public icons = []; + + constructor( + public platform: Platform, + private route: ActivatedRoute, + public iconSet: IconSetService + ) { + iconSet.icons = { ...freeSet }; + } + + ngOnInit() { + const path = this.route.routeConfig.path; + let prefix = 'cil'; + if (path === 'coreui-icons') { + this.title = `${this.title} - Free`; + prefix = 'cil'; + } else if (path === 'brands') { + this.title = `${this.title} - Brands`; + prefix = 'cib'; + } else if (path === 'flags') { + this.title = `${this.title} - Flags`; + prefix = 'cif'; + } + this.icons = this.getIconsView(prefix); + } - constructor() { } + toKebabCase(str) { + return str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase(); + } + getIconsView(prefix: string) { + return Object.entries(this.iconSet.icons).filter((icon) => { + return icon[0].startsWith(prefix); + }); + } } diff --git a/src/app/views/icons/icons.module.ts b/src/app/views/icons/icons.module.ts index 574696102..c8e601e39 100644 --- a/src/app/views/icons/icons.module.ts +++ b/src/app/views/icons/icons.module.ts @@ -1,4 +1,7 @@ import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { IconModule } from '@coreui/icons-angular'; import { CoreUIIconsComponent } from './coreui-icons.component'; import { FlagsComponent } from './flags.component'; @@ -8,7 +11,11 @@ import { SimpleLineIconsComponent } from './simple-line-icons.component'; import { IconsRoutingModule } from './icons-routing.module'; @NgModule({ - imports: [ IconsRoutingModule ], + imports: [ + CommonModule, + IconsRoutingModule, + IconModule + ], declarations: [ CoreUIIconsComponent, FlagsComponent, diff --git a/src/declarations.d.ts b/src/declarations.d.ts new file mode 100644 index 000000000..99b497ae7 --- /dev/null +++ b/src/declarations.d.ts @@ -0,0 +1,8 @@ +declare module '@coreui/coreui/dist/js/coreui-utilities'; +declare module '@coreui/coreui-plugin-chartjs-custom-tooltips'; + +declare module '*.json' { + const value: any; + export default value; +} + diff --git a/src/environments/environment.ts b/src/environments/environment.ts index b7f639aec..f56ff4702 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -1,8 +1,16 @@ -// The file contents for the current environment will overwrite these during build. -// The build system defaults to the dev environment which uses `environment.ts`, but if you do -// `ng build --env=prod` then `environment.prod.ts` will be used instead. -// The list of which env maps to which file can be found in `.angular-cli.json`. +// 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/src/index.html b/src/index.html index 52209e357..daac025a5 100644 --- a/src/index.html +++ b/src/index.html @@ -1,12 +1,12 @@ + - - + diff --git a/src/polyfills.ts b/src/polyfills.ts index 4c0716837..31fea1a35 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -1,3 +1,8 @@ +/*************************************************************************************************** + * 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. @@ -11,86 +16,44 @@ * 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/docs/ts/latest/guide/browser-support.html + * Learn more in https://angular.io/guide/browser-support */ /*************************************************************************************************** * BROWSER POLYFILLS */ -/** IE9, IE10 and IE11 requires all of the following polyfills. **/ -import 'core-js/es6/symbol'; -import 'core-js/es6/object'; -import 'core-js/es6/function'; -import 'core-js/es6/parse-int'; -import 'core-js/es6/parse-float'; -import 'core-js/es6/number'; -import 'core-js/es6/math'; -import 'core-js/es6/string'; -import 'core-js/es6/date'; -import 'core-js/es6/array'; -import 'core-js/es6/regexp'; -import 'core-js/es6/map'; -import 'core-js/es6/weak-map'; -import 'core-js/es6/set'; -import 'core-js/es7/array'; -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'; - -// for IE10 -import 'mutationobserver-shim'; - -/** - * 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`. - /** * 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; + * */ - (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__BLACK_LISTED_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. - +import 'zone.js'; // Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS */ - -/*************************************************************************************************** - * IE10 issues - */ - -/** - * IE10 - some CSS3 properties and HTML5 elements are not fully supported or require prefixed properties for full functionality - * to let Autoprefixer use old flexbox prefixes - add a browserslist property to the package.json file: - * "browserslist": [ - * "last 2 versions", - * "not ie < 10", - * ] - */ - -/** - * IE10 - TypeError: Object doesn't support property or method 'getRootNode' - */ -// import 'get-root-node-polyfill/implement'; // Run `npm i get-root-node-polyfill`. +(window as any).global = window; diff --git a/src/test.ts b/src/test.ts index 16317897b..b4dd6032f 100644 --- a/src/test.ts +++ b/src/test.ts @@ -1,19 +1,26 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files -import 'zone.js/dist/zone-testing'; +import 'zone.js/testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; -declare const require: any; +declare const require: { + context(path: string, deep?: boolean, filter?: RegExp): { + keys(): string[]; + (id: string): T; + }; +}; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, - platformBrowserDynamicTesting() + platformBrowserDynamicTesting(), + { teardown: { destroyAfterEach: true }}, ); + // Then we find all the tests. const context = require.context('./', true, /\.spec\.ts$/); // And load the modules. diff --git a/src/tsconfig.app.json b/src/tsconfig.app.json deleted file mode 100644 index ff5fc6fb4..000000000 --- a/src/tsconfig.app.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "../out-tsc/app", - "baseUrl": "./", - "module": "esnext", - "target": "es5", - "types": [], - "paths": { - "@angular/*": [ - "../node_modules/@angular/*" - ] - } - }, - "angularCompilerOptions": { - "enableIvy": false - }, - "files": [ - "main.ts", - "polyfills.ts" - ], - "include": [ - "**/*.d.ts" - ] -} diff --git a/src/tsconfig.spec.json b/src/tsconfig.spec.json deleted file mode 100644 index 1a18e6d00..000000000 --- a/src/tsconfig.spec.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "../out-tsc/spec", - "baseUrl": "./", - "module": "commonjs", - "types": [ - "jasmine", - "node" - ] - }, - "files": [ - "test.ts", - "polyfills.ts" - ], - "include": [ - "**/*.spec.ts", - "**/*.d.ts" - ] -} diff --git a/tsconfig.app.json b/tsconfig.app.json new file mode 100644 index 000000000..82d91dc4a --- /dev/null +++ b/tsconfig.app.json @@ -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" + ] +} diff --git a/tsconfig.json b/tsconfig.json index 2dbd1dae9..86543633e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,21 +1,36 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "compileOnSave": false, "compilerOptions": { - "importHelpers": true, + "baseUrl": "./", "outDir": "./dist/out-tsc", + "forceConsistentCasingInFileNames": true, + "strict": false, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, "sourceMap": true, "declaration": false, - "moduleResolution": "node", - "emitDecoratorMetadata": true, + "downlevelIteration": true, "experimentalDecorators": true, - "module": "esnext", - "target": "es5", - "typeRoots": [ - "node_modules/@types" - ], + "moduleResolution": "node", + "importHelpers": true, + "target": "es2017", + "module": "es2020", "lib": [ - "esnext", + "es2018", "dom" ] - } + }, + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": false, + "strictInputAccessModifiers": false, + "strictTemplates": false + }, + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.spec.json" }, + ] } diff --git a/tsconfig.spec.json b/tsconfig.spec.json new file mode 100644 index 000000000..092345b02 --- /dev/null +++ b/tsconfig.spec.json @@ -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" + ] +} diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 1ad300574..000000000 --- a/tslint.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "rulesDirectory": [ - "node_modules/codelyzer" - ], - "rules": { - "arrow-return-shorthand": true, - "callable-types": true, - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "curly": true, - "deprecation": { - "severity": "warn" - }, - "eofline": true, - "forin": true, - "import-blacklist": [ - true, - "rxjs/Rx" - ], - "import-spacing": true, - "indent": [ - true, - "spaces" - ], - "interface-over-type-literal": true, - "label-position": true, - "max-line-length": [ - true, - 140 - ], - "member-access": false, - "member-ordering": [ - true, - { - "order": [ - "static-field", - "instance-field", - "static-method", - "instance-method" - ] - } - ], - "no-arg": true, - "no-bitwise": true, - "no-console": [ - true, - "debug", - "info", - "time", - "timeEnd", - "trace" - ], - "no-construct": true, - "no-debugger": true, - "no-duplicate-super": true, - "no-empty": false, - "no-empty-interface": true, - "no-eval": true, - "no-inferrable-types": [ - true, - "ignore-params", - "ignore-properties" - ], - "no-misused-new": true, - "no-non-null-assertion": true, - "no-shadowed-variable": true, - "no-string-literal": false, - "no-string-throw": true, - "no-switch-case-fall-through": true, - "no-trailing-whitespace": true, - "no-unnecessary-initializer": true, - "no-unused-expression": true, - "no-var-keyword": true, - "object-literal-sort-keys": false, - "one-line": [ - true, - "check-open-brace", - "check-catch", - "check-else", - "check-whitespace" - ], - "prefer-const": true, - "quotemark": [ - true, - "single" - ], - "radix": true, - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "unified-signatures": true, - "variable-name": false, - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ], - "directive-selector": [ - true, - "attribute", - "app", - "camelCase" - ], - "component-selector": [ - true, - "element", - "app", - "kebab-case" - ], - "no-output-on-prefix": true, - "no-inputs-metadata-property": true, - "no-outputs-metadata-property": true, - "no-host-metadata-property": true, - "no-input-rename": true, - "no-output-rename": true, - "use-lifecycle-interface": true, - "use-pipe-transform-interface": true, - "component-class-suffix": true, - "directive-class-suffix": true - } -}