initial commit
This commit is contained in:
commit
911b45739d
12
.browserslistrc
Normal file
12
.browserslistrc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
# You can see what browsers were selected by your queries by running:
|
||||||
|
# npx browserslist
|
||||||
|
|
||||||
|
> 0.5%
|
||||||
|
last 2 versions
|
||||||
|
Firefox ESR
|
||||||
|
not dead
|
||||||
|
IE 11
|
||||||
13
.editorconfig
Normal file
13
.editorconfig
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Editor configuration, see http://editorconfig.org
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
max_line_length = off
|
||||||
|
trim_trailing_whitespace = false
|
||||||
41
.gitignore
vendored
Normal file
41
.gitignore
vendored
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
# compiled output
|
||||||
|
/dist
|
||||||
|
/tmp
|
||||||
|
/out-tsc
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
/node_modules
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# misc
|
||||||
|
/.sass-cache
|
||||||
|
/connect.lock
|
||||||
|
/coverage
|
||||||
|
/libpeerconnection.log
|
||||||
|
npm-debug.log
|
||||||
|
testem.log
|
||||||
|
/typings
|
||||||
|
/docs
|
||||||
|
|
||||||
|
# e2e
|
||||||
|
/e2e/*.js
|
||||||
|
/e2e/*.map
|
||||||
|
|
||||||
|
# System Files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
1
.prettierignore
Normal file
1
.prettierignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
README.md
|
||||||
74
.stylelintrc.json
Normal file
74
.stylelintrc.json
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
{
|
||||||
|
"rules": {
|
||||||
|
"color-hex-case": "lower",
|
||||||
|
"color-no-invalid-hex": true,
|
||||||
|
|
||||||
|
"function-calc-no-unspaced-operator": true,
|
||||||
|
"function-comma-space-after": "always-single-line",
|
||||||
|
"function-comma-space-before": "never",
|
||||||
|
"function-name-case": "lower",
|
||||||
|
"function-url-quotes": "always",
|
||||||
|
"function-whitespace-after": "always",
|
||||||
|
|
||||||
|
"number-leading-zero": "always",
|
||||||
|
"number-no-trailing-zeros": true,
|
||||||
|
"length-zero-no-unit": true,
|
||||||
|
|
||||||
|
"string-no-newline": true,
|
||||||
|
"string-quotes": "single",
|
||||||
|
|
||||||
|
"unit-case": "lower",
|
||||||
|
"unit-no-unknown": true,
|
||||||
|
"unit-whitelist": ["px", "%", "deg", "ms", "em", "vh", "vw", "s", "rem"],
|
||||||
|
|
||||||
|
"value-list-comma-space-after": "always-single-line",
|
||||||
|
"value-list-comma-space-before": "never",
|
||||||
|
|
||||||
|
"shorthand-property-no-redundant-values": true,
|
||||||
|
|
||||||
|
"property-case": "lower",
|
||||||
|
|
||||||
|
"declaration-block-no-duplicate-properties": [ true, {
|
||||||
|
"ignore": ["consecutive-duplicates-with-different-values"]
|
||||||
|
}],
|
||||||
|
"declaration-block-trailing-semicolon": "always",
|
||||||
|
"declaration-block-single-line-max-declarations": 1,
|
||||||
|
"declaration-block-semicolon-space-before": "never",
|
||||||
|
"declaration-block-semicolon-space-after": "always-single-line",
|
||||||
|
"declaration-block-semicolon-newline-before": "never-multi-line",
|
||||||
|
"declaration-block-semicolon-newline-after": "always-multi-line",
|
||||||
|
"declaration-property-value-blacklist": [
|
||||||
|
{ "/.*/": ["initial"] },
|
||||||
|
{ "message": "The `initial` value is not supported in IE."}
|
||||||
|
],
|
||||||
|
|
||||||
|
"block-closing-brace-newline-after": [
|
||||||
|
"always",
|
||||||
|
{
|
||||||
|
"ignoreAtRules": ["if", "else"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"block-closing-brace-newline-before": "always-multi-line",
|
||||||
|
"block-opening-brace-newline-after": "always-multi-line",
|
||||||
|
"block-opening-brace-space-before": "always-multi-line",
|
||||||
|
|
||||||
|
"selector-attribute-brackets-space-inside": "never",
|
||||||
|
"selector-attribute-operator-space-after": "never",
|
||||||
|
"selector-attribute-operator-space-before": "never",
|
||||||
|
"selector-combinator-space-after": "always",
|
||||||
|
"selector-combinator-space-before": "always",
|
||||||
|
"selector-pseudo-class-case": "lower",
|
||||||
|
"selector-pseudo-class-parentheses-space-inside": "never",
|
||||||
|
"selector-pseudo-element-case": "lower",
|
||||||
|
"selector-pseudo-element-colon-notation": "double",
|
||||||
|
"selector-pseudo-element-no-unknown": [true, {
|
||||||
|
"ignorePseudoElements": ["ng-deep"]
|
||||||
|
}],
|
||||||
|
"selector-type-case": "lower",
|
||||||
|
"selector-max-id": 0,
|
||||||
|
|
||||||
|
"no-missing-end-of-source-newline": true,
|
||||||
|
|
||||||
|
"max-line-length": 120
|
||||||
|
}
|
||||||
|
}
|
||||||
35
.travis.yml
Normal file
35
.travis.yml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
language: node_js
|
||||||
|
|
||||||
|
sudo: false
|
||||||
|
dist: trusty
|
||||||
|
|
||||||
|
node_js:
|
||||||
|
- '10'
|
||||||
|
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
- starter-kit
|
||||||
|
- demo
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-4.8
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- npm i -g npm@latest
|
||||||
|
|
||||||
|
install:
|
||||||
|
- travis_retry npm i
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
|
||||||
|
script:
|
||||||
|
- npm run lint:ci
|
||||||
|
- npm run build:prod
|
||||||
|
|
||||||
|
git:
|
||||||
|
depth: 1
|
||||||
28
.vscode/launch.json
vendored
Normal file
28
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Launch Edge",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "pwa-msedge",
|
||||||
|
"url": "http://localhost:4200",
|
||||||
|
"webRoot": "${workspaceFolder}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "chrome",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Launch Chrome against localhost",
|
||||||
|
"url": "http://localhost:4200",
|
||||||
|
"sourceMaps": true,
|
||||||
|
"webRoot": "${workspaceRoot}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "chrome",
|
||||||
|
"request": "attach",
|
||||||
|
"name": "Attach to Chrome",
|
||||||
|
"port": 9222,
|
||||||
|
"sourceMaps": true,
|
||||||
|
"webRoot": "${workspaceRoot}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
12
.vscode/settings.json
vendored
Normal file
12
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"typescript.tsdk": "./node_modules/typescript/lib",
|
||||||
|
"tslint.enable": false,
|
||||||
|
"workbench.editor.wrapTabs": true,
|
||||||
|
"git.decorations.enabled": false,
|
||||||
|
"workbench.editor.decorations.badges": false,
|
||||||
|
"workbench.editor.decorations.colors": false,
|
||||||
|
"vscode_custom_css.imports": [
|
||||||
|
"file:///C:/VScode/custom.css"
|
||||||
|
],
|
||||||
|
"vscode_custom_css.policy": true
|
||||||
|
}
|
||||||
16
.vscode/tasks.json
vendored
Normal file
16
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"type": "npm",
|
||||||
|
"script": "build",
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"problemMatcher": [],
|
||||||
|
"label": "npm: build",
|
||||||
|
"detail": "ng build --output-path E:\\Project\\iRehemaMVC\\iRehema\\ClientApp"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
286
CHANGELOG.md
Normal file
286
CHANGELOG.md
Normal file
@ -0,0 +1,286 @@
|
|||||||
|
<a name="8.0.0"></a>
|
||||||
|
# [8.0.0](https://github.com/akveo/ngx-admin/compare/v7.0.0...v8.0.0) (2021-10-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* update to Angular 12 ([#5868](https://github.com/akveo/ngx-admin/issues/5868)) ([080830a](https://github.com/akveo/ngx-admin/commit/080830a))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="7.0.0"></a>
|
||||||
|
# [7.0.0](https://github.com/akveo/ngx-admin/compare/v6.0.0...v7.0.0) (2021-01-19)
|
||||||
|
|
||||||
|
* feat: update to Angular 11 ([#5826](https://github.com/akveo/ngx-admin/issues/5826)) ([ebe1810](https://github.com/akveo/ngx-admin/commit/ebe1810))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="6.0.0"></a>
|
||||||
|
# [6.0.0](https://github.com/akveo/ngx-admin/compare/v5.0.0...v6.0.0) (2020-08-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **echarts:** set merge input ([#5632](https://github.com/akveo/ngx-admin/issues/5632)) ([dfaa5cd](https://github.com/akveo/ngx-admin/commit/dfaa5cd))
|
||||||
|
* **sidebar:** toggle performance issues ([#5658](https://github.com/akveo/ngx-admin/issues/5658)) ([9eaf0bb](https://github.com/akveo/ngx-admin/commit/9eaf0bb))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* update to Angular 10 ([#5747](https://github.com/akveo/ngx-admin/issues/5747)) ([ec3282c](https://github.com/akveo/ngx-admin/commit/ec3282c))
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
- Angular updated to version 10.
|
||||||
|
- Nebular updated to version 6.
|
||||||
|
|
||||||
|
|
||||||
|
<a name="5.0.0"></a>
|
||||||
|
# [5.0.0](https://github.com/akveo/ngx-admin/compare/v4.0.1...v5.0.0) (2020-04-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **forms:** add missing forms module import ([#5530](https://github.com/akveo/ngx-admin/issues/5530)) ([1ff2a0d](https://github.com/akveo/ngx-admin/commit/1ff2a0d))
|
||||||
|
* **tinymce:** set absolute path for skin url ([#5491](https://github.com/akveo/ngx-admin/issues/5491)) ([90125ab](https://github.com/akveo/ngx-admin/commit/90125ab))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* upgrade to Angular 9 and Nebular 5 ([#5628](https://github.com/akveo/ngx-admin/issues/5628)) ([fbbf944](https://github.com/akveo/ngx-admin/commit/fbbf944))
|
||||||
|
* **seo:** add canonical tag ([#5578](https://github.com/akveo/ngx-admin/issues/5578)) ([76d31da](https://github.com/akveo/ngx-admin/commit/76d31da))
|
||||||
|
* add calendar with week numbers example ([#5515](https://github.com/akveo/ngx-admin/issues/5515)) ([3242257](https://github.com/akveo/ngx-admin/commit/3242257))
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
- Angular updated to version 9.
|
||||||
|
- Nebular updated to version 5.
|
||||||
|
- `@agm/core` replaced with `@angular/google-maps`.
|
||||||
|
- `ng2-completer` replaced with `@akveo/ng2-completer`, read details [here](https://github.com/akveo/ng2-smart-table/pull/1140#issue-392285957).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.0.1"></a>
|
||||||
|
## [4.0.1](https://github.com/akveo/ngx-admin/compare/v4.0.0...v4.0.1) (2019-07-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **typography:** prevent bootstrap color override ([#2161](https://github.com/akveo/ngx-admin/issues/2161)) ([243390c](https://github.com/akveo/ngx-admin/commit/243390c))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* update Nebular to 4.1.2 ([#5451](https://github.com/akveo/ngx-admin/issues/5451)) ([a2e93f9](https://github.com/akveo/ngx-admin/commit/a2e93f9))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.0.0"></a>
|
||||||
|
# [4.0.0](https://github.com/akveo/ngx-admin/compare/v3.2.0...v4.0.0) (2019-07-02)
|
||||||
|
|
||||||
|
- Update to Nebular 4 based on Eva Design System
|
||||||
|
- New Dark theme
|
||||||
|
- Angular 8
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* update to Angular 8, Nebular 4 ([#2114](https://github.com/akveo/ngx-admin/issues/2114)) ([e9600b4](https://github.com/akveo/ngx-admin/commit/e9600b4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="3.2.1"></a>
|
||||||
|
## [3.2.1](https://github.com/akveo/ngx-admin/compare/v3.2.0...v3.2.1) (2019-04-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* update [@angular-devkit](https://github.com/angular-devkit)/build-angular to fix import aliases ([78695cd](https://github.com/akveo/ngx-admin/commit/78695cd))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="3.2.0"></a>
|
||||||
|
# [3.2.0](https://github.com/akveo/ngx-admin/compare/v3.1.0...v3.2.0) (2019-04-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **dashboard:** update title country->region the orders list component ([#1987](https://github.com/akveo/ngx-admin/issues/1987)) ([cf1bf4d](https://github.com/akveo/ngx-admin/commit/cf1bf4d))
|
||||||
|
* **readme:** fix demo links ([#2028](https://github.com/akveo/ngx-admin/issues/2028)) ([1fb3205](https://github.com/akveo/ngx-admin/commit/1fb3205))
|
||||||
|
* **rtl:** remove duplicate of nebular styles ([#1824](https://github.com/akveo/ngx-admin/issues/1824)) ([d8e7092](https://github.com/akveo/ngx-admin/commit/d8e7092))
|
||||||
|
* **setting-sidebar:** Ie and firefox position bugs, linter ([#2023](https://github.com/akveo/ngx-admin/issues/2023)) ([8d471ba](https://github.com/akveo/ngx-admin/commit/8d471ba))
|
||||||
|
* **sidebar:** Add Form Inputs extra component menu item ([#1966](https://github.com/akveo/ngx-admin/issues/1966)) ([658aa19](https://github.com/akveo/ngx-admin/commit/658aa19)), closes [#1965](https://github.com/akveo/ngx-admin/issues/1965)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* update dependencies (Angular, Nebular) ([#2072](https://github.com/akveo/ngx-admin/issues/2072)) ([db2f451](https://github.com/akveo/ngx-admin/commit/db2f451))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="3.1.0"></a>
|
||||||
|
# [3.1.0](https://github.com/akveo/ngx-admin/compare/v3.0.0...v3.1.0) (2019-01-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **datepicker:** fix datepicker arrow style ([#1925](https://github.com/akveo/ngx-admin/issues/1925)) ([a878197](https://github.com/akveo/ngx-admin/commit/a878197))
|
||||||
|
* **toggle-settings-button:** position while search open ([#1993](https://github.com/akveo/ngx-admin/issues/1993)) ([f17aa32](https://github.com/akveo/ngx-admin/commit/f17aa32))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **animation:** add fade in animation by route change ([#1958](https://github.com/akveo/ngx-admin/issues/1958)) ([773c14e](https://github.com/akveo/ngx-admin/commit/773c14e))
|
||||||
|
* **data:** update data module, add new mock data ([#1960](https://github.com/akveo/ngx-admin/issues/1960)) ([47d232b](https://github.com/akveo/ngx-admin/commit/47d232b))
|
||||||
|
* **layout config:** reduce gear button size ([#2002](https://github.com/akveo/ngx-admin/issues/2002)) ([1f56f2a](https://github.com/akveo/ngx-admin/commit/1f56f2a))
|
||||||
|
* **settings:** redesign setting sidebar ([#1982](https://github.com/akveo/ngx-admin/issues/1982)) ([a73662f](https://github.com/akveo/ngx-admin/commit/a73662f))
|
||||||
|
* **sidebar:** remove label new from sidebar ([#1921](https://github.com/akveo/ngx-admin/issues/1921)) ([d80c8da](https://github.com/akveo/ngx-admin/commit/d80c8da))
|
||||||
|
* update Nebular to 3.1.0 ([33db902](https://github.com/akveo/ngx-admin/commit/33db902))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="3.0.0"></a>
|
||||||
|
# [3.0.0](https://github.com/akveo/ngx-admin/compare/v2.3.0...v3.0.0) (2018-11-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **buttons:** change tiny button class to x-small ([#1826](https://github.com/akveo/ngx-admin/issues/1826)) ([a721fd8](https://github.com/akveo/ngx-admin/commit/a721fd8))
|
||||||
|
* **chart:** resize chart on sidebar expand/collapse ([#1816](https://github.com/akveo/ngx-admin/issues/1816)) ([aa8e7cd](https://github.com/akveo/ngx-admin/commit/aa8e7cd))
|
||||||
|
* **readme:** update doc (starter kit) link ([#1770](https://github.com/akveo/ngx-admin/issues/1770)) ([6456141](https://github.com/akveo/ngx-admin/commit/6456141))
|
||||||
|
* **tslint:** add correct semicolon option ([#1777](https://github.com/akveo/ngx-admin/issues/1777)) ([00e6ca5](https://github.com/akveo/ngx-admin/commit/00e6ca5))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **app:** update Nebular to the latest 2.0.1 version ([#1868](https://github.com/akveo/ngx-admin/issues/1868)) ([16bcc90](https://github.com/akveo/ngx-admin/commit/16bcc90)), closes [#1866](https://github.com/akveo/ngx-admin/issues/1866)
|
||||||
|
* **dashboard:** add new E-commerce dashboard ([#1754](https://github.com/akveo/ngx-admin/issues/1754)) ([56e4709](https://github.com/akveo/ngx-admin/commit/56e4709))
|
||||||
|
* **icons:** update font awesome to 5.2.0 ([#1798](https://github.com/akveo/ngx-admin/issues/1798)) ([f20c371](https://github.com/akveo/ngx-admin/commit/f20c371))
|
||||||
|
* add a bunch of new Nebular demos ([#1911](https://github.com/akveo/ngx-admin/issues/1911)) ([3f1f4c5](https://github.com/akveo/ngx-admin/commit/3f1f4c5))
|
||||||
|
* **icons:** add eva-icons ([#1912](https://github.com/akveo/ngx-admin/issues/1912)) ([b3d7b7b](https://github.com/akveo/ngx-admin/commit/b3d7b7b))
|
||||||
|
* add ng2-completer to dependencies list ([3482404](https://github.com/akveo/ngx-admin/commit/3482404))
|
||||||
|
* **app:** angular 7+ update ([#1910](https://github.com/akveo/ngx-admin/issues/1910)) ([aa7579c](https://github.com/akveo/ngx-admin/commit/aa7579c)), closes [#1890](https://github.com/akveo/ngx-admin/issues/1890)
|
||||||
|
* **app:** update Nebular to 3.0.0 version ([#1916](https://github.com/akveo/ngx-admin/issues/1916)) ([c594a5a](https://github.com/akveo/ngx-admin/commit/c594a5a))
|
||||||
|
* **app:** update Nebular to rc.10 ([50961f3](https://github.com/akveo/ngx-admin/commit/50961f3))
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* Angular 7+ now required.
|
||||||
|
The following libraries were updated:
|
||||||
|
- @agm/core
|
||||||
|
- @ng-bootstrap/ng-bootstrap
|
||||||
|
- @swimlane/ngx-charts
|
||||||
|
- ng2-ckeditor
|
||||||
|
- ngx-echarts
|
||||||
|
* **icons:** Since this is a major package update we recommend looking through the upgrade guide https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="2.3.0"></a>
|
||||||
|
# [2.3.0 - Corporate Theme](https://github.com/akveo/ngx-admin/compare/v2.2.0...v2.3.0) (2018-06-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **buttons:** Uncheck checkbox after click ([#1721](https://github.com/akveo/ngx-admin/issues/1721)) ([fbe12a9](https://github.com/akveo/ngx-admin/commit/fbe12a9)), closes [#1697](https://github.com/akveo/ngx-admin/issues/1697)
|
||||||
|
* **readme:** update docs link ([#1743](https://github.com/akveo/ngx-admin/issues/1743)) ([a6d5d49](https://github.com/akveo/ngx-admin/commit/a6d5d49))
|
||||||
|
* **temperature:** fix temperature dragger gradient, fix switcher button hover background ([#1745](https://github.com/akveo/ngx-admin/issues/1745)) ([f12bd9f](https://github.com/akveo/ngx-admin/commit/f12bd9f))
|
||||||
|
* **tree:** fix tree component, replace ng2-tree on the angular-tree-component ([22c161f](https://github.com/akveo/ngx-admin/commit/22c161f)), closes [#1690](https://github.com/akveo/ngx-admin/issues/1690)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* update Nebular to rc.9 ([#1741](https://github.com/akveo/ngx-admin/issues/1741)) ([18a4750](https://github.com/akveo/ngx-admin/commit/18a4750))
|
||||||
|
* **app:** set default font-size to 14px ([#1742](https://github.com/akveo/ngx-admin/issues/1742)) ([6d705d2](https://github.com/akveo/ngx-admin/commit/6d705d2))
|
||||||
|
* **icons:** update icons, add new nebular icons to icons list ([#1738](https://github.com/akveo/ngx-admin/issues/1738)) ([cef6ea6](https://github.com/akveo/ngx-admin/commit/cef6ea6))
|
||||||
|
* **readme:** add new theme ([#1744](https://github.com/akveo/ngx-admin/issues/1744)) ([d25ad7a](https://github.com/akveo/ngx-admin/commit/d25ad7a))
|
||||||
|
* **theme:** add corporate theme ([#1727](https://github.com/akveo/ngx-admin/issues/1727)) ([e37f12d](https://github.com/akveo/ngx-admin/commit/e37f12d))
|
||||||
|
* **toaster:** update toaster to latest version (6.0.0) ([#1722](https://github.com/akveo/ngx-admin/issues/1722)) ([b85034e](https://github.com/akveo/ngx-admin/commit/b85034e))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="2.2.0"></a>
|
||||||
|
# [2.2.0](https://github.com/akveo/ngx-admin/compare/v2.1.1...v2.2.0) (2018-05-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add NotFound page ([#1672](https://github.com/akveo/ngx-admin/issues/1672)) ([fa3cdf7](https://github.com/akveo/ngx-admin/commit/fa3cdf7))
|
||||||
|
* RTL support ([#1634](https://github.com/akveo/ngx-admin/issues/1634)) ([3b63759](https://github.com/akveo/ngx-admin/commit/3b63759))
|
||||||
|
* update to Angular 6 ([#1684](https://github.com/akveo/ngx-admin/issues/1684)) ([06d2197](https://github.com/akveo/ngx-admin/commit/06d2197))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="2.1.1"></a>
|
||||||
|
## [2.1.1](https://github.com/akveo/ngx-admin/compare/v2.1.0...v2.1.1) (2018-04-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **dashboard:** fix temp/humidity buttons ([0f494dc](https://github.com/akveo/ngx-admin/commit/0f494dc))
|
||||||
|
* **echarts:** fix x-axis style ([ba6877c](https://github.com/akveo/ngx-admin/commit/ba6877c))
|
||||||
|
* **icons:** remove All Nebular Icons link as there are no more icons ([edb05b7](https://github.com/akveo/ngx-admin/commit/edb05b7)), closes [#1597](https://github.com/akveo/ngx-admin/issues/1597)
|
||||||
|
* **ie:** add es7 object polyfill for IE ([0630fe7](https://github.com/akveo/ngx-admin/commit/0630fe7))
|
||||||
|
* **map:** get the bubble map back (thanks to @SUlbrichA) ([#1655](https://github.com/akveo/ngx-admin/issues/1655)) ([19f9d0e](https://github.com/akveo/ngx-admin/commit/19f9d0e)), closes [#1576](https://github.com/akveo/ngx-admin/issues/1576)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **search-map:** set default location Minsk ([#1573](https://github.com/akveo/ngx-admin/issues/1573)) ([b54ab9f](https://github.com/akveo/ngx-admin/commit/b54ab9f))
|
||||||
|
* update nebular to rc.7 ([#1658](https://github.com/akveo/ngx-admin/issues/1658)) ([510d3c2](https://github.com/akveo/ngx-admin/commit/510d3c2))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="2.1.0"></a>
|
||||||
|
# [2.1.0](https://github.com/akveo/ngx-admin/compare/v2.0.2...v2.1.0) (2018-02-26)
|
||||||
|
|
||||||
|
Nebular updated to rc.6.
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **bootstrap:** radio temp fix ([14f5112](https://github.com/akveo/ngx-admin/commit/14f5112))
|
||||||
|
* **dashboard:** update btn group toggle html ([#1566](https://github.com/akveo/ngx-admin/issues/1566)) ([2aa114b](https://github.com/akveo/ngx-admin/commit/2aa114b))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **auth:** configurable auth social icons ([#1545](https://github.com/akveo/ngx-admin/issues/1545)) ([9381d8c](https://github.com/akveo/ngx-admin/commit/9381d8c)), closes [#1515](https://github.com/akveo/ngx-admin/issues/1515)
|
||||||
|
* **bootstrap:** update to 4.0.0 release ([ddb6306](https://github.com/akveo/ngx-admin/commit/ddb6306))
|
||||||
|
* **maps:** add google map with access search location dropdown ([97c7134](https://github.com/akveo/ngx-admin/commit/97c7134))
|
||||||
|
* **popover:** add popover showcase ([#1556](https://github.com/akveo/ngx-admin/issues/1556)) ([f4cdf4a](https://github.com/akveo/ngx-admin/commit/f4cdf4a))
|
||||||
|
* **security:** include @nebular/security, ACL setup ([#1565](https://github.com/akveo/ngx-admin/issues/1565)) ([480a90b](https://github.com/akveo/ngx-admin/commit/480a90b))
|
||||||
|
* **user:** replace `menu` with `nbContextMenu` directive ([fb5de37](https://github.com/akveo/ngx-admin/commit/fb5de37))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="2.0.2"></a>
|
||||||
|
## [2.0.2](https://github.com/akveo/ngx-admin/compare/v2.0.1...v2.0.2) (2018-01-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **dashboard:** fix mistyped ngbDropdownMenu in some ngbDropdown ul elements ([#1458](https://github.com/akveo/ngx-admin/issues/1458)) ([fa83572](https://github.com/akveo/ngx-admin/commit/fa83572))
|
||||||
|
* **dashboard:** fix typo in styles ([#1460](https://github.com/akveo/ngx-admin/issues/1460)) ([630c249](https://github.com/akveo/ngx-admin/commit/630c249))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **dependencies:** update dependencies, angular 5+, nebular rc.4 ([26e16ed](https://github.com/akveo/ngx-admin/commit/26e16ed))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="2.0.1"></a>
|
||||||
|
## [2.0.1](https://github.com/akveo/ngx-admin/compare/v2.0.0...v2.0.1) (2017-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
Nebular changelog is available [here](https://github.com/akveo/nebular/blob/master/CHANGELOG.md#200-rc3-2017-10-26) for more details.
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **bootstrap:** update bootstrap to beta.2, nebular to rc.3 ([b525213](https://github.com/akveo/ngx-admin/commit/b525213))
|
||||||
|
* **compodoc:** add compodoc documentation generator ([#1327](https://github.com/akveo/ngx-admin/issues/1327)) ([eebbc12](https://github.com/akveo/ngx-admin/commit/eebbc12))
|
||||||
|
* **loader:** add loading progress indicator ([#1319](https://github.com/akveo/ngx-admin/issues/1319)) ([f479715](https://github.com/akveo/ngx-admin/commit/f479715))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
27
CODE_OF_CONDUCT.md
Normal file
27
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Contributor Code of Conduct
|
||||||
|
|
||||||
|
As contributors and maintainers of the ngx-admin project, and in the interest of fostering an open and welcoming community,
|
||||||
|
we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
||||||
|
|
||||||
|
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender,
|
||||||
|
gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality or anything else.
|
||||||
|
|
||||||
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery
|
||||||
|
* Personal attacks
|
||||||
|
* Trolling or insulting/derogatory comments
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
|
||||||
|
* Other unethical or unprofessional conduct.
|
||||||
|
|
||||||
|
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues,
|
||||||
|
and other contributions that are not aligned to this Code of Conduct.
|
||||||
|
By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project.
|
||||||
|
Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
|
||||||
|
|
||||||
|
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
|
||||||
221
CONTRIBUTING.md
Normal file
221
CONTRIBUTING.md
Normal file
@ -0,0 +1,221 @@
|
|||||||
|
# Contributing to ngx-admin
|
||||||
|
|
||||||
|
We would love for you to contribute to ngx-admin and help make it ever better together! :rocket:
|
||||||
|
|
||||||
|
- [Code of Conduct](#coc)
|
||||||
|
- [Question or Problem?](#question)
|
||||||
|
- [Issues and Bugs](#issue)
|
||||||
|
- [Feature Requests](#feature)
|
||||||
|
- [Submission Guidelines](#submit-pr)
|
||||||
|
- [Coding Rules](#rules)
|
||||||
|
- [Commit Message Guidelines](#commit)
|
||||||
|
|
||||||
|
## <a name="coc"></a> Code of Conduct
|
||||||
|
Help us keep ngx-admin open and inclusive. Please read and follow our [Code of Conduct][coc].
|
||||||
|
|
||||||
|
## <a name="question"></a> Got a Question or Problem?
|
||||||
|
|
||||||
|
Please do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on [StackOverflow][stackoverflow] where the questions should be tagged with tag `ngx-admin`.
|
||||||
|
|
||||||
|
StackOverflow is a much better place to ask questions since:
|
||||||
|
|
||||||
|
- there are thousands of people willing to help on StackOverflow
|
||||||
|
- questions and answers stay available for public viewing so your question / answer might help someone else
|
||||||
|
- StackOverflow's voting system assures that the best answers are prominently visible.
|
||||||
|
|
||||||
|
To save your and our time, we will be systematically closing all the issues that are requests for general support and redirecting people to StackOverflow.
|
||||||
|
|
||||||
|
|
||||||
|
## <a name="issue"></a> Found an Issue?
|
||||||
|
If you find a bug in the source code or a mistake in the documentation, you can help us by
|
||||||
|
[submitting an issue](#submit-issue) to our [GitHub Repository][github]. Including an issue
|
||||||
|
reproduction (via CodePen, JsBin, Plunkr, GitHub repo, etc.) is the absolute best way to help the team quickly
|
||||||
|
diagnose the problem. Screenshots and error stack traces are also helpful.
|
||||||
|
|
||||||
|
Please follow this simple checklist before submitting:
|
||||||
|
|
||||||
|
* If you have a question about using ngx-admin, please ask on the [StackOverflow][stackoverflow].
|
||||||
|
|
||||||
|
* It is required that you clearly describe the steps necessary to reproduce the issue you are running into. Although we would love to help our users as much as possible, diagnosing issues without clear reproduction steps is extremely time-consuming and simply not sustainable.
|
||||||
|
|
||||||
|
* The issue list of this repository is exclusively for bug reports and feature requests. Non-conforming issues will be closed immediately.
|
||||||
|
|
||||||
|
* Issues with no clear steps to reproduce will not be triaged. If an issue is labeled with "needs info" and receives no further replies from the author of the issue for more than 5 days, it will be closed.
|
||||||
|
|
||||||
|
* If you think you have found a bug, or have a new feature idea, please start by making sure it hasn't already been [reported][issues]. You can search through existing issues to see if there is a similar one reported. Include closed issues as it may have been closed with a solution.
|
||||||
|
|
||||||
|
* Next, [create a new issue](#submit-issue) that thoroughly explains the problem. Please fill out the populated issue form before submitting the issue.
|
||||||
|
|
||||||
|
## <a name="feature"></a> Want a Feature?
|
||||||
|
You can *request* a new feature by [submitting an issue](#submit-issue) to our [GitHub
|
||||||
|
Repository][github]. If you would like to *implement* a new feature, please submit an issue with
|
||||||
|
a proposal for your work first, to be sure that we can use it.
|
||||||
|
Please consider what kind of change it is:
|
||||||
|
|
||||||
|
* For a **Major Feature**, first open an issue and outline your proposal so that it can be
|
||||||
|
discussed. This will also allow us to better coordinate our efforts, prevent duplication of work,
|
||||||
|
and help you to craft the change so that it is successfully accepted into the project.
|
||||||
|
* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
|
||||||
|
|
||||||
|
### <a name="submit-issue"></a> Submitting an Issue
|
||||||
|
Before you submit an issue, search the archive, maybe your question was already answered.
|
||||||
|
|
||||||
|
If your issue appears to be a bug, and hasn't been reported, open a new issue.
|
||||||
|
Help us to maximize the effort we can spend fixing issues and adding new
|
||||||
|
features by not reporting duplicate issues. Please make sure to fill out the populated issue form before submitting the issue.
|
||||||
|
|
||||||
|
You can file new issues by providing the information [here][new_issue].
|
||||||
|
|
||||||
|
|
||||||
|
### <a name="submit-pr"></a> Submitting a Pull Request (PR)
|
||||||
|
Before you submit your Pull Request (PR) consider the following guidelines:
|
||||||
|
|
||||||
|
* Search [GitHub][pulls] for an open or closed PR
|
||||||
|
that relates to your submission. You don't want to duplicate effort.
|
||||||
|
* Make your changes in a new git branch:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git checkout -b my-fix-branch master
|
||||||
|
```
|
||||||
|
* Read the [developer documentation][dev-doc].
|
||||||
|
* Create your patch, **including appropriate test cases**.
|
||||||
|
* Follow our [Coding Rules](#rules).
|
||||||
|
* Test your changes with our supported browsers and screen readers.
|
||||||
|
* Commit your changes using a descriptive commit message that follows our
|
||||||
|
[commit message conventions](#commit). Adherence to these conventions
|
||||||
|
is necessary because release notes are automatically generated from these messages.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git commit -a
|
||||||
|
```
|
||||||
|
Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
|
||||||
|
|
||||||
|
* Push your branch to GitHub:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git push my-fork my-fix-branch
|
||||||
|
```
|
||||||
|
|
||||||
|
* In GitHub, send a pull request to `ngx-admin:master`.
|
||||||
|
* If we suggest changes then:
|
||||||
|
* Make the required updates.
|
||||||
|
* Re-run `npm run release:validate` to ensure tests are still passing, linter & build has no errors.
|
||||||
|
* Rebase your branch and force push to your GitHub repository (this will update your Pull
|
||||||
|
Request):
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git rebase master -i
|
||||||
|
git push -f
|
||||||
|
```
|
||||||
|
|
||||||
|
That's it! Thank you for your contribution!
|
||||||
|
|
||||||
|
#### After your pull request is merged
|
||||||
|
|
||||||
|
After your pull request is merged, you can safely delete your branch and pull the changes
|
||||||
|
from the main (upstream) repository:
|
||||||
|
|
||||||
|
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as
|
||||||
|
follows:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git push my-fork --delete my-fix-branch
|
||||||
|
```
|
||||||
|
|
||||||
|
* Check out the master branch:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git checkout master -f
|
||||||
|
```
|
||||||
|
|
||||||
|
* Delete the local branch:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git branch -D my-fix-branch
|
||||||
|
```
|
||||||
|
|
||||||
|
* Update your master with the latest upstream version:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git pull --ff upstream master
|
||||||
|
```
|
||||||
|
|
||||||
|
## <a name="rules"></a> Coding Rules
|
||||||
|
To ensure consistency throughout the source code, keep these rules in mind as you are working:
|
||||||
|
|
||||||
|
* All features or bug fixes **must be tested** by one or more specs (unit-tests).
|
||||||
|
* All public API methods **must be documented** following JsDoc notation.
|
||||||
|
|
||||||
|
## <a name="commit"></a> Commit Message Guidelines
|
||||||
|
|
||||||
|
We have very precise rules over how our git commit messages can be formatted. This leads to **more
|
||||||
|
readable messages** that are easy to follow when looking through the **project history**. But also,
|
||||||
|
we use the git commit messages to **generate the ngx-admin change log**.
|
||||||
|
|
||||||
|
### Commit Message Format
|
||||||
|
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
|
||||||
|
format that includes a **type**, a **scope** and a **subject**:
|
||||||
|
|
||||||
|
```
|
||||||
|
<type>(<scope>): <subject>
|
||||||
|
<BLANK LINE>
|
||||||
|
<body>
|
||||||
|
<BLANK LINE>
|
||||||
|
<footer>
|
||||||
|
```
|
||||||
|
|
||||||
|
The **header** is mandatory and the **scope** of the header is optional.
|
||||||
|
|
||||||
|
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
|
||||||
|
to read on GitHub as well as in various git tools.
|
||||||
|
|
||||||
|
### Revert
|
||||||
|
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of
|
||||||
|
the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is
|
||||||
|
the SHA of the commit being reverted.
|
||||||
|
|
||||||
|
### Type
|
||||||
|
Must be one of the following:
|
||||||
|
|
||||||
|
* **feat**: A new feature
|
||||||
|
* **fix**: A bug fix
|
||||||
|
* **docs**: Documentation only changes
|
||||||
|
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
|
||||||
|
semi-colons, etc)
|
||||||
|
* **refactor**: A code change that neither fixes a bug nor adds a feature
|
||||||
|
* **perf**: A code change that improves performance
|
||||||
|
* **test**: Adding missing tests or correcting existing tests
|
||||||
|
* **build**: Changes that affect the build system, CI configuration or external dependencies
|
||||||
|
(example scopes: gulp, broccoli, npm)
|
||||||
|
* **chore**: Other changes that don't modify `src` or `test` files
|
||||||
|
* **release**: Release version commit
|
||||||
|
|
||||||
|
### Scope
|
||||||
|
The scope could be anything specifying place of the commit change. For example
|
||||||
|
`menu`, `sidebar`, etc.
|
||||||
|
|
||||||
|
### Subject
|
||||||
|
The subject contains succinct description of the change:
|
||||||
|
|
||||||
|
* use the imperative, present tense: "change" not "changed" nor "changes"
|
||||||
|
* don't capitalize first letter
|
||||||
|
* no dot (.) at the end
|
||||||
|
|
||||||
|
### Body
|
||||||
|
Optional. Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
|
||||||
|
The body should include the motivation for the change and contrast this with previous behavior.
|
||||||
|
|
||||||
|
### Footer
|
||||||
|
Optional. The footer should contain any information about **Breaking Changes** and is also the place to
|
||||||
|
reference GitHub issues that this commit **Closes**.
|
||||||
|
|
||||||
|
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines.
|
||||||
|
The rest of the commit message is then used for this.
|
||||||
|
|
||||||
|
[coc]: CODE_OF_CONDUCT.md
|
||||||
|
[dev-doc]: DEV_DOCS.md
|
||||||
|
[github]: https://github.com/akveo/ngx-admin
|
||||||
|
[stackoverflow]: https://stackoverflow.com/questions/tagged/ngx-admin
|
||||||
|
[issues]: https://github.com/akveo/ngx-admin/issues
|
||||||
|
[new_issue]: https://github.com/akveo/ngx-admin/issues/new
|
||||||
|
[pulls]: https://github.com/akveo/ngx-admin/pulls
|
||||||
1
DEV_DOCS.md
Normal file
1
DEV_DOCS.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
Please have a look at [Nebular Dev Docs](https://github.com/akveo/nebular/blob/master/DEV_DOCS.md).
|
||||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2017 akveo.com
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
102
README.md
Normal file
102
README.md
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
# ngx-admin [<img src="https://i.imgur.com/oMcxwZ0.png" alt="Eva Design System" height="20px" />](https://eva.design?utm_campaign=eva_design%20-%20home%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin&utm_medium=referral&utm_content=top_status_tile) [](https://travis-ci.org/akveo/ngx-admin)
|
||||||
|
|
||||||
|
[Who uses ngx-admin?](https://github.com/akveo/ngx-admin/issues/1645)| [Documentation](https://akveo.github.io/ngx-admin?utm_campaign=ngx_admin%20-%20home%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin&utm_medium=referral&utm_content=github_readme_documentation_link) | [Installation Guidelines](https://akveo.github.io/ngx-admin/docs/getting-started/what-is-ngxadmin?utm_campaign=ngx_admin%20-%20home%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin&utm_medium=referral&utm_content=github_readme_installation_guidelines) | [Angular templates](https://www.akveo.com/templates?utm_campaign=services%20-%20github%20-%20templates&utm_source=ngx_admin&utm_medium=referral&utm_content=github%20readme%20top%20angular%20templates%20link)
|
||||||
|
|
||||||
|
# Installation notes
|
||||||
|
|
||||||
|
To install ngx-admin you have to use NodeJS version 14.14+ because of [node-sass](https://github.com/sass/node-sass) version utilized in the application.
|
||||||
|
|
||||||
|
# Material theme for ngx-admin
|
||||||
|
|
||||||
|
Material admin theme is based on the most popular Angular dashboard template - [ngx-admin](https://akveo.github.io/ngx-admin?utm_campaign=ngx_admin%20-%20home%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin_material&utm_medium=referral&utm_content=github_readme)
|
||||||
|
To use material theme checkout `feat/material-theme` branch.
|
||||||
|
|
||||||
|
## Key features
|
||||||
|
|
||||||
|
- The most popular and trusted Angular open source dashboard template is out there. Used by hundreds of thousands developers worldwide and Fortune 500 companies\*.
|
||||||
|
- Over 40+ Angular Components and 60+ Usage Examples. Kick off your project and save money by using ngx-admin.
|
||||||
|
- Already using ngx-admin and willing to switch to material theme? Material theme is backward-compatible. Check out the article describing how to do that.
|
||||||
|
- ngx-admin material works perfectly with Angular Material and Nebular. Take the best from both!
|
||||||
|
|
||||||
|
### To use material theme checkout `feat/material-theme` branch
|
||||||
|
|
||||||
|
# Admin template based on Angular 12+ and <a href="https://github.com/akveo/nebular">Nebular</a>
|
||||||
|
|
||||||
|
<a target="_blank" href="https://akveo.com/ngx-admin/pages/dashboard?theme=corporate&utm_campaign=ngx_admin%20-%20demo%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin&utm_medium=referral&utm_content=hero_banner_corporate"><img src="https://i.imgur.com/mFdqvgG.png"/></a>
|
||||||
|
|
||||||
|
### UI Bakery
|
||||||
|
|
||||||
|
Try low-code internal tool builder for free
|
||||||
|
<a href="https://uibakery.io/?utm_source=github&utm_medium=clicks&utm_campaign=banner"><img src="https://user-images.githubusercontent.com/6151971/125071660-41f84900-e0c2-11eb-882a-0c675eb1e5e3.png"></a>
|
||||||
|
|
||||||
|
[Check out our Store](https://store.akveo.com/pages/all-collections?utm_campaign=akveo_store%20-%20all%20bundles%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin&utm_medium=referral%20&utm_content=check_out_our_store) for ready to use Backend Bundles.
|
||||||
|
|
||||||
|
### Templates
|
||||||
|
|
||||||
|
<a href="https://www.akveo.com/templates/fleet-management-dashboard?utm_campaign=services%20[…]x-admin%20&utm_medium=referral%20&utm_content=github_banner%20"><img src="https://i.imgur.com/Z8EwGfh.png"></a>
|
||||||
|
|
||||||
|
### With 6 stunning visual themes
|
||||||
|
|
||||||
|
| <a target="_blank" href="https://www.akveo.com/ngx-admin/pages/dashboard?theme=material-dark&utm_campaign=ngx_admin%20-%20demo%20-%20ngx_admin%20docs&utm_source=ngx_admin&utm_medium=referral&utm_content=ngx_admin_material_themes_material_dark"><img src="https://i.imgur.com/67YAlhf.png"/></a> | <a target="_blank" href="https://www.akveo.com/ngx-admin/pages/dashboard?theme=material-light&utm_campaign=ngx_admin%20-%20demo%20-%20ngx_admin%20docs&utm_source=ngx_admin&utm_medium=referral&utm_content=ngx_admin_material_themes_material_light"><img src="https://i.imgur.com/aQzw0hD.png"/></a> |
|
||||||
|
| --- | --- |
|
||||||
|
| Material Dark | Material Light |
|
||||||
|
|
||||||
|
| <a target="_blank" href="https://www.akveo.com/ngx-admin/pages/dashboard?theme=dark&utm_campaign=ngx_admin%20-%20demo%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin&utm_medium=referral&utm_content=github_readme_theme_dark"><img src="https://i.imgur.com/9UkTGgr.png"/></a> | <a target="_blank" href="https://akveo.com/ngx-admin/pages/dashboard?theme=default&utm_campaign=ngx_admin%20-%20demo%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin&utm_medium=referral&utm_content=github_readme_theme_default"><img src="https://i.imgur.com/Kn3xDKQ.png"/></a> |
|
||||||
|
| --- | --- |
|
||||||
|
| Dark| Default |
|
||||||
|
|
||||||
|
| <a target="_blank" href="https://www.akveo.com/ngx-admin/pages/dashboard?theme=cosmic&utm_campaign=ngx_admin%20-%20demo%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin&utm_medium=referral&utm_content=github_readme_theme_cosmic"><img src="https://i.imgur.com/iJu2YDF.png"/></a> | <a target="_blank" href="https://www.akveo.com/ngx-admin/pages/dashboard?theme=corporate&utm_campaign=ngx_admin%20-%20demo%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin&utm_medium=referral&utm_content=github_readme_theme_corporate"><img src="https://i.imgur.com/GpUt6NW.png"/></a> |
|
||||||
|
| --- | --- |
|
||||||
|
| Cosmic | Corporate |
|
||||||
|
|
||||||
|
### What's included:
|
||||||
|
|
||||||
|
- Angular 12+ & Typescript
|
||||||
|
- Bootstrap 4+ & SCSS
|
||||||
|
- Responsive layout
|
||||||
|
- RTL support
|
||||||
|
- High resolution
|
||||||
|
- Flexibly configurable themes with **hot-reload** (3 themes included)
|
||||||
|
- Authentication module with multiple providers
|
||||||
|
- 40+ Angular Components
|
||||||
|
- 60+ Usage Examples
|
||||||
|
|
||||||
|
### Demo
|
||||||
|
|
||||||
|
<a target="_blank" href="http://www.akveo.com/ngx-admin/?utm_campaign=ngx_admin%20-%20demo%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin&utm_medium=referral&utm_content=live_demo_link">Live Demo</a>
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
This template is using [Nebular](https://github.com/akveo/nebular) modules set, [here you can find documentation and other useful articles](https://akveo.github.io/nebular/docs/guides/install-based-on-starter-kit?utm_campaign=nebular%20-%20docs%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin&utm_medium=referral&utm_content=documentation_useful_articles).
|
||||||
|
|
||||||
|
### Empty starter kit
|
||||||
|
|
||||||
|
Don't need all the pages and modules and just looking for an empty starter kit for your next project? Check out our [starter-kit branch](https://github.com/akveo/ngx-admin/tree/starter-kit).
|
||||||
|
|
||||||
|
## BrowserStack
|
||||||
|
|
||||||
|
This project runs its tests on multiple desktop and mobile browsers using [BrowserStack](http://www.browserstack.com).
|
||||||
|
|
||||||
|
<img src="https://cloud.githubusercontent.com/assets/131406/22254249/534d889e-e254-11e6-8427-a759fb23b7bd.png" height="40" />
|
||||||
|
|
||||||
|
## More from Akveo
|
||||||
|
|
||||||
|
- [Eva Icons](https://github.com/akveo/eva-icons) - 480+ beautiful Open Source icons
|
||||||
|
- [Nebular](https://github.com/akveo/nebular) - Angular Components, Auth and Security
|
||||||
|
- [Akveo templates](https://www.akveo.com/templates?utm_campaign=services%20-%20github%20-%20templates&utm_source=ngx_admin&utm_medium=referral&utm_content=ngx_admin%20github%20readme%20more%20from%20akveo%20link) - 10+ Ready-to-use apps templates to speed up your apps developments
|
||||||
|
|
||||||
|
### How can I support developers?
|
||||||
|
|
||||||
|
- Star our GitHub repo :star:
|
||||||
|
- Create pull requests, submit bugs, suggest new features or documentation updates :wrench:
|
||||||
|
- Follow us on [Twitter](https://twitter.com/akveo_inc) :feet:
|
||||||
|
- Like our page on [Facebook](https://www.facebook.com/akveo/) :thumbsup:
|
||||||
|
|
||||||
|
### Looking for engineering services?
|
||||||
|
|
||||||
|
Visit [our homepage](https://www.akveo.com?utm_campaign=services%20-%20akveo%20website%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin&utm_medium=referral&utm_content=looking_for_engineering_services_visit_homepage) or simply leave us a message to [contact@akveo.com](mailto:contact@akveo.com). We will be happy to work with you!
|
||||||
|
|
||||||
|
### From Developers
|
||||||
|
|
||||||
|
Made with :heart: by [Akveo team](https://www.akveo.com?utm_campaign=services%20-%20akveo%20website%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin&utm_medium=referral&utm_content=from_developers_made_by). Follow us on [Twitter](https://twitter.com/akveo_inc) to get the latest news first!
|
||||||
|
We're always happy to receive your feedback!
|
||||||
200
angular.json
Normal file
200
angular.json
Normal file
@ -0,0 +1,200 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
|
"version": 1,
|
||||||
|
"newProjectRoot": "projects",
|
||||||
|
"projects": {
|
||||||
|
"ngx-admin-demo": {
|
||||||
|
"root": "",
|
||||||
|
"sourceRoot": "src",
|
||||||
|
"projectType": "application",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
|
"options": {
|
||||||
|
"preserveSymlinks": true,
|
||||||
|
"outputPath": "dist",
|
||||||
|
"index": "src/index.html",
|
||||||
|
"main": "src/main.ts",
|
||||||
|
"tsConfig": "src/tsconfig.app.json",
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"assets": [
|
||||||
|
"src/assets",
|
||||||
|
"src/favicon.ico",
|
||||||
|
"src/favicon.png",
|
||||||
|
"src/web.config",
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "node_modules/leaflet/dist/images",
|
||||||
|
"output": "/assets/img/markers"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"node_modules/bootstrap/dist/css/bootstrap.css",
|
||||||
|
"node_modules/typeface-exo/index.css",
|
||||||
|
"node_modules/roboto-fontface/css/roboto/roboto-fontface.css",
|
||||||
|
"node_modules/ionicons/scss/ionicons.scss",
|
||||||
|
"node_modules/@fortawesome/fontawesome-free/css/all.css",
|
||||||
|
"node_modules/socicon/css/socicon.css",
|
||||||
|
"node_modules/nebular-icons/scss/nebular-icons.scss",
|
||||||
|
"node_modules/pace-js/templates/pace-theme-flash.tmpl.css",
|
||||||
|
"node_modules/leaflet/dist/leaflet.css",
|
||||||
|
"src/app/@theme/styles/styles.scss",
|
||||||
|
"src/assets/styles/site.scss"
|
||||||
|
],
|
||||||
|
"scripts": [
|
||||||
|
"node_modules/pace-js/pace.min.js",
|
||||||
|
"node_modules/tinymce/tinymce.min.js",
|
||||||
|
"node_modules/tinymce/themes/modern/theme.min.js",
|
||||||
|
"node_modules/tinymce/plugins/link/plugin.min.js",
|
||||||
|
"node_modules/tinymce/plugins/paste/plugin.min.js",
|
||||||
|
"node_modules/tinymce/plugins/table/plugin.min.js",
|
||||||
|
"node_modules/echarts/dist/echarts.min.js",
|
||||||
|
"node_modules/echarts/dist/extension/bmap.min.js",
|
||||||
|
"node_modules/chart.js/dist/Chart.min.js"
|
||||||
|
],
|
||||||
|
"allowedCommonJsDependencies": [
|
||||||
|
"angular2-chartjs",
|
||||||
|
"echarts",
|
||||||
|
"lodash",
|
||||||
|
"zrender/lib/svg/svg",
|
||||||
|
"zrender/lib/vml/vml"
|
||||||
|
],
|
||||||
|
"vendorChunk": true,
|
||||||
|
"extractLicenses": false,
|
||||||
|
"buildOptimizer": false,
|
||||||
|
"sourceMap": true,
|
||||||
|
"optimization": false,
|
||||||
|
"namedChunks": true
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "6kb"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"namedChunks": false,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"buildOptimizer": true,
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.prod.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": ""
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "ngx-admin-demo:build"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"browserTarget": "ngx-admin-demo:build:production"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "ngx-admin-demo:build"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"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/pace-js/pace.min.js",
|
||||||
|
"node_modules/tinymce/tinymce.min.js",
|
||||||
|
"node_modules/tinymce/themes/modern/theme.min.js",
|
||||||
|
"node_modules/tinymce/plugins/link/plugin.min.js",
|
||||||
|
"node_modules/tinymce/plugins/paste/plugin.min.js",
|
||||||
|
"node_modules/tinymce/plugins/table/plugin.min.js",
|
||||||
|
"node_modules/echarts/dist/echarts.min.js",
|
||||||
|
"node_modules/echarts/dist/extension/bmap.min.js",
|
||||||
|
"node_modules/chart.js/dist/Chart.min.js"
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"node_modules/bootstrap/dist/css/bootstrap.css",
|
||||||
|
"node_modules/typeface-exo/index.css",
|
||||||
|
"node_modules/roboto-fontface/css/roboto/roboto-fontface.css",
|
||||||
|
"node_modules/ionicons/scss/ionicons.scss",
|
||||||
|
"node_modules/font-awesome/scss/font-awesome.scss",
|
||||||
|
"node_modules/socicon/css/socicon.css",
|
||||||
|
"node_modules/nebular-icons/scss/nebular-icons.scss",
|
||||||
|
"node_modules/pace-js/templates/pace-theme-flash.tmpl.css",
|
||||||
|
"src/app/@theme/styles/styles.scss"
|
||||||
|
],
|
||||||
|
"assets": [
|
||||||
|
"src/assets",
|
||||||
|
"src/favicon.ico",
|
||||||
|
"src/favicon.png",
|
||||||
|
"src/web.config",
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "node_modules/leaflet/dist/images",
|
||||||
|
"output": "/assets/img/markers"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": [
|
||||||
|
"src/tsconfig.app.json",
|
||||||
|
"src/tsconfig.spec.json"
|
||||||
|
],
|
||||||
|
"typeCheck": true,
|
||||||
|
"exclude": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ngx-admin-demo-e2e": {
|
||||||
|
"root": "",
|
||||||
|
"sourceRoot": "",
|
||||||
|
"projectType": "application",
|
||||||
|
"architect": {
|
||||||
|
"e2e": {
|
||||||
|
"builder": "@angular-devkit/build-angular:protractor",
|
||||||
|
"options": {
|
||||||
|
"protractorConfig": "./protractor.conf.js",
|
||||||
|
"devServerTarget": "ngx-admin-demo:serve"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": [
|
||||||
|
"e2e/tsconfig.e2e.json"
|
||||||
|
],
|
||||||
|
"exclude": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultProject": "ngx-admin-demo",
|
||||||
|
"schematics": {
|
||||||
|
"@schematics/angular:component": {
|
||||||
|
"prefix": "ngx",
|
||||||
|
"style": "scss"
|
||||||
|
},
|
||||||
|
"@schematics/angular:directive": {
|
||||||
|
"prefix": "ngx"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
14
e2e/tsconfig.e2e.json
Normal file
14
e2e/tsconfig.e2e.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../out-tsc/e2e",
|
||||||
|
"baseUrl": "./",
|
||||||
|
"module": "commonjs",
|
||||||
|
"target": "es5",
|
||||||
|
"types": [
|
||||||
|
"jasmine",
|
||||||
|
"jasminewd2",
|
||||||
|
"node"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
45
karma.conf.js
Normal file
45
karma.conf.js
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
// Karma configuration file, see link for more information
|
||||||
|
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||||
|
|
||||||
|
module.exports = function (config) {
|
||||||
|
const configuration = {
|
||||||
|
basePath: '',
|
||||||
|
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||||
|
plugins: [
|
||||||
|
require('karma-jasmine'),
|
||||||
|
require('karma-chrome-launcher'),
|
||||||
|
require('karma-jasmine-html-reporter'),
|
||||||
|
require('karma-coverage-istanbul-reporter'),
|
||||||
|
require('@angular-devkit/build-angular/plugins/karma')
|
||||||
|
],
|
||||||
|
client:{
|
||||||
|
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||||
|
},
|
||||||
|
coverageIstanbulReporter: {
|
||||||
|
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
|
||||||
|
fixWebpackSourcePaths: true
|
||||||
|
},
|
||||||
|
angularCli: {
|
||||||
|
environment: 'dev'
|
||||||
|
},
|
||||||
|
reporters: ['progress', 'kjhtml'],
|
||||||
|
port: 9876,
|
||||||
|
colors: true,
|
||||||
|
logLevel: config.LOG_INFO,
|
||||||
|
autoWatch: true,
|
||||||
|
browsers: ['Chrome'],
|
||||||
|
customLaunchers: {
|
||||||
|
Chrome_travis_ci: {
|
||||||
|
base: 'Chrome',
|
||||||
|
flags: ['--no-sandbox']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
singleRun: false
|
||||||
|
};
|
||||||
|
|
||||||
|
if (process.env.TRAVIS) {
|
||||||
|
configuration.browsers = ['Chrome_travis_ci'];
|
||||||
|
}
|
||||||
|
|
||||||
|
config.set(configuration);
|
||||||
|
};
|
||||||
25
logs/xvba_debug.log
Normal file
25
logs/xvba_debug.log
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
2021-02-19 23:41:09 debug: Close Watch Excel Export VBA Files
|
||||||
|
2021-02-20 08:58:42 info: XVBA Live Server extension is now active!
|
||||||
|
2021-02-20 08:58:42 debug: Start Watch Excel Export VBA Files
|
||||||
|
2021-02-20 08:58:42 debug: Start Run Macro Server
|
||||||
|
2021-02-21 13:46:59 debug: Close Watch Excel Export VBA Files
|
||||||
|
2021-02-21 13:47:02 info: XVBA Live Server extension is now active!
|
||||||
|
2021-02-21 13:47:02 debug: Start Watch Excel Export VBA Files
|
||||||
|
2021-02-21 13:47:02 debug: Start Run Macro Server
|
||||||
|
2021-02-21 15:14:08 debug: Close Watch Excel Export VBA Files
|
||||||
|
2021-02-21 16:57:00 info: XVBA Live Server extension is now active!
|
||||||
|
2021-02-21 16:57:00 debug: Start Watch Excel Export VBA Files
|
||||||
|
2021-02-21 16:57:00 debug: Start Run Macro Server
|
||||||
|
2021-02-21 18:39:11 debug: Close Watch Excel Export VBA Files
|
||||||
|
2021-02-25 22:29:19 info: XVBA Live Server extension is now active!
|
||||||
|
2021-02-25 22:29:19 debug: Start Run Macro Server
|
||||||
|
2021-02-25 22:29:19 debug: Start Watch Excel Export VBA Files
|
||||||
|
2021-02-25 22:30:22 debug: Close Watch Excel Export VBA Files
|
||||||
|
2021-03-14 09:40:42 info: XVBA Live Server extension is now active!
|
||||||
|
2021-03-14 09:40:42 debug: Start Watch Excel Export VBA Files
|
||||||
|
2021-03-14 09:40:42 debug: Start Run Macro Server
|
||||||
|
2021-03-14 09:41:57 debug: Close Watch Excel Export VBA Files
|
||||||
|
2021-03-14 09:58:24 info: XVBA Live Server extension is now active!
|
||||||
|
2021-03-14 09:58:24 debug: Start Run Macro Server
|
||||||
|
2021-03-14 09:58:24 debug: Start Watch Excel Export VBA Files
|
||||||
|
2021-03-14 12:25:27 debug: Close Watch Excel Export VBA Files
|
||||||
46587
package-lock.json
generated
Normal file
46587
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
120
package.json
Normal file
120
package.json
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
{
|
||||||
|
"name": "ngx-admin",
|
||||||
|
"version": "8.0.0",
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/akveo/ngx-admin.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/akveo/ngx-admin/issues"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"ng": "ng",
|
||||||
|
"conventional-changelog": "conventional-changelog",
|
||||||
|
"start": "ng serve",
|
||||||
|
"build": "ng build --output-path \\\\ArkNAS\\docker\\nginx-proxy\\data\\ChurchAngular --prod",
|
||||||
|
"build:prod": "npm run build -- --configuration production --aot",
|
||||||
|
"test": "ng test",
|
||||||
|
"test:coverage": "rimraf coverage && npm run test -- --code-coverage",
|
||||||
|
"lint": "ng lint",
|
||||||
|
"lint:fix": "ng lint ngx-admin-demo --fix",
|
||||||
|
"lint:styles": "stylelint ./src/**/*.scss",
|
||||||
|
"lint:ci": "npm run lint && npm run lint:styles",
|
||||||
|
"pree2e": "webdriver-manager update --standalone false --gecko false",
|
||||||
|
"e2e": "ng e2e",
|
||||||
|
"docs": "compodoc -p src/tsconfig.app.json -d docs",
|
||||||
|
"docs:serve": "compodoc -p src/tsconfig.app.json -d docs -s",
|
||||||
|
"prepush": "npm run lint:ci",
|
||||||
|
"release:changelog": "npm run conventional-changelog -- -p angular -i CHANGELOG.md -s",
|
||||||
|
"postinstall": "ngcc --properties es2015 es5 browser module main --first-only --create-ivy-entry-points --tsconfig \"./src/tsconfig.app.json\""
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@angular/animations": "^12.2.16",
|
||||||
|
"@angular/cdk": "12.1.0",
|
||||||
|
"@angular/common": "^12.2.16",
|
||||||
|
"@angular/compiler": "^12.2.16",
|
||||||
|
"@angular/core": "^12.2.16",
|
||||||
|
"@angular/forms": "^12.2.16",
|
||||||
|
"@angular/google-maps": "^12.2.13",
|
||||||
|
"@angular/platform-browser": "^12.2.16",
|
||||||
|
"@angular/platform-browser-dynamic": "^12.2.16",
|
||||||
|
"@angular/router": "^12.2.16",
|
||||||
|
"@asymmetrik/ngx-leaflet": "3.0.1",
|
||||||
|
"@microsoft/signalr": "^6.0.8",
|
||||||
|
"@nebular/auth": "8.0.0",
|
||||||
|
"@nebular/date-fns": "^9.0.3",
|
||||||
|
"@nebular/eva-icons": "8.0.0",
|
||||||
|
"@nebular/security": "8.0.0",
|
||||||
|
"@nebular/theme": "8.0.0",
|
||||||
|
"@swimlane/ngx-charts": "^14.0.0",
|
||||||
|
"angular2-chartjs": "0.4.1",
|
||||||
|
"angular2-qrcode": "^2.0.3",
|
||||||
|
"bootstrap": "4.3.1",
|
||||||
|
"chart.js": "2.7.1",
|
||||||
|
"ckeditor": "4.7.3",
|
||||||
|
"classlist.js": "1.1.20150312",
|
||||||
|
"core-js": "2.5.1",
|
||||||
|
"echarts": "^4.9.0",
|
||||||
|
"eva-icons": "^1.1.3",
|
||||||
|
"file-saver": "^2.0.5",
|
||||||
|
"intl": "1.2.5",
|
||||||
|
"ionicons": "2.0.1",
|
||||||
|
"leaflet": "1.2.0",
|
||||||
|
"nebular-icons": "1.1.0",
|
||||||
|
"ng-in-viewport": "^13.0.1",
|
||||||
|
"ng2-ckeditor": "~1.2.9",
|
||||||
|
"ng2-completer": "^9.0.1",
|
||||||
|
"ng2-smart-table": "^1.6.0",
|
||||||
|
"ngx-echarts": "^4.2.2",
|
||||||
|
"ngx-infinite-scroll": "^13.0.2",
|
||||||
|
"ngx-mask": "^12.0.0",
|
||||||
|
"node-sass": "^4.14.1",
|
||||||
|
"normalize.css": "6.0.0",
|
||||||
|
"pace-js": "1.0.2",
|
||||||
|
"roboto-fontface": "0.8.0",
|
||||||
|
"rxjs": "6.6.2",
|
||||||
|
"rxjs-compat": "6.3.0",
|
||||||
|
"socicon": "3.0.5",
|
||||||
|
"style-loader": "^1.3.0",
|
||||||
|
"tinymce": "4.5.7",
|
||||||
|
"tslib": "^2.3.1",
|
||||||
|
"typeface-exo": "0.0.22",
|
||||||
|
"typeit": "^8.7.0",
|
||||||
|
"web-animations-js": "^2.3.2",
|
||||||
|
"zone.js": "~0.11.4"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@angular-devkit/build-angular": "^12.1.4",
|
||||||
|
"@angular/cli": "^12.2.17",
|
||||||
|
"@angular/compiler-cli": "^12.2.16",
|
||||||
|
"@angular/language-service": "12.1.0",
|
||||||
|
"@compodoc/compodoc": "1.0.1",
|
||||||
|
"@fortawesome/fontawesome-free": "^5.2.0",
|
||||||
|
"@schematics/angular": "^14.1.3",
|
||||||
|
"@types/d3-color": "1.0.5",
|
||||||
|
"@types/jasmine": "~3.3.0",
|
||||||
|
"@types/jasminewd2": "2.0.3",
|
||||||
|
"@types/leaflet": "1.2.3",
|
||||||
|
"@types/node": "^12.12.70",
|
||||||
|
"codelyzer": "^6.0.2",
|
||||||
|
"conventional-changelog-cli": "1.3.4",
|
||||||
|
"husky": "0.13.3",
|
||||||
|
"jasmine-core": "~3.6.0",
|
||||||
|
"jasmine-spec-reporter": "~5.0.0",
|
||||||
|
"karma": "~6.3.19",
|
||||||
|
"karma-chrome-launcher": "~3.1.1",
|
||||||
|
"karma-cli": "1.0.1",
|
||||||
|
"karma-coverage-istanbul-reporter": "~3.0.2",
|
||||||
|
"karma-jasmine": "~4.0.2",
|
||||||
|
"karma-jasmine-html-reporter": "^1.7.0",
|
||||||
|
"npm-run-all": "4.0.2",
|
||||||
|
"protractor": "~7.0.0",
|
||||||
|
"rimraf": "2.6.1",
|
||||||
|
"stylelint": "7.13.0",
|
||||||
|
"ts-node": "3.2.2",
|
||||||
|
"tslint": "~6.1.0",
|
||||||
|
"tslint-language-service": "^0.9.9",
|
||||||
|
"typescript": "~4.2.3||~4.3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
32
protractor.conf.js
Normal file
32
protractor.conf.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
// Protractor configuration file, see link for more information
|
||||||
|
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
||||||
|
|
||||||
|
const { SpecReporter } = require('jasmine-spec-reporter');
|
||||||
|
|
||||||
|
exports.config = {
|
||||||
|
allScriptsTimeout: 11000,
|
||||||
|
specs: [
|
||||||
|
'./e2e/**/*.e2e-spec.ts'
|
||||||
|
],
|
||||||
|
capabilities: {
|
||||||
|
'browserName': 'chrome',
|
||||||
|
'chromeOptions': {
|
||||||
|
'args': ['show-fps-counter=true', '--no-sandbox']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
directConnect: true,
|
||||||
|
baseUrl: 'http://localhost:4200/',
|
||||||
|
framework: 'jasmine',
|
||||||
|
jasmineNodeOpts: {
|
||||||
|
showColors: true,
|
||||||
|
defaultTimeoutInterval: 30000,
|
||||||
|
print: function() {}
|
||||||
|
},
|
||||||
|
onPrepare() {
|
||||||
|
require('ts-node').register({
|
||||||
|
project: 'e2e/tsconfig.e2e.json'
|
||||||
|
});
|
||||||
|
|
||||||
|
jasmine.getEnv().addReporter(new SpecReporter({ acspec: { displayStacktrace: true } }));
|
||||||
|
}
|
||||||
|
};
|
||||||
170
src/app/@core/core.module.ts
Normal file
170
src/app/@core/core.module.ts
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { NbAuthModule, NbDummyAuthStrategy } from '@nebular/auth';
|
||||||
|
import { NbSecurityModule, NbRoleProvider } from '@nebular/security';
|
||||||
|
import { of as observableOf } from 'rxjs';
|
||||||
|
|
||||||
|
import { throwIfAlreadyLoaded } from './module-import-guard';
|
||||||
|
import {
|
||||||
|
AnalyticsService,
|
||||||
|
LayoutService,
|
||||||
|
PlayerService,
|
||||||
|
SeoService,
|
||||||
|
StateService,
|
||||||
|
} from './utils';
|
||||||
|
import { UserData } from './data/users';
|
||||||
|
import { ElectricityData } from './data/electricity';
|
||||||
|
import { SmartTableData } from './data/smart-table';
|
||||||
|
import { UserActivityData } from './data/user-activity';
|
||||||
|
import { OrdersChartData } from './data/orders-chart';
|
||||||
|
import { ProfitChartData } from './data/profit-chart';
|
||||||
|
import { TrafficListData } from './data/traffic-list';
|
||||||
|
import { EarningData } from './data/earning';
|
||||||
|
import { OrdersProfitChartData } from './data/orders-profit-chart';
|
||||||
|
import { TrafficBarData } from './data/traffic-bar';
|
||||||
|
import { ProfitBarAnimationChartData } from './data/profit-bar-animation-chart';
|
||||||
|
import { TemperatureHumidityData } from './data/temperature-humidity';
|
||||||
|
import { SolarData } from './data/solar';
|
||||||
|
import { TrafficChartData } from './data/traffic-chart';
|
||||||
|
import { StatsBarData } from './data/stats-bar';
|
||||||
|
import { CountryOrderData } from './data/country-order';
|
||||||
|
import { StatsProgressBarData } from './data/stats-progress-bar';
|
||||||
|
import { VisitorsAnalyticsData } from './data/visitors-analytics';
|
||||||
|
import { SecurityCamerasData } from './data/security-cameras';
|
||||||
|
|
||||||
|
import { UserService } from './mock/users.service';
|
||||||
|
import { ElectricityService } from './mock/electricity.service';
|
||||||
|
import { SmartTableService } from './mock/smart-table.service';
|
||||||
|
import { UserActivityService } from './mock/user-activity.service';
|
||||||
|
import { OrdersChartService } from './mock/orders-chart.service';
|
||||||
|
import { ProfitChartService } from './mock/profit-chart.service';
|
||||||
|
import { TrafficListService } from './mock/traffic-list.service';
|
||||||
|
import { EarningService } from './mock/earning.service';
|
||||||
|
import { OrdersProfitChartService } from './mock/orders-profit-chart.service';
|
||||||
|
import { TrafficBarService } from './mock/traffic-bar.service';
|
||||||
|
import { ProfitBarAnimationChartService } from './mock/profit-bar-animation-chart.service';
|
||||||
|
import { TemperatureHumidityService } from './mock/temperature-humidity.service';
|
||||||
|
import { SolarService } from './mock/solar.service';
|
||||||
|
import { TrafficChartService } from './mock/traffic-chart.service';
|
||||||
|
import { StatsBarService } from './mock/stats-bar.service';
|
||||||
|
import { CountryOrderService } from './mock/country-order.service';
|
||||||
|
import { StatsProgressBarService } from './mock/stats-progress-bar.service';
|
||||||
|
import { VisitorsAnalyticsService } from './mock/visitors-analytics.service';
|
||||||
|
import { SecurityCamerasService } from './mock/security-cameras.service';
|
||||||
|
import { MockDataModule } from './mock/mock-data.module';
|
||||||
|
|
||||||
|
const socialLinks = [
|
||||||
|
{
|
||||||
|
url: 'https://github.com/akveo/nebular',
|
||||||
|
target: '_blank',
|
||||||
|
icon: 'github',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: 'https://www.facebook.com/akveo/',
|
||||||
|
target: '_blank',
|
||||||
|
icon: 'facebook',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: 'https://twitter.com/akveo_inc',
|
||||||
|
target: '_blank',
|
||||||
|
icon: 'twitter',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const DATA_SERVICES = [
|
||||||
|
{ provide: UserData, useClass: UserService },
|
||||||
|
{ provide: ElectricityData, useClass: ElectricityService },
|
||||||
|
{ provide: SmartTableData, useClass: SmartTableService },
|
||||||
|
{ provide: UserActivityData, useClass: UserActivityService },
|
||||||
|
{ provide: OrdersChartData, useClass: OrdersChartService },
|
||||||
|
{ provide: ProfitChartData, useClass: ProfitChartService },
|
||||||
|
{ provide: TrafficListData, useClass: TrafficListService },
|
||||||
|
{ provide: EarningData, useClass: EarningService },
|
||||||
|
{ provide: OrdersProfitChartData, useClass: OrdersProfitChartService },
|
||||||
|
{ provide: TrafficBarData, useClass: TrafficBarService },
|
||||||
|
{ provide: ProfitBarAnimationChartData, useClass: ProfitBarAnimationChartService },
|
||||||
|
{ provide: TemperatureHumidityData, useClass: TemperatureHumidityService },
|
||||||
|
{ provide: SolarData, useClass: SolarService },
|
||||||
|
{ provide: TrafficChartData, useClass: TrafficChartService },
|
||||||
|
{ provide: StatsBarData, useClass: StatsBarService },
|
||||||
|
{ provide: CountryOrderData, useClass: CountryOrderService },
|
||||||
|
{ provide: StatsProgressBarData, useClass: StatsProgressBarService },
|
||||||
|
{ provide: VisitorsAnalyticsData, useClass: VisitorsAnalyticsService },
|
||||||
|
{ provide: SecurityCamerasData, useClass: SecurityCamerasService },
|
||||||
|
];
|
||||||
|
|
||||||
|
export class NbSimpleRoleProvider extends NbRoleProvider {
|
||||||
|
getRole() {
|
||||||
|
// here you could provide any role based on any auth flow
|
||||||
|
return observableOf('guest');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const NB_CORE_PROVIDERS = [
|
||||||
|
...MockDataModule.forRoot().providers,
|
||||||
|
...DATA_SERVICES,
|
||||||
|
...NbAuthModule.forRoot({
|
||||||
|
|
||||||
|
strategies: [
|
||||||
|
NbDummyAuthStrategy.setup({
|
||||||
|
name: 'email',
|
||||||
|
delay: 3000,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
forms: {
|
||||||
|
login: {
|
||||||
|
socialLinks: socialLinks,
|
||||||
|
},
|
||||||
|
register: {
|
||||||
|
socialLinks: socialLinks,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}).providers,
|
||||||
|
|
||||||
|
NbSecurityModule.forRoot({
|
||||||
|
accessControl: {
|
||||||
|
guest: {
|
||||||
|
view: '*',
|
||||||
|
},
|
||||||
|
user: {
|
||||||
|
parent: 'guest',
|
||||||
|
create: '*',
|
||||||
|
edit: '*',
|
||||||
|
remove: '*',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}).providers,
|
||||||
|
|
||||||
|
{
|
||||||
|
provide: NbRoleProvider, useClass: NbSimpleRoleProvider,
|
||||||
|
},
|
||||||
|
AnalyticsService,
|
||||||
|
LayoutService,
|
||||||
|
PlayerService,
|
||||||
|
SeoService,
|
||||||
|
StateService,
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
NbAuthModule,
|
||||||
|
],
|
||||||
|
declarations: [],
|
||||||
|
})
|
||||||
|
export class CoreModule {
|
||||||
|
constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
|
||||||
|
throwIfAlreadyLoaded(parentModule, 'CoreModule');
|
||||||
|
}
|
||||||
|
|
||||||
|
static forRoot(): ModuleWithProviders<CoreModule> {
|
||||||
|
return {
|
||||||
|
ngModule: CoreModule,
|
||||||
|
providers: [
|
||||||
|
...NB_CORE_PROVIDERS,
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
0
src/app/@core/data/.gitkeep
Normal file
0
src/app/@core/data/.gitkeep
Normal file
1
src/app/@core/data/README.md
Normal file
1
src/app/@core/data/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
Application-wise data providers.
|
||||||
6
src/app/@core/data/country-order.ts
Normal file
6
src/app/@core/data/country-order.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export abstract class CountryOrderData {
|
||||||
|
abstract getCountriesCategories(): Observable<string[]>;
|
||||||
|
abstract getCountriesCategoriesData(country: string): Observable<number[]>;
|
||||||
|
}
|
||||||
21
src/app/@core/data/earning.ts
Normal file
21
src/app/@core/data/earning.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export interface LiveUpdateChart {
|
||||||
|
liveChart: { value: [string, number] }[];
|
||||||
|
delta: {
|
||||||
|
up: boolean;
|
||||||
|
value: number;
|
||||||
|
};
|
||||||
|
dailyIncome: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PieChart {
|
||||||
|
value: number;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class EarningData {
|
||||||
|
abstract getEarningLiveUpdateCardData(currency: string): Observable<any[]>;
|
||||||
|
abstract getEarningCardData(currency: string): Observable<LiveUpdateChart>;
|
||||||
|
abstract getEarningPieChartData(): Observable<PieChart[]>;
|
||||||
|
}
|
||||||
25
src/app/@core/data/electricity.ts
Normal file
25
src/app/@core/data/electricity.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export interface Month {
|
||||||
|
month: string;
|
||||||
|
delta: string;
|
||||||
|
down: boolean;
|
||||||
|
kWatts: string;
|
||||||
|
cost: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Electricity {
|
||||||
|
title: string;
|
||||||
|
active?: boolean;
|
||||||
|
months: Month[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ElectricityChart {
|
||||||
|
label: string;
|
||||||
|
value: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class ElectricityData {
|
||||||
|
abstract getListData(): Observable<Electricity[]>;
|
||||||
|
abstract getChartData(): Observable<ElectricityChart[]>;
|
||||||
|
}
|
||||||
8
src/app/@core/data/orders-chart.ts
Normal file
8
src/app/@core/data/orders-chart.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
export interface OrdersChart {
|
||||||
|
chartLabel: string[];
|
||||||
|
linesData: number[][];
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class OrdersChartData {
|
||||||
|
abstract getOrdersChartData(period: string): OrdersChart;
|
||||||
|
}
|
||||||
14
src/app/@core/data/orders-profit-chart.ts
Normal file
14
src/app/@core/data/orders-profit-chart.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { OrdersChart } from './orders-chart';
|
||||||
|
import { ProfitChart } from './profit-chart';
|
||||||
|
|
||||||
|
export interface OrderProfitChartSummary {
|
||||||
|
title: string;
|
||||||
|
value: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class OrdersProfitChartData {
|
||||||
|
abstract getOrderProfitChartSummary(): Observable<OrderProfitChartSummary[]>;
|
||||||
|
abstract getOrdersChartData(period: string): Observable<OrdersChart>;
|
||||||
|
abstract getProfitChartData(period: string): Observable<ProfitChart>;
|
||||||
|
}
|
||||||
5
src/app/@core/data/profit-bar-animation-chart.ts
Normal file
5
src/app/@core/data/profit-bar-animation-chart.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export abstract class ProfitBarAnimationChartData {
|
||||||
|
abstract getChartData(): Observable<{ firstLine: number[]; secondLine: number[]; }>;
|
||||||
|
}
|
||||||
8
src/app/@core/data/profit-chart.ts
Normal file
8
src/app/@core/data/profit-chart.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
export interface ProfitChart {
|
||||||
|
chartLabel: string[];
|
||||||
|
data: number[][];
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class ProfitChartData {
|
||||||
|
abstract getProfitChartData(period: string): ProfitChart;
|
||||||
|
}
|
||||||
10
src/app/@core/data/security-cameras.ts
Normal file
10
src/app/@core/data/security-cameras.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export interface Camera {
|
||||||
|
title: string;
|
||||||
|
source: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class SecurityCamerasData {
|
||||||
|
abstract getCamerasData(): Observable<Camera[]>;
|
||||||
|
}
|
||||||
4
src/app/@core/data/smart-table.ts
Normal file
4
src/app/@core/data/smart-table.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
export abstract class SmartTableData {
|
||||||
|
abstract getData(): any[];
|
||||||
|
}
|
||||||
5
src/app/@core/data/solar.ts
Normal file
5
src/app/@core/data/solar.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export abstract class SolarData {
|
||||||
|
abstract getSolarData(): Observable<number>;
|
||||||
|
}
|
||||||
5
src/app/@core/data/stats-bar.ts
Normal file
5
src/app/@core/data/stats-bar.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export abstract class StatsBarData {
|
||||||
|
abstract getStatsBarData(): Observable<number[]>;
|
||||||
|
}
|
||||||
12
src/app/@core/data/stats-progress-bar.ts
Normal file
12
src/app/@core/data/stats-progress-bar.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export interface ProgressInfo {
|
||||||
|
title: string;
|
||||||
|
value: number;
|
||||||
|
activeProgress: number;
|
||||||
|
description: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class StatsProgressBarData {
|
||||||
|
abstract getProgressInfoData(): Observable<ProgressInfo[]>;
|
||||||
|
}
|
||||||
12
src/app/@core/data/temperature-humidity.ts
Normal file
12
src/app/@core/data/temperature-humidity.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export interface Temperature {
|
||||||
|
value: number;
|
||||||
|
min: number;
|
||||||
|
max: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class TemperatureHumidityData {
|
||||||
|
abstract getTemperatureData(): Observable<Temperature>;
|
||||||
|
abstract getHumidityData(): Observable<Temperature>;
|
||||||
|
}
|
||||||
11
src/app/@core/data/traffic-bar.ts
Normal file
11
src/app/@core/data/traffic-bar.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export interface TrafficBar {
|
||||||
|
data: number[];
|
||||||
|
labels: string[];
|
||||||
|
formatter: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class TrafficBarData {
|
||||||
|
abstract getTrafficBarData(period: string): Observable<TrafficBar>;
|
||||||
|
}
|
||||||
5
src/app/@core/data/traffic-chart.ts
Normal file
5
src/app/@core/data/traffic-chart.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export abstract class TrafficChartData {
|
||||||
|
abstract getTrafficChartData(): Observable<number[]>;
|
||||||
|
}
|
||||||
20
src/app/@core/data/traffic-list.ts
Normal file
20
src/app/@core/data/traffic-list.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export interface TrafficList {
|
||||||
|
date: string;
|
||||||
|
value: number;
|
||||||
|
delta: {
|
||||||
|
up: boolean;
|
||||||
|
value: number;
|
||||||
|
};
|
||||||
|
comparison: {
|
||||||
|
prevDate: string;
|
||||||
|
prevValue: number;
|
||||||
|
nextDate: string;
|
||||||
|
nextValue: number;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class TrafficListData {
|
||||||
|
abstract getTrafficListData(period: string): Observable<TrafficList>;
|
||||||
|
}
|
||||||
12
src/app/@core/data/user-activity.ts
Normal file
12
src/app/@core/data/user-activity.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export interface UserActive {
|
||||||
|
date: string;
|
||||||
|
pagesVisitCount: number;
|
||||||
|
deltaUp: boolean;
|
||||||
|
newVisits: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class UserActivityData {
|
||||||
|
abstract getUserActivityData(period: string): Observable<UserActive[]>;
|
||||||
|
}
|
||||||
21
src/app/@core/data/users.ts
Normal file
21
src/app/@core/data/users.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export interface User {
|
||||||
|
name: string;
|
||||||
|
picture: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Contacts {
|
||||||
|
user: User;
|
||||||
|
type: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RecentUsers extends Contacts {
|
||||||
|
time: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class UserData {
|
||||||
|
abstract getUsers(): Observable<User[]>;
|
||||||
|
abstract getContacts(): Observable<Contacts[]>;
|
||||||
|
abstract getRecentUsers(): Observable<RecentUsers[]>;
|
||||||
|
}
|
||||||
12
src/app/@core/data/visitors-analytics.ts
Normal file
12
src/app/@core/data/visitors-analytics.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
export interface OutlineData {
|
||||||
|
label: string;
|
||||||
|
value: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class VisitorsAnalyticsData {
|
||||||
|
abstract getInnerLineChartData(): Observable<number[]>;
|
||||||
|
abstract getOutlineLineChartData(): Observable<OutlineData[]>;
|
||||||
|
abstract getPieChartData(): Observable<number>;
|
||||||
|
}
|
||||||
1
src/app/@core/mock/README.md
Normal file
1
src/app/@core/mock/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
Application-wise data providers.
|
||||||
29
src/app/@core/mock/country-order.service.ts
Normal file
29
src/app/@core/mock/country-order.service.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { CountryOrderData } from '../data/country-order';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class CountryOrderService extends CountryOrderData {
|
||||||
|
|
||||||
|
private countriesCategories = [
|
||||||
|
'Sofas',
|
||||||
|
'Furniture',
|
||||||
|
'Lighting',
|
||||||
|
'Tables',
|
||||||
|
'Textiles',
|
||||||
|
];
|
||||||
|
private countriesCategoriesLength = this.countriesCategories.length;
|
||||||
|
private generateRandomData(nPoints: number): number[] {
|
||||||
|
return Array.from(Array(nPoints)).map(() => {
|
||||||
|
return Math.round(Math.random() * 20);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getCountriesCategories(): Observable<string[]> {
|
||||||
|
return observableOf(this.countriesCategories);
|
||||||
|
}
|
||||||
|
|
||||||
|
getCountriesCategoriesData(country: string): Observable<number[]> {
|
||||||
|
return observableOf(this.generateRandomData(this.countriesCategoriesLength));
|
||||||
|
}
|
||||||
|
}
|
||||||
103
src/app/@core/mock/earning.service.ts
Normal file
103
src/app/@core/mock/earning.service.ts
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { LiveUpdateChart, PieChart, EarningData } from '../data/earning';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class EarningService extends EarningData {
|
||||||
|
|
||||||
|
private currentDate: Date = new Date();
|
||||||
|
private currentValue = Math.random() * 1000;
|
||||||
|
private ONE_DAY = 24 * 3600 * 1000;
|
||||||
|
|
||||||
|
private pieChartData = [
|
||||||
|
{
|
||||||
|
value: 50,
|
||||||
|
name: 'Bitcoin',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 25,
|
||||||
|
name: 'Tether',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 25,
|
||||||
|
name: 'Ethereum',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
private liveUpdateChartData = {
|
||||||
|
bitcoin: {
|
||||||
|
liveChart: [],
|
||||||
|
delta: {
|
||||||
|
up: true,
|
||||||
|
value: 4,
|
||||||
|
},
|
||||||
|
dailyIncome: 45895,
|
||||||
|
},
|
||||||
|
tether: {
|
||||||
|
liveChart: [],
|
||||||
|
delta: {
|
||||||
|
up: false,
|
||||||
|
value: 9,
|
||||||
|
},
|
||||||
|
dailyIncome: 5862,
|
||||||
|
},
|
||||||
|
ethereum: {
|
||||||
|
liveChart: [],
|
||||||
|
delta: {
|
||||||
|
up: false,
|
||||||
|
value: 21,
|
||||||
|
},
|
||||||
|
dailyIncome: 584,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
getDefaultLiveChartData(elementsNumber: number) {
|
||||||
|
this.currentDate = new Date();
|
||||||
|
this.currentValue = Math.random() * 1000;
|
||||||
|
|
||||||
|
return Array.from(Array(elementsNumber))
|
||||||
|
.map(item => this.generateRandomLiveChartData());
|
||||||
|
}
|
||||||
|
|
||||||
|
generateRandomLiveChartData() {
|
||||||
|
this.currentDate = new Date(+this.currentDate + this.ONE_DAY);
|
||||||
|
this.currentValue = this.currentValue + Math.random() * 20 - 11;
|
||||||
|
|
||||||
|
if (this.currentValue < 0) {
|
||||||
|
this.currentValue = Math.random() * 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
value: [
|
||||||
|
[
|
||||||
|
this.currentDate.getFullYear(),
|
||||||
|
this.currentDate.getMonth(),
|
||||||
|
this.currentDate.getDate(),
|
||||||
|
].join('/'),
|
||||||
|
Math.round(this.currentValue),
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
getEarningLiveUpdateCardData(currency): Observable<any[]> {
|
||||||
|
const data = this.liveUpdateChartData[currency.toLowerCase()];
|
||||||
|
const newValue = this.generateRandomLiveChartData();
|
||||||
|
|
||||||
|
data.liveChart.shift();
|
||||||
|
data.liveChart.push(newValue);
|
||||||
|
|
||||||
|
return observableOf(data.liveChart);
|
||||||
|
}
|
||||||
|
|
||||||
|
getEarningCardData(currency: string): Observable<LiveUpdateChart> {
|
||||||
|
const data = this.liveUpdateChartData[currency.toLowerCase()];
|
||||||
|
|
||||||
|
data.liveChart = this.getDefaultLiveChartData(150);
|
||||||
|
|
||||||
|
return observableOf(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
getEarningPieChartData(): Observable<PieChart[]> {
|
||||||
|
return observableOf(this.pieChartData);
|
||||||
|
}
|
||||||
|
}
|
||||||
95
src/app/@core/mock/electricity.service.ts
Normal file
95
src/app/@core/mock/electricity.service.ts
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { Electricity, ElectricityChart, ElectricityData } from '../data/electricity';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class ElectricityService extends ElectricityData {
|
||||||
|
|
||||||
|
private listData: Electricity[] = [
|
||||||
|
{
|
||||||
|
title: '2015',
|
||||||
|
months: [
|
||||||
|
{ month: 'Jan', delta: '0.97', down: true, kWatts: '816', cost: '97' },
|
||||||
|
{ month: 'Feb', delta: '1.83', down: true, kWatts: '806', cost: '95' },
|
||||||
|
{ month: 'Mar', delta: '0.64', down: true, kWatts: '803', cost: '94' },
|
||||||
|
{ month: 'Apr', delta: '2.17', down: false, kWatts: '818', cost: '98' },
|
||||||
|
{ month: 'May', delta: '1.32', down: true, kWatts: '809', cost: '96' },
|
||||||
|
{ month: 'Jun', delta: '0.05', down: true, kWatts: '808', cost: '96' },
|
||||||
|
{ month: 'Jul', delta: '1.39', down: false, kWatts: '815', cost: '97' },
|
||||||
|
{ month: 'Aug', delta: '0.73', down: true, kWatts: '807', cost: '95' },
|
||||||
|
{ month: 'Sept', delta: '2.61', down: true, kWatts: '792', cost: '92' },
|
||||||
|
{ month: 'Oct', delta: '0.16', down: true, kWatts: '791', cost: '92' },
|
||||||
|
{ month: 'Nov', delta: '1.71', down: true, kWatts: '786', cost: '89' },
|
||||||
|
{ month: 'Dec', delta: '0.37', down: false, kWatts: '789', cost: '91' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '2016',
|
||||||
|
active: true,
|
||||||
|
months: [
|
||||||
|
{ month: 'Jan', delta: '1.56', down: true, kWatts: '789', cost: '91' },
|
||||||
|
{ month: 'Feb', delta: '0.33', down: false, kWatts: '791', cost: '92' },
|
||||||
|
{ month: 'Mar', delta: '0.62', down: true, kWatts: '790', cost: '92' },
|
||||||
|
{ month: 'Apr', delta: '1.93', down: true, kWatts: '783', cost: '87' },
|
||||||
|
{ month: 'May', delta: '2.52', down: true, kWatts: '771', cost: '83' },
|
||||||
|
{ month: 'Jun', delta: '0.39', down: false, kWatts: '774', cost: '85' },
|
||||||
|
{ month: 'Jul', delta: '1.61', down: true, kWatts: '767', cost: '81' },
|
||||||
|
{ month: 'Aug', delta: '1.41', down: true, kWatts: '759', cost: '76' },
|
||||||
|
{ month: 'Sept', delta: '1.03', down: true, kWatts: '752', cost: '74' },
|
||||||
|
{ month: 'Oct', delta: '2.94', down: false, kWatts: '769', cost: '82' },
|
||||||
|
{ month: 'Nov', delta: '0.26', down: true, kWatts: '767', cost: '81' },
|
||||||
|
{ month: 'Dec', delta: '1.62', down: true, kWatts: '760', cost: '76' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '2017',
|
||||||
|
months: [
|
||||||
|
{ month: 'Jan', delta: '1.34', down: false, kWatts: '789', cost: '91' },
|
||||||
|
{ month: 'Feb', delta: '0.95', down: false, kWatts: '793', cost: '93' },
|
||||||
|
{ month: 'Mar', delta: '0.25', down: true, kWatts: '791', cost: '92' },
|
||||||
|
{ month: 'Apr', delta: '1.72', down: false, kWatts: '797', cost: '95' },
|
||||||
|
{ month: 'May', delta: '2.62', down: true, kWatts: '786', cost: '90' },
|
||||||
|
{ month: 'Jun', delta: '0.72', down: false, kWatts: '789', cost: '91' },
|
||||||
|
{ month: 'Jul', delta: '0.78', down: true, kWatts: '784', cost: '89' },
|
||||||
|
{ month: 'Aug', delta: '0.36', down: true, kWatts: '782', cost: '88' },
|
||||||
|
{ month: 'Sept', delta: '0.55', down: false, kWatts: '787', cost: '90' },
|
||||||
|
{ month: 'Oct', delta: '1.81', down: true, kWatts: '779', cost: '86' },
|
||||||
|
{ month: 'Nov', delta: '1.12', down: true, kWatts: '774', cost: '84' },
|
||||||
|
{ month: 'Dec', delta: '0.52', down: false, kWatts: '776', cost: '95' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
private chartPoints = [
|
||||||
|
490, 490, 495, 500,
|
||||||
|
505, 510, 520, 530,
|
||||||
|
550, 580, 630, 720,
|
||||||
|
800, 840, 860, 870,
|
||||||
|
870, 860, 840, 800,
|
||||||
|
720, 200, 145, 130,
|
||||||
|
130, 145, 200, 570,
|
||||||
|
635, 660, 670, 670,
|
||||||
|
660, 630, 580, 460,
|
||||||
|
380, 350, 340, 340,
|
||||||
|
340, 340, 340, 340,
|
||||||
|
340, 340, 340,
|
||||||
|
];
|
||||||
|
|
||||||
|
chartData: ElectricityChart[];
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.chartData = this.chartPoints.map((p, index) => ({
|
||||||
|
label: (index % 5 === 3) ? `${Math.round(index / 5)}` : '',
|
||||||
|
value: p,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
getListData(): Observable<Electricity[]> {
|
||||||
|
return observableOf(this.listData);
|
||||||
|
}
|
||||||
|
|
||||||
|
getChartData(): Observable<ElectricityChart[]> {
|
||||||
|
return observableOf(this.chartData);
|
||||||
|
}
|
||||||
|
}
|
||||||
65
src/app/@core/mock/mock-data.module.ts
Normal file
65
src/app/@core/mock/mock-data.module.ts
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
import { NgModule, ModuleWithProviders } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
import { UserService } from './users.service';
|
||||||
|
import { ElectricityService } from './electricity.service';
|
||||||
|
import { SmartTableService } from './smart-table.service';
|
||||||
|
import { UserActivityService } from './user-activity.service';
|
||||||
|
import { OrdersChartService } from './orders-chart.service';
|
||||||
|
import { ProfitChartService } from './profit-chart.service';
|
||||||
|
import { TrafficListService } from './traffic-list.service';
|
||||||
|
import { PeriodsService } from './periods.service';
|
||||||
|
import { EarningService } from './earning.service';
|
||||||
|
import { OrdersProfitChartService } from './orders-profit-chart.service';
|
||||||
|
import { TrafficBarService } from './traffic-bar.service';
|
||||||
|
import { ProfitBarAnimationChartService } from './profit-bar-animation-chart.service';
|
||||||
|
import { TemperatureHumidityService } from './temperature-humidity.service';
|
||||||
|
import { SolarService } from './solar.service';
|
||||||
|
import { TrafficChartService } from './traffic-chart.service';
|
||||||
|
import { StatsBarService } from './stats-bar.service';
|
||||||
|
import { CountryOrderService } from './country-order.service';
|
||||||
|
import { StatsProgressBarService } from './stats-progress-bar.service';
|
||||||
|
import { VisitorsAnalyticsService } from './visitors-analytics.service';
|
||||||
|
import { SecurityCamerasService } from './security-cameras.service';
|
||||||
|
|
||||||
|
const SERVICES = [
|
||||||
|
UserService,
|
||||||
|
ElectricityService,
|
||||||
|
SmartTableService,
|
||||||
|
UserActivityService,
|
||||||
|
OrdersChartService,
|
||||||
|
ProfitChartService,
|
||||||
|
TrafficListService,
|
||||||
|
PeriodsService,
|
||||||
|
EarningService,
|
||||||
|
OrdersProfitChartService,
|
||||||
|
TrafficBarService,
|
||||||
|
ProfitBarAnimationChartService,
|
||||||
|
TemperatureHumidityService,
|
||||||
|
SolarService,
|
||||||
|
TrafficChartService,
|
||||||
|
StatsBarService,
|
||||||
|
CountryOrderService,
|
||||||
|
StatsProgressBarService,
|
||||||
|
VisitorsAnalyticsService,
|
||||||
|
SecurityCamerasService,
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
],
|
||||||
|
providers: [
|
||||||
|
...SERVICES,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class MockDataModule {
|
||||||
|
static forRoot(): ModuleWithProviders<MockDataModule> {
|
||||||
|
return {
|
||||||
|
ngModule: MockDataModule,
|
||||||
|
providers: [
|
||||||
|
...SERVICES,
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
155
src/app/@core/mock/orders-chart.service.ts
Normal file
155
src/app/@core/mock/orders-chart.service.ts
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { PeriodsService } from './periods.service';
|
||||||
|
import { OrdersChart, OrdersChartData } from '../data/orders-chart';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class OrdersChartService extends OrdersChartData {
|
||||||
|
|
||||||
|
private year = [
|
||||||
|
'2012',
|
||||||
|
'2013',
|
||||||
|
'2014',
|
||||||
|
'2015',
|
||||||
|
'2016',
|
||||||
|
'2017',
|
||||||
|
'2018',
|
||||||
|
];
|
||||||
|
|
||||||
|
private data = { };
|
||||||
|
|
||||||
|
constructor(private period: PeriodsService) {
|
||||||
|
super();
|
||||||
|
this.data = {
|
||||||
|
week: this.getDataForWeekPeriod(),
|
||||||
|
month: this.getDataForMonthPeriod(),
|
||||||
|
year: this.getDataForYearPeriod(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private getDataForWeekPeriod(): OrdersChart {
|
||||||
|
return {
|
||||||
|
chartLabel: this.getDataLabels(42, this.period.getWeeks()),
|
||||||
|
linesData: [
|
||||||
|
[
|
||||||
|
184, 267, 326, 366, 389, 399,
|
||||||
|
392, 371, 340, 304, 265, 227,
|
||||||
|
191, 158, 130, 108, 95, 91, 97,
|
||||||
|
109, 125, 144, 166, 189, 212,
|
||||||
|
236, 259, 280, 300, 316, 329,
|
||||||
|
338, 342, 339, 329, 312, 288,
|
||||||
|
258, 221, 178, 128, 71,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
158, 178, 193, 205, 212, 213,
|
||||||
|
204, 190, 180, 173, 168, 164,
|
||||||
|
162, 160, 159, 158, 159, 166,
|
||||||
|
179, 195, 215, 236, 257, 276,
|
||||||
|
292, 301, 304, 303, 300, 293,
|
||||||
|
284, 273, 262, 251, 241, 234,
|
||||||
|
232, 232, 232, 232, 232, 232,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
58, 137, 202, 251, 288, 312,
|
||||||
|
323, 324, 311, 288, 257, 222,
|
||||||
|
187, 154, 124, 100, 81, 68, 61,
|
||||||
|
58, 61, 69, 80, 96, 115, 137,
|
||||||
|
161, 186, 210, 233, 254, 271,
|
||||||
|
284, 293, 297, 297, 297, 297,
|
||||||
|
297, 297, 297, 297, 297,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private getDataForMonthPeriod(): OrdersChart {
|
||||||
|
return {
|
||||||
|
chartLabel: this.getDataLabels(47, this.period.getMonths()),
|
||||||
|
linesData: [
|
||||||
|
[
|
||||||
|
5, 63, 113, 156, 194, 225,
|
||||||
|
250, 270, 283, 289, 290,
|
||||||
|
286, 277, 264, 244, 220,
|
||||||
|
194, 171, 157, 151, 150,
|
||||||
|
152, 155, 160, 166, 170,
|
||||||
|
167, 153, 135, 115, 97,
|
||||||
|
82, 71, 64, 63, 62, 61,
|
||||||
|
62, 65, 73, 84, 102,
|
||||||
|
127, 159, 203, 259, 333,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
6, 83, 148, 200, 240,
|
||||||
|
265, 273, 259, 211,
|
||||||
|
122, 55, 30, 28, 36,
|
||||||
|
50, 68, 88, 109, 129,
|
||||||
|
146, 158, 163, 165,
|
||||||
|
173, 187, 208, 236,
|
||||||
|
271, 310, 346, 375,
|
||||||
|
393, 400, 398, 387,
|
||||||
|
368, 341, 309, 275,
|
||||||
|
243, 220, 206, 202,
|
||||||
|
207, 222, 247, 286, 348,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
398, 348, 315, 292, 274,
|
||||||
|
261, 251, 243, 237, 231,
|
||||||
|
222, 209, 192, 172, 152,
|
||||||
|
132, 116, 102, 90, 80, 71,
|
||||||
|
64, 58, 53, 49, 48, 54, 66,
|
||||||
|
84, 104, 125, 142, 156, 166,
|
||||||
|
172, 174, 172, 167, 159, 149,
|
||||||
|
136, 121, 105, 86, 67, 45, 22,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private getDataForYearPeriod(): OrdersChart {
|
||||||
|
return {
|
||||||
|
chartLabel: this.getDataLabels(42, this.year),
|
||||||
|
linesData: [
|
||||||
|
[
|
||||||
|
190, 269, 327, 366, 389, 398,
|
||||||
|
396, 387, 375, 359, 343, 327,
|
||||||
|
312, 298, 286, 276, 270, 268,
|
||||||
|
265, 258, 247, 234, 220, 204,
|
||||||
|
188, 172, 157, 142, 128, 116,
|
||||||
|
106, 99, 95, 94, 92, 89, 84,
|
||||||
|
77, 69, 60, 49, 36, 22,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
265, 307, 337, 359, 375, 386,
|
||||||
|
393, 397, 399, 397, 390, 379,
|
||||||
|
365, 347, 326, 305, 282, 261,
|
||||||
|
241, 223, 208, 197, 190, 187,
|
||||||
|
185, 181, 172, 160, 145, 126,
|
||||||
|
105, 82, 60, 40, 26, 19, 22,
|
||||||
|
43, 82, 141, 220, 321,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
9, 165, 236, 258, 244, 206,
|
||||||
|
186, 189, 209, 239, 273, 307,
|
||||||
|
339, 365, 385, 396, 398, 385,
|
||||||
|
351, 300, 255, 221, 197, 181,
|
||||||
|
170, 164, 162, 161, 159, 154,
|
||||||
|
146, 135, 122, 108, 96, 87,
|
||||||
|
83, 82, 82, 82, 82, 82, 82,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
getDataLabels(nPoints: number, labelsArray: string[]): string[] {
|
||||||
|
const labelsArrayLength = labelsArray.length;
|
||||||
|
const step = Math.round(nPoints / labelsArrayLength);
|
||||||
|
|
||||||
|
return Array.from(Array(nPoints)).map((item, index) => {
|
||||||
|
const dataIndex = Math.round(index / step);
|
||||||
|
|
||||||
|
return index % step === 0 ? labelsArray[dataIndex] : '';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getOrdersChartData(period: string): OrdersChart {
|
||||||
|
return this.data[period];
|
||||||
|
}
|
||||||
|
}
|
||||||
45
src/app/@core/mock/orders-profit-chart.service.ts
Normal file
45
src/app/@core/mock/orders-profit-chart.service.ts
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { OrdersChart, OrdersChartData } from '../data/orders-chart';
|
||||||
|
import { OrderProfitChartSummary, OrdersProfitChartData } from '../data/orders-profit-chart';
|
||||||
|
import { ProfitChart, ProfitChartData } from '../data/profit-chart';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class OrdersProfitChartService extends OrdersProfitChartData {
|
||||||
|
|
||||||
|
private summary = [
|
||||||
|
{
|
||||||
|
title: 'Marketplace',
|
||||||
|
value: 3654,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Last Month',
|
||||||
|
value: 946,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Last Week',
|
||||||
|
value: 654,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Today',
|
||||||
|
value: 230,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
constructor(private ordersChartService: OrdersChartData,
|
||||||
|
private profitChartService: ProfitChartData) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
getOrderProfitChartSummary(): Observable<OrderProfitChartSummary[]> {
|
||||||
|
return observableOf(this.summary);
|
||||||
|
}
|
||||||
|
|
||||||
|
getOrdersChartData(period: string): Observable<OrdersChart> {
|
||||||
|
return observableOf(this.ordersChartService.getOrdersChartData(period));
|
||||||
|
}
|
||||||
|
|
||||||
|
getProfitChartData(period: string): Observable<ProfitChart> {
|
||||||
|
return observableOf(this.profitChartService.getProfitChartData(period));
|
||||||
|
}
|
||||||
|
}
|
||||||
33
src/app/@core/mock/periods.service.ts
Normal file
33
src/app/@core/mock/periods.service.ts
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class PeriodsService {
|
||||||
|
getYears() {
|
||||||
|
return [
|
||||||
|
'2010', '2011', '2012',
|
||||||
|
'2013', '2014', '2015',
|
||||||
|
'2016', '2017', '2018',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
getMonths() {
|
||||||
|
return [
|
||||||
|
'Jan', 'Feb', 'Mar',
|
||||||
|
'Apr', 'May', 'Jun',
|
||||||
|
'Jul', 'Aug', 'Sep',
|
||||||
|
'Oct', 'Nov', 'Dec',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
getWeeks() {
|
||||||
|
return [
|
||||||
|
'Mon',
|
||||||
|
'Tue',
|
||||||
|
'Wed',
|
||||||
|
'Thu',
|
||||||
|
'Fri',
|
||||||
|
'Sat',
|
||||||
|
'Sun',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
43
src/app/@core/mock/profit-bar-animation-chart.service.ts
Normal file
43
src/app/@core/mock/profit-bar-animation-chart.service.ts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { ProfitBarAnimationChartData } from '../data/profit-bar-animation-chart';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class ProfitBarAnimationChartService extends ProfitBarAnimationChartData {
|
||||||
|
|
||||||
|
private data: any;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.data = {
|
||||||
|
firstLine: this.getDataForFirstLine(),
|
||||||
|
secondLine: this.getDataForSecondLine(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
getDataForFirstLine(): number[] {
|
||||||
|
return this.createEmptyArray(100)
|
||||||
|
.map((_, index) => {
|
||||||
|
const oneFifth = index / 5;
|
||||||
|
|
||||||
|
return (Math.sin(oneFifth) * (oneFifth - 10) + index / 6) * 5;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getDataForSecondLine(): number[] {
|
||||||
|
return this.createEmptyArray(100)
|
||||||
|
.map((_, index) => {
|
||||||
|
const oneFifth = index / 5;
|
||||||
|
|
||||||
|
return (Math.cos(oneFifth) * (oneFifth - 10) + index / 6) * 5;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
createEmptyArray(nPoints: number) {
|
||||||
|
return Array.from(Array(nPoints));
|
||||||
|
}
|
||||||
|
|
||||||
|
getChartData(): Observable<{ firstLine: number[]; secondLine: number[]; }> {
|
||||||
|
return observableOf(this.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
77
src/app/@core/mock/profit-chart.service.ts
Normal file
77
src/app/@core/mock/profit-chart.service.ts
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { PeriodsService } from './periods.service';
|
||||||
|
import { ProfitChart, ProfitChartData } from '../data/profit-chart';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class ProfitChartService extends ProfitChartData {
|
||||||
|
|
||||||
|
private year = [
|
||||||
|
'2012',
|
||||||
|
'2013',
|
||||||
|
'2014',
|
||||||
|
'2015',
|
||||||
|
'2016',
|
||||||
|
'2017',
|
||||||
|
'2018',
|
||||||
|
];
|
||||||
|
|
||||||
|
private data = { };
|
||||||
|
|
||||||
|
constructor(private period: PeriodsService) {
|
||||||
|
super();
|
||||||
|
this.data = {
|
||||||
|
week: this.getDataForWeekPeriod(),
|
||||||
|
month: this.getDataForMonthPeriod(),
|
||||||
|
year: this.getDataForYearPeriod(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private getDataForWeekPeriod(): ProfitChart {
|
||||||
|
const nPoint = this.period.getWeeks().length;
|
||||||
|
|
||||||
|
return {
|
||||||
|
chartLabel: this.period.getWeeks(),
|
||||||
|
data: [
|
||||||
|
this.getRandomData(nPoint),
|
||||||
|
this.getRandomData(nPoint),
|
||||||
|
this.getRandomData(nPoint),
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private getDataForMonthPeriod(): ProfitChart {
|
||||||
|
const nPoint = this.period.getMonths().length;
|
||||||
|
|
||||||
|
return {
|
||||||
|
chartLabel: this.period.getMonths(),
|
||||||
|
data: [
|
||||||
|
this.getRandomData(nPoint),
|
||||||
|
this.getRandomData(nPoint),
|
||||||
|
this.getRandomData(nPoint),
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private getDataForYearPeriod(): ProfitChart {
|
||||||
|
const nPoint = this.year.length;
|
||||||
|
|
||||||
|
return {
|
||||||
|
chartLabel: this.year,
|
||||||
|
data: [
|
||||||
|
this.getRandomData(nPoint),
|
||||||
|
this.getRandomData(nPoint),
|
||||||
|
this.getRandomData(nPoint),
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private getRandomData(nPoints: number): number[] {
|
||||||
|
return Array.from(Array(nPoints)).map(() => {
|
||||||
|
return Math.round(Math.random() * 500);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getProfitChartData(period: string): ProfitChart {
|
||||||
|
return this.data[period];
|
||||||
|
}
|
||||||
|
}
|
||||||
30
src/app/@core/mock/security-cameras.service.ts
Normal file
30
src/app/@core/mock/security-cameras.service.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { Camera, SecurityCamerasData } from '../data/security-cameras';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class SecurityCamerasService extends SecurityCamerasData {
|
||||||
|
|
||||||
|
private cameras: Camera[] = [
|
||||||
|
{
|
||||||
|
title: 'Camera #1',
|
||||||
|
source: 'assets/images/camera1.jpg',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Camera #2',
|
||||||
|
source: 'assets/images/camera2.jpg',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Camera #3',
|
||||||
|
source: 'assets/images/camera3.jpg',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Camera #4',
|
||||||
|
source: 'assets/images/camera4.jpg',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
getCamerasData(): Observable<Camera[]> {
|
||||||
|
return observableOf(this.cameras);
|
||||||
|
}
|
||||||
|
}
|
||||||
432
src/app/@core/mock/smart-table.service.ts
Normal file
432
src/app/@core/mock/smart-table.service.ts
Normal file
@ -0,0 +1,432 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { SmartTableData } from '../data/smart-table';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class SmartTableService extends SmartTableData {
|
||||||
|
|
||||||
|
data = [{
|
||||||
|
id: 1,
|
||||||
|
firstName: 'Mark',
|
||||||
|
lastName: 'Otto',
|
||||||
|
username: '@mdo',
|
||||||
|
email: 'mdo@gmail.com',
|
||||||
|
age: '28',
|
||||||
|
}, {
|
||||||
|
id: 2,
|
||||||
|
firstName: 'Jacob',
|
||||||
|
lastName: 'Thornton',
|
||||||
|
username: '@fat',
|
||||||
|
email: 'fat@yandex.ru',
|
||||||
|
age: '45',
|
||||||
|
}, {
|
||||||
|
id: 3,
|
||||||
|
firstName: 'Larry',
|
||||||
|
lastName: 'Bird',
|
||||||
|
username: '@twitter',
|
||||||
|
email: 'twitter@outlook.com',
|
||||||
|
age: '18',
|
||||||
|
}, {
|
||||||
|
id: 4,
|
||||||
|
firstName: 'John',
|
||||||
|
lastName: 'Snow',
|
||||||
|
username: '@snow',
|
||||||
|
email: 'snow@gmail.com',
|
||||||
|
age: '20',
|
||||||
|
}, {
|
||||||
|
id: 5,
|
||||||
|
firstName: 'Jack',
|
||||||
|
lastName: 'Sparrow',
|
||||||
|
username: '@jack',
|
||||||
|
email: 'jack@yandex.ru',
|
||||||
|
age: '30',
|
||||||
|
}, {
|
||||||
|
id: 6,
|
||||||
|
firstName: 'Ann',
|
||||||
|
lastName: 'Smith',
|
||||||
|
username: '@ann',
|
||||||
|
email: 'ann@gmail.com',
|
||||||
|
age: '21',
|
||||||
|
}, {
|
||||||
|
id: 7,
|
||||||
|
firstName: 'Barbara',
|
||||||
|
lastName: 'Black',
|
||||||
|
username: '@barbara',
|
||||||
|
email: 'barbara@yandex.ru',
|
||||||
|
age: '43',
|
||||||
|
}, {
|
||||||
|
id: 8,
|
||||||
|
firstName: 'Sevan',
|
||||||
|
lastName: 'Bagrat',
|
||||||
|
username: '@sevan',
|
||||||
|
email: 'sevan@outlook.com',
|
||||||
|
age: '13',
|
||||||
|
}, {
|
||||||
|
id: 9,
|
||||||
|
firstName: 'Ruben',
|
||||||
|
lastName: 'Vardan',
|
||||||
|
username: '@ruben',
|
||||||
|
email: 'ruben@gmail.com',
|
||||||
|
age: '22',
|
||||||
|
}, {
|
||||||
|
id: 10,
|
||||||
|
firstName: 'Karen',
|
||||||
|
lastName: 'Sevan',
|
||||||
|
username: '@karen',
|
||||||
|
email: 'karen@yandex.ru',
|
||||||
|
age: '33',
|
||||||
|
}, {
|
||||||
|
id: 11,
|
||||||
|
firstName: 'Mark',
|
||||||
|
lastName: 'Otto',
|
||||||
|
username: '@mark',
|
||||||
|
email: 'mark@gmail.com',
|
||||||
|
age: '38',
|
||||||
|
}, {
|
||||||
|
id: 12,
|
||||||
|
firstName: 'Jacob',
|
||||||
|
lastName: 'Thornton',
|
||||||
|
username: '@jacob',
|
||||||
|
email: 'jacob@yandex.ru',
|
||||||
|
age: '48',
|
||||||
|
}, {
|
||||||
|
id: 13,
|
||||||
|
firstName: 'Haik',
|
||||||
|
lastName: 'Hakob',
|
||||||
|
username: '@haik',
|
||||||
|
email: 'haik@outlook.com',
|
||||||
|
age: '48',
|
||||||
|
}, {
|
||||||
|
id: 14,
|
||||||
|
firstName: 'Garegin',
|
||||||
|
lastName: 'Jirair',
|
||||||
|
username: '@garegin',
|
||||||
|
email: 'garegin@gmail.com',
|
||||||
|
age: '40',
|
||||||
|
}, {
|
||||||
|
id: 15,
|
||||||
|
firstName: 'Krikor',
|
||||||
|
lastName: 'Bedros',
|
||||||
|
username: '@krikor',
|
||||||
|
email: 'krikor@yandex.ru',
|
||||||
|
age: '32',
|
||||||
|
}, {
|
||||||
|
'id': 16,
|
||||||
|
'firstName': 'Francisca',
|
||||||
|
'lastName': 'Brady',
|
||||||
|
'username': '@Gibson',
|
||||||
|
'email': 'franciscagibson@comtours.com',
|
||||||
|
'age': 11,
|
||||||
|
}, {
|
||||||
|
'id': 17,
|
||||||
|
'firstName': 'Tillman',
|
||||||
|
'lastName': 'Figueroa',
|
||||||
|
'username': '@Snow',
|
||||||
|
'email': 'tillmansnow@comtours.com',
|
||||||
|
'age': 34,
|
||||||
|
}, {
|
||||||
|
'id': 18,
|
||||||
|
'firstName': 'Jimenez',
|
||||||
|
'lastName': 'Morris',
|
||||||
|
'username': '@Bryant',
|
||||||
|
'email': 'jimenezbryant@comtours.com',
|
||||||
|
'age': 45,
|
||||||
|
}, {
|
||||||
|
'id': 19,
|
||||||
|
'firstName': 'Sandoval',
|
||||||
|
'lastName': 'Jacobson',
|
||||||
|
'username': '@Mcbride',
|
||||||
|
'email': 'sandovalmcbride@comtours.com',
|
||||||
|
'age': 32,
|
||||||
|
}, {
|
||||||
|
'id': 20,
|
||||||
|
'firstName': 'Griffin',
|
||||||
|
'lastName': 'Torres',
|
||||||
|
'username': '@Charles',
|
||||||
|
'email': 'griffincharles@comtours.com',
|
||||||
|
'age': 19,
|
||||||
|
}, {
|
||||||
|
'id': 21,
|
||||||
|
'firstName': 'Cora',
|
||||||
|
'lastName': 'Parker',
|
||||||
|
'username': '@Caldwell',
|
||||||
|
'email': 'coracaldwell@comtours.com',
|
||||||
|
'age': 27,
|
||||||
|
}, {
|
||||||
|
'id': 22,
|
||||||
|
'firstName': 'Cindy',
|
||||||
|
'lastName': 'Bond',
|
||||||
|
'username': '@Velez',
|
||||||
|
'email': 'cindyvelez@comtours.com',
|
||||||
|
'age': 24,
|
||||||
|
}, {
|
||||||
|
'id': 23,
|
||||||
|
'firstName': 'Frieda',
|
||||||
|
'lastName': 'Tyson',
|
||||||
|
'username': '@Craig',
|
||||||
|
'email': 'friedacraig@comtours.com',
|
||||||
|
'age': 45,
|
||||||
|
}, {
|
||||||
|
'id': 24,
|
||||||
|
'firstName': 'Cote',
|
||||||
|
'lastName': 'Holcomb',
|
||||||
|
'username': '@Rowe',
|
||||||
|
'email': 'coterowe@comtours.com',
|
||||||
|
'age': 20,
|
||||||
|
}, {
|
||||||
|
'id': 25,
|
||||||
|
'firstName': 'Trujillo',
|
||||||
|
'lastName': 'Mejia',
|
||||||
|
'username': '@Valenzuela',
|
||||||
|
'email': 'trujillovalenzuela@comtours.com',
|
||||||
|
'age': 16,
|
||||||
|
}, {
|
||||||
|
'id': 26,
|
||||||
|
'firstName': 'Pruitt',
|
||||||
|
'lastName': 'Shepard',
|
||||||
|
'username': '@Sloan',
|
||||||
|
'email': 'pruittsloan@comtours.com',
|
||||||
|
'age': 44,
|
||||||
|
}, {
|
||||||
|
'id': 27,
|
||||||
|
'firstName': 'Sutton',
|
||||||
|
'lastName': 'Ortega',
|
||||||
|
'username': '@Black',
|
||||||
|
'email': 'suttonblack@comtours.com',
|
||||||
|
'age': 42,
|
||||||
|
}, {
|
||||||
|
'id': 28,
|
||||||
|
'firstName': 'Marion',
|
||||||
|
'lastName': 'Heath',
|
||||||
|
'username': '@Espinoza',
|
||||||
|
'email': 'marionespinoza@comtours.com',
|
||||||
|
'age': 47,
|
||||||
|
}, {
|
||||||
|
'id': 29,
|
||||||
|
'firstName': 'Newman',
|
||||||
|
'lastName': 'Hicks',
|
||||||
|
'username': '@Keith',
|
||||||
|
'email': 'newmankeith@comtours.com',
|
||||||
|
'age': 15,
|
||||||
|
}, {
|
||||||
|
'id': 30,
|
||||||
|
'firstName': 'Boyle',
|
||||||
|
'lastName': 'Larson',
|
||||||
|
'username': '@Summers',
|
||||||
|
'email': 'boylesummers@comtours.com',
|
||||||
|
'age': 32,
|
||||||
|
}, {
|
||||||
|
'id': 31,
|
||||||
|
'firstName': 'Haynes',
|
||||||
|
'lastName': 'Vinson',
|
||||||
|
'username': '@Mckenzie',
|
||||||
|
'email': 'haynesmckenzie@comtours.com',
|
||||||
|
'age': 15,
|
||||||
|
}, {
|
||||||
|
'id': 32,
|
||||||
|
'firstName': 'Miller',
|
||||||
|
'lastName': 'Acosta',
|
||||||
|
'username': '@Young',
|
||||||
|
'email': 'milleryoung@comtours.com',
|
||||||
|
'age': 55,
|
||||||
|
}, {
|
||||||
|
'id': 33,
|
||||||
|
'firstName': 'Johnston',
|
||||||
|
'lastName': 'Brown',
|
||||||
|
'username': '@Knight',
|
||||||
|
'email': 'johnstonknight@comtours.com',
|
||||||
|
'age': 29,
|
||||||
|
}, {
|
||||||
|
'id': 34,
|
||||||
|
'firstName': 'Lena',
|
||||||
|
'lastName': 'Pitts',
|
||||||
|
'username': '@Forbes',
|
||||||
|
'email': 'lenaforbes@comtours.com',
|
||||||
|
'age': 25,
|
||||||
|
}, {
|
||||||
|
'id': 35,
|
||||||
|
'firstName': 'Terrie',
|
||||||
|
'lastName': 'Kennedy',
|
||||||
|
'username': '@Branch',
|
||||||
|
'email': 'terriebranch@comtours.com',
|
||||||
|
'age': 37,
|
||||||
|
}, {
|
||||||
|
'id': 36,
|
||||||
|
'firstName': 'Louise',
|
||||||
|
'lastName': 'Aguirre',
|
||||||
|
'username': '@Kirby',
|
||||||
|
'email': 'louisekirby@comtours.com',
|
||||||
|
'age': 44,
|
||||||
|
}, {
|
||||||
|
'id': 37,
|
||||||
|
'firstName': 'David',
|
||||||
|
'lastName': 'Patton',
|
||||||
|
'username': '@Sanders',
|
||||||
|
'email': 'davidsanders@comtours.com',
|
||||||
|
'age': 26,
|
||||||
|
}, {
|
||||||
|
'id': 38,
|
||||||
|
'firstName': 'Holden',
|
||||||
|
'lastName': 'Barlow',
|
||||||
|
'username': '@Mckinney',
|
||||||
|
'email': 'holdenmckinney@comtours.com',
|
||||||
|
'age': 11,
|
||||||
|
}, {
|
||||||
|
'id': 39,
|
||||||
|
'firstName': 'Baker',
|
||||||
|
'lastName': 'Rivera',
|
||||||
|
'username': '@Montoya',
|
||||||
|
'email': 'bakermontoya@comtours.com',
|
||||||
|
'age': 47,
|
||||||
|
}, {
|
||||||
|
'id': 40,
|
||||||
|
'firstName': 'Belinda',
|
||||||
|
'lastName': 'Lloyd',
|
||||||
|
'username': '@Calderon',
|
||||||
|
'email': 'belindacalderon@comtours.com',
|
||||||
|
'age': 21,
|
||||||
|
}, {
|
||||||
|
'id': 41,
|
||||||
|
'firstName': 'Pearson',
|
||||||
|
'lastName': 'Patrick',
|
||||||
|
'username': '@Clements',
|
||||||
|
'email': 'pearsonclements@comtours.com',
|
||||||
|
'age': 42,
|
||||||
|
}, {
|
||||||
|
'id': 42,
|
||||||
|
'firstName': 'Alyce',
|
||||||
|
'lastName': 'Mckee',
|
||||||
|
'username': '@Daugherty',
|
||||||
|
'email': 'alycedaugherty@comtours.com',
|
||||||
|
'age': 55,
|
||||||
|
}, {
|
||||||
|
'id': 43,
|
||||||
|
'firstName': 'Valencia',
|
||||||
|
'lastName': 'Spence',
|
||||||
|
'username': '@Olsen',
|
||||||
|
'email': 'valenciaolsen@comtours.com',
|
||||||
|
'age': 20,
|
||||||
|
}, {
|
||||||
|
'id': 44,
|
||||||
|
'firstName': 'Leach',
|
||||||
|
'lastName': 'Holcomb',
|
||||||
|
'username': '@Humphrey',
|
||||||
|
'email': 'leachhumphrey@comtours.com',
|
||||||
|
'age': 28,
|
||||||
|
}, {
|
||||||
|
'id': 45,
|
||||||
|
'firstName': 'Moss',
|
||||||
|
'lastName': 'Baxter',
|
||||||
|
'username': '@Fitzpatrick',
|
||||||
|
'email': 'mossfitzpatrick@comtours.com',
|
||||||
|
'age': 51,
|
||||||
|
}, {
|
||||||
|
'id': 46,
|
||||||
|
'firstName': 'Jeanne',
|
||||||
|
'lastName': 'Cooke',
|
||||||
|
'username': '@Ward',
|
||||||
|
'email': 'jeanneward@comtours.com',
|
||||||
|
'age': 59,
|
||||||
|
}, {
|
||||||
|
'id': 47,
|
||||||
|
'firstName': 'Wilma',
|
||||||
|
'lastName': 'Briggs',
|
||||||
|
'username': '@Kidd',
|
||||||
|
'email': 'wilmakidd@comtours.com',
|
||||||
|
'age': 53,
|
||||||
|
}, {
|
||||||
|
'id': 48,
|
||||||
|
'firstName': 'Beatrice',
|
||||||
|
'lastName': 'Perry',
|
||||||
|
'username': '@Gilbert',
|
||||||
|
'email': 'beatricegilbert@comtours.com',
|
||||||
|
'age': 39,
|
||||||
|
}, {
|
||||||
|
'id': 49,
|
||||||
|
'firstName': 'Whitaker',
|
||||||
|
'lastName': 'Hyde',
|
||||||
|
'username': '@Mcdonald',
|
||||||
|
'email': 'whitakermcdonald@comtours.com',
|
||||||
|
'age': 35,
|
||||||
|
}, {
|
||||||
|
'id': 50,
|
||||||
|
'firstName': 'Rebekah',
|
||||||
|
'lastName': 'Duran',
|
||||||
|
'username': '@Gross',
|
||||||
|
'email': 'rebekahgross@comtours.com',
|
||||||
|
'age': 40,
|
||||||
|
}, {
|
||||||
|
'id': 51,
|
||||||
|
'firstName': 'Earline',
|
||||||
|
'lastName': 'Mayer',
|
||||||
|
'username': '@Woodward',
|
||||||
|
'email': 'earlinewoodward@comtours.com',
|
||||||
|
'age': 52,
|
||||||
|
}, {
|
||||||
|
'id': 52,
|
||||||
|
'firstName': 'Moran',
|
||||||
|
'lastName': 'Baxter',
|
||||||
|
'username': '@Johns',
|
||||||
|
'email': 'moranjohns@comtours.com',
|
||||||
|
'age': 20,
|
||||||
|
}, {
|
||||||
|
'id': 53,
|
||||||
|
'firstName': 'Nanette',
|
||||||
|
'lastName': 'Hubbard',
|
||||||
|
'username': '@Cooke',
|
||||||
|
'email': 'nanettecooke@comtours.com',
|
||||||
|
'age': 55,
|
||||||
|
}, {
|
||||||
|
'id': 54,
|
||||||
|
'firstName': 'Dalton',
|
||||||
|
'lastName': 'Walker',
|
||||||
|
'username': '@Hendricks',
|
||||||
|
'email': 'daltonhendricks@comtours.com',
|
||||||
|
'age': 25,
|
||||||
|
}, {
|
||||||
|
'id': 55,
|
||||||
|
'firstName': 'Bennett',
|
||||||
|
'lastName': 'Blake',
|
||||||
|
'username': '@Pena',
|
||||||
|
'email': 'bennettpena@comtours.com',
|
||||||
|
'age': 13,
|
||||||
|
}, {
|
||||||
|
'id': 56,
|
||||||
|
'firstName': 'Kellie',
|
||||||
|
'lastName': 'Horton',
|
||||||
|
'username': '@Weiss',
|
||||||
|
'email': 'kellieweiss@comtours.com',
|
||||||
|
'age': 48,
|
||||||
|
}, {
|
||||||
|
'id': 57,
|
||||||
|
'firstName': 'Hobbs',
|
||||||
|
'lastName': 'Talley',
|
||||||
|
'username': '@Sanford',
|
||||||
|
'email': 'hobbssanford@comtours.com',
|
||||||
|
'age': 28,
|
||||||
|
}, {
|
||||||
|
'id': 58,
|
||||||
|
'firstName': 'Mcguire',
|
||||||
|
'lastName': 'Donaldson',
|
||||||
|
'username': '@Roman',
|
||||||
|
'email': 'mcguireroman@comtours.com',
|
||||||
|
'age': 38,
|
||||||
|
}, {
|
||||||
|
'id': 59,
|
||||||
|
'firstName': 'Rodriquez',
|
||||||
|
'lastName': 'Saunders',
|
||||||
|
'username': '@Harper',
|
||||||
|
'email': 'rodriquezharper@comtours.com',
|
||||||
|
'age': 20,
|
||||||
|
}, {
|
||||||
|
'id': 60,
|
||||||
|
'firstName': 'Lou',
|
||||||
|
'lastName': 'Conner',
|
||||||
|
'username': '@Sanchez',
|
||||||
|
'email': 'lousanchez@comtours.com',
|
||||||
|
'age': 16,
|
||||||
|
}];
|
||||||
|
|
||||||
|
getData() {
|
||||||
|
return this.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
12
src/app/@core/mock/solar.service.ts
Normal file
12
src/app/@core/mock/solar.service.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { SolarData } from '../data/solar';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class SolarService extends SolarData {
|
||||||
|
private value = 42;
|
||||||
|
|
||||||
|
getSolarData(): Observable<number> {
|
||||||
|
return observableOf(this.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
16
src/app/@core/mock/stats-bar.service.ts
Normal file
16
src/app/@core/mock/stats-bar.service.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { StatsBarData } from '../data/stats-bar';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class StatsBarService extends StatsBarData {
|
||||||
|
|
||||||
|
private statsBarData: number[] = [
|
||||||
|
300, 520, 435, 530,
|
||||||
|
730, 620, 660, 860,
|
||||||
|
];
|
||||||
|
|
||||||
|
getStatsBarData(): Observable<number[]> {
|
||||||
|
return observableOf(this.statsBarData);
|
||||||
|
}
|
||||||
|
}
|
||||||
31
src/app/@core/mock/stats-progress-bar.service.ts
Normal file
31
src/app/@core/mock/stats-progress-bar.service.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { ProgressInfo, StatsProgressBarData } from '../data/stats-progress-bar';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class StatsProgressBarService extends StatsProgressBarData {
|
||||||
|
private progressInfoData: ProgressInfo[] = [
|
||||||
|
{
|
||||||
|
title: 'Today’s Profit',
|
||||||
|
value: 572900,
|
||||||
|
activeProgress: 70,
|
||||||
|
description: 'Better than last week (70%)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'New Orders',
|
||||||
|
value: 6378,
|
||||||
|
activeProgress: 30,
|
||||||
|
description: 'Better than last week (30%)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'New Comments',
|
||||||
|
value: 200,
|
||||||
|
activeProgress: 55,
|
||||||
|
description: 'Better than last week (55%)',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
getProgressInfoData(): Observable<ProgressInfo[]> {
|
||||||
|
return observableOf(this.progressInfoData);
|
||||||
|
}
|
||||||
|
}
|
||||||
27
src/app/@core/mock/temperature-humidity.service.ts
Normal file
27
src/app/@core/mock/temperature-humidity.service.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { TemperatureHumidityData, Temperature } from '../data/temperature-humidity';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class TemperatureHumidityService extends TemperatureHumidityData {
|
||||||
|
|
||||||
|
private temperatureDate: Temperature = {
|
||||||
|
value: 24,
|
||||||
|
min: 12,
|
||||||
|
max: 30,
|
||||||
|
};
|
||||||
|
|
||||||
|
private humidityDate: Temperature = {
|
||||||
|
value: 87,
|
||||||
|
min: 0,
|
||||||
|
max: 100,
|
||||||
|
};
|
||||||
|
|
||||||
|
getTemperatureData(): Observable<Temperature> {
|
||||||
|
return observableOf(this.temperatureDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
getHumidityData(): Observable<Temperature> {
|
||||||
|
return observableOf(this.humidityDate);
|
||||||
|
}
|
||||||
|
}
|
||||||
47
src/app/@core/mock/traffic-bar.service.ts
Normal file
47
src/app/@core/mock/traffic-bar.service.ts
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { PeriodsService } from './periods.service';
|
||||||
|
import { TrafficBarData, TrafficBar } from '../data/traffic-bar';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class TrafficBarService extends TrafficBarData {
|
||||||
|
|
||||||
|
private data = { };
|
||||||
|
|
||||||
|
constructor(private period: PeriodsService) {
|
||||||
|
super();
|
||||||
|
this.data = {
|
||||||
|
week: this.getDataForWeekPeriod(),
|
||||||
|
month: this.getDataForMonthPeriod(),
|
||||||
|
year: this.getDataForYearPeriod(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
getDataForWeekPeriod(): TrafficBar {
|
||||||
|
return {
|
||||||
|
data: [10, 15, 19, 7, 20, 13, 15],
|
||||||
|
labels: this.period.getWeeks(),
|
||||||
|
formatter: '{c0} MB',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
getDataForMonthPeriod(): TrafficBar {
|
||||||
|
return {
|
||||||
|
data: [0.5, 0.3, 0.8, 0.2, 0.3, 0.7, 0.8, 1, 0.7, 0.8, 0.6, 0.7],
|
||||||
|
labels: this.period.getMonths(),
|
||||||
|
formatter: '{c0} GB',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
getDataForYearPeriod(): TrafficBar {
|
||||||
|
return {
|
||||||
|
data: [10, 15, 19, 7, 20, 13, 15, 19, 11],
|
||||||
|
labels: this.period.getYears(),
|
||||||
|
formatter: '{c0} GB',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
getTrafficBarData(period: string): Observable<TrafficBar> {
|
||||||
|
return observableOf(this.data[period]);
|
||||||
|
}
|
||||||
|
}
|
||||||
16
src/app/@core/mock/traffic-chart.service.ts
Normal file
16
src/app/@core/mock/traffic-chart.service.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { TrafficChartData } from '../data/traffic-chart';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class TrafficChartService extends TrafficChartData {
|
||||||
|
|
||||||
|
private data: number[] = [
|
||||||
|
300, 520, 435, 530,
|
||||||
|
730, 620, 660, 860,
|
||||||
|
];
|
||||||
|
|
||||||
|
getTrafficChartData(): Observable<number[]> {
|
||||||
|
return observableOf(this.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
85
src/app/@core/mock/traffic-list.service.ts
Normal file
85
src/app/@core/mock/traffic-list.service.ts
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { PeriodsService } from './periods.service';
|
||||||
|
import { TrafficList, TrafficListData } from '../data/traffic-list';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class TrafficListService extends TrafficListData {
|
||||||
|
|
||||||
|
private getRandom = (roundTo: number) => Math.round(Math.random() * roundTo);
|
||||||
|
private data = {};
|
||||||
|
|
||||||
|
constructor(private period: PeriodsService) {
|
||||||
|
super();
|
||||||
|
this.data = {
|
||||||
|
week: this.getDataWeek(),
|
||||||
|
month: this.getDataMonth(),
|
||||||
|
year: this.getDataYear(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private getDataWeek(): TrafficList[] {
|
||||||
|
const getFirstDateInPeriod = () => {
|
||||||
|
const weeks = this.period.getWeeks();
|
||||||
|
|
||||||
|
return weeks[weeks.length - 1];
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.reduceData(this.period.getWeeks(), getFirstDateInPeriod);
|
||||||
|
}
|
||||||
|
|
||||||
|
private getDataMonth(): TrafficList[] {
|
||||||
|
const getFirstDateInPeriod = () => {
|
||||||
|
const months = this.period.getMonths();
|
||||||
|
|
||||||
|
return months[months.length - 1];
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.reduceData(this.period.getMonths(), getFirstDateInPeriod);
|
||||||
|
}
|
||||||
|
|
||||||
|
private getDataYear(): TrafficList[] {
|
||||||
|
const getFirstDateInPeriod = () => {
|
||||||
|
const years = this.period.getYears();
|
||||||
|
|
||||||
|
return `${parseInt(years[0], 10) - 1}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.reduceData(this.period.getYears(), getFirstDateInPeriod);
|
||||||
|
}
|
||||||
|
|
||||||
|
private reduceData(timePeriods: string[], getFirstDateInPeriod: () => string): TrafficList[] {
|
||||||
|
return timePeriods.reduce((result, timePeriod, index) => {
|
||||||
|
const hasResult = result[index - 1];
|
||||||
|
const prevDate = hasResult ?
|
||||||
|
result[index - 1].comparison.nextDate :
|
||||||
|
getFirstDateInPeriod();
|
||||||
|
const prevValue = hasResult ?
|
||||||
|
result[index - 1].comparison.nextValue :
|
||||||
|
this.getRandom(100);
|
||||||
|
const nextValue = this.getRandom(100);
|
||||||
|
const deltaValue = prevValue - nextValue;
|
||||||
|
|
||||||
|
const item = {
|
||||||
|
date: timePeriod,
|
||||||
|
value: this.getRandom(1000),
|
||||||
|
delta: {
|
||||||
|
up: deltaValue <= 0,
|
||||||
|
value: Math.abs(deltaValue),
|
||||||
|
},
|
||||||
|
comparison: {
|
||||||
|
prevDate,
|
||||||
|
prevValue,
|
||||||
|
nextDate: timePeriod,
|
||||||
|
nextValue,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
return [...result, item];
|
||||||
|
}, []);
|
||||||
|
}
|
||||||
|
|
||||||
|
getTrafficListData(period: string): Observable<TrafficList> {
|
||||||
|
return observableOf(this.data[period]);
|
||||||
|
}
|
||||||
|
}
|
||||||
57
src/app/@core/mock/user-activity.service.ts
Normal file
57
src/app/@core/mock/user-activity.service.ts
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { PeriodsService } from './periods.service';
|
||||||
|
import { UserActive, UserActivityData } from '../data/user-activity';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class UserActivityService extends UserActivityData {
|
||||||
|
|
||||||
|
private getRandom = (roundTo: number) => Math.round(Math.random() * roundTo);
|
||||||
|
private generateUserActivityRandomData(date) {
|
||||||
|
return {
|
||||||
|
date,
|
||||||
|
pagesVisitCount: this.getRandom(1000),
|
||||||
|
deltaUp: this.getRandom(1) % 2 === 0,
|
||||||
|
newVisits: this.getRandom(100),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
data = {};
|
||||||
|
|
||||||
|
constructor(private periods: PeriodsService) {
|
||||||
|
super();
|
||||||
|
this.data = {
|
||||||
|
week: this.getDataWeek(),
|
||||||
|
month: this.getDataMonth(),
|
||||||
|
year: this.getDataYear(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private getDataWeek(): UserActive[] {
|
||||||
|
return this.periods.getWeeks().map((week) => {
|
||||||
|
return this.generateUserActivityRandomData(week);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private getDataMonth(): UserActive[] {
|
||||||
|
const currentDate = new Date();
|
||||||
|
const days = currentDate.getDate();
|
||||||
|
const month = this.periods.getMonths()[currentDate.getMonth()];
|
||||||
|
|
||||||
|
return Array.from(Array(days)).map((_, index) => {
|
||||||
|
const date = `${index + 1} ${month}`;
|
||||||
|
|
||||||
|
return this.generateUserActivityRandomData(date);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private getDataYear(): UserActive[] {
|
||||||
|
return this.periods.getYears().map((year) => {
|
||||||
|
return this.generateUserActivityRandomData(year);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getUserActivityData(period: string): Observable<UserActive[]> {
|
||||||
|
return observableOf(this.data[period]);
|
||||||
|
}
|
||||||
|
}
|
||||||
53
src/app/@core/mock/users.service.ts
Normal file
53
src/app/@core/mock/users.service.ts
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Contacts, RecentUsers, UserData } from '../data/users';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class UserService extends UserData {
|
||||||
|
|
||||||
|
private time: Date = new Date;
|
||||||
|
|
||||||
|
private users = {
|
||||||
|
nick: { name: 'Nick Jones', picture: 'assets/images/nick.png' },
|
||||||
|
eva: { name: 'Eva Moor', picture: 'assets/images/eva.png' },
|
||||||
|
jack: { name: 'Jack Williams', picture: 'assets/images/jack.png' },
|
||||||
|
lee: { name: 'Lee Wong', picture: 'assets/images/lee.png' },
|
||||||
|
alan: { name: 'Alan Thompson', picture: 'assets/images/alan.png' },
|
||||||
|
kate: { name: 'Kate Martinez', picture: 'assets/images/kate.png' },
|
||||||
|
};
|
||||||
|
private types = {
|
||||||
|
mobile: 'mobile',
|
||||||
|
home: 'home',
|
||||||
|
work: 'work',
|
||||||
|
};
|
||||||
|
private contacts: Contacts[] = [
|
||||||
|
{ user: this.users.nick, type: this.types.mobile },
|
||||||
|
{ user: this.users.eva, type: this.types.home },
|
||||||
|
{ user: this.users.jack, type: this.types.mobile },
|
||||||
|
{ user: this.users.lee, type: this.types.mobile },
|
||||||
|
{ user: this.users.alan, type: this.types.home },
|
||||||
|
{ user: this.users.kate, type: this.types.work },
|
||||||
|
];
|
||||||
|
private recentUsers: RecentUsers[] = [
|
||||||
|
{ user: this.users.alan, type: this.types.home, time: this.time.setHours(21, 12)},
|
||||||
|
{ user: this.users.eva, type: this.types.home, time: this.time.setHours(17, 45)},
|
||||||
|
{ user: this.users.nick, type: this.types.mobile, time: this.time.setHours(5, 29)},
|
||||||
|
{ user: this.users.lee, type: this.types.mobile, time: this.time.setHours(11, 24)},
|
||||||
|
{ user: this.users.jack, type: this.types.mobile, time: this.time.setHours(10, 45)},
|
||||||
|
{ user: this.users.kate, type: this.types.work, time: this.time.setHours(9, 42)},
|
||||||
|
{ user: this.users.kate, type: this.types.work, time: this.time.setHours(9, 31)},
|
||||||
|
{ user: this.users.jack, type: this.types.mobile, time: this.time.setHours(8, 0)},
|
||||||
|
];
|
||||||
|
|
||||||
|
getUsers(): Observable<any> {
|
||||||
|
return observableOf(this.users);
|
||||||
|
}
|
||||||
|
|
||||||
|
getContacts(): Observable<Contacts[]> {
|
||||||
|
return observableOf(this.contacts);
|
||||||
|
}
|
||||||
|
|
||||||
|
getRecentUsers(): Observable<RecentUsers[]> {
|
||||||
|
return observableOf(this.recentUsers);
|
||||||
|
}
|
||||||
|
}
|
||||||
57
src/app/@core/mock/visitors-analytics.service.ts
Normal file
57
src/app/@core/mock/visitors-analytics.service.ts
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
import { PeriodsService } from './periods.service';
|
||||||
|
import { OutlineData, VisitorsAnalyticsData } from '../data/visitors-analytics';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class VisitorsAnalyticsService extends VisitorsAnalyticsData {
|
||||||
|
|
||||||
|
constructor(private periodService: PeriodsService) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
private pieChartValue = 75;
|
||||||
|
private innerLinePoints: number[] = [
|
||||||
|
94, 188, 225, 244, 253, 254, 249, 235, 208,
|
||||||
|
173, 141, 118, 105, 97, 94, 96, 104, 121, 147,
|
||||||
|
183, 224, 265, 302, 333, 358, 375, 388, 395,
|
||||||
|
400, 400, 397, 390, 377, 360, 338, 310, 278,
|
||||||
|
241, 204, 166, 130, 98, 71, 49, 32, 20, 13, 9,
|
||||||
|
];
|
||||||
|
private outerLinePoints: number[] = [
|
||||||
|
85, 71, 59, 50, 45, 42, 41, 44 , 58, 88,
|
||||||
|
136 , 199, 267, 326, 367, 391, 400, 397,
|
||||||
|
376, 319, 200, 104, 60, 41, 36, 37, 44,
|
||||||
|
55, 74, 100 , 131, 159, 180, 193, 199, 200,
|
||||||
|
195, 184, 164, 135, 103, 73, 50, 33, 22, 15, 11,
|
||||||
|
];
|
||||||
|
private generateOutlineLineData(): OutlineData[] {
|
||||||
|
const months = this.periodService.getMonths();
|
||||||
|
const outerLinePointsLength = this.outerLinePoints.length;
|
||||||
|
const monthsLength = months.length;
|
||||||
|
|
||||||
|
return this.outerLinePoints.map((p, index) => {
|
||||||
|
const monthIndex = Math.round(index / 4);
|
||||||
|
const label = (index % Math.round(outerLinePointsLength / monthsLength) === 0)
|
||||||
|
? months[monthIndex]
|
||||||
|
: '';
|
||||||
|
|
||||||
|
return {
|
||||||
|
label,
|
||||||
|
value: p,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getInnerLineChartData(): Observable<number[]> {
|
||||||
|
return observableOf(this.innerLinePoints);
|
||||||
|
}
|
||||||
|
|
||||||
|
getOutlineLineChartData(): Observable<OutlineData[]> {
|
||||||
|
return observableOf(this.generateOutlineLineData());
|
||||||
|
}
|
||||||
|
|
||||||
|
getPieChartData(): Observable<number> {
|
||||||
|
return observableOf(this.pieChartValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
5
src/app/@core/module-import-guard.ts
Normal file
5
src/app/@core/module-import-guard.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export function throwIfAlreadyLoaded(parentModule: any, moduleName: string) {
|
||||||
|
if (parentModule) {
|
||||||
|
throw new Error(`${moduleName} has already been loaded. Import Core modules in the AppModule only.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
0
src/app/@core/utils/.gitkeep
Normal file
0
src/app/@core/utils/.gitkeep
Normal file
32
src/app/@core/utils/analytics.service.ts
Normal file
32
src/app/@core/utils/analytics.service.ts
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { NavigationEnd, Router } from '@angular/router';
|
||||||
|
import { Location } from '@angular/common';
|
||||||
|
import { filter } from 'rxjs/operators';
|
||||||
|
|
||||||
|
declare const ga: any;
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class AnalyticsService {
|
||||||
|
private enabled: boolean;
|
||||||
|
|
||||||
|
constructor(private location: Location, private router: Router) {
|
||||||
|
this.enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
trackPageViews() {
|
||||||
|
if (this.enabled) {
|
||||||
|
this.router.events.pipe(
|
||||||
|
filter((event) => event instanceof NavigationEnd),
|
||||||
|
)
|
||||||
|
.subscribe(() => {
|
||||||
|
ga('send', {hitType: 'pageview', page: this.location.path()});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
trackEvent(eventName: string) {
|
||||||
|
if (this.enabled) {
|
||||||
|
ga('send', 'event', eventName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/app/@core/utils/index.ts
Normal file
13
src/app/@core/utils/index.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { LayoutService } from './layout.service';
|
||||||
|
import { AnalyticsService } from './analytics.service';
|
||||||
|
import { PlayerService } from './player.service';
|
||||||
|
import { StateService } from './state.service';
|
||||||
|
import { SeoService } from './seo.service';
|
||||||
|
|
||||||
|
export {
|
||||||
|
LayoutService,
|
||||||
|
AnalyticsService,
|
||||||
|
PlayerService,
|
||||||
|
SeoService,
|
||||||
|
StateService,
|
||||||
|
};
|
||||||
26
src/app/@core/utils/layout.service.ts
Normal file
26
src/app/@core/utils/layout.service.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Observable, Subject } from 'rxjs';
|
||||||
|
import { delay, shareReplay, debounceTime } from 'rxjs/operators';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class LayoutService {
|
||||||
|
|
||||||
|
protected layoutSize$ = new Subject();
|
||||||
|
protected layoutSizeChange$ = this.layoutSize$.pipe(
|
||||||
|
shareReplay({ refCount: true }),
|
||||||
|
);
|
||||||
|
|
||||||
|
changeLayoutSize() {
|
||||||
|
this.layoutSize$.next();
|
||||||
|
}
|
||||||
|
|
||||||
|
onChangeLayoutSize(): Observable<any> {
|
||||||
|
return this.layoutSizeChange$.pipe(delay(1));
|
||||||
|
}
|
||||||
|
|
||||||
|
onSafeChangeLayoutSize(): Observable<any> {
|
||||||
|
return this.layoutSizeChange$.pipe(
|
||||||
|
debounceTime(350),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
66
src/app/@core/utils/player.service.ts
Normal file
66
src/app/@core/utils/player.service.ts
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
export class Track {
|
||||||
|
name: string;
|
||||||
|
artist: string;
|
||||||
|
url: string;
|
||||||
|
cover: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class PlayerService {
|
||||||
|
current: number;
|
||||||
|
playlist: Track[] = [
|
||||||
|
{
|
||||||
|
name: 'Don\'t Wanna Fight',
|
||||||
|
artist: 'Alabama Shakes',
|
||||||
|
url: 'https://p.scdn.co/mp3-preview/6156cdbca425a894972c02fca9d76c0b70e001af',
|
||||||
|
cover: 'assets/images/cover1.jpg',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Harder',
|
||||||
|
artist: 'Daft Punk',
|
||||||
|
url: 'https://p.scdn.co/mp3-preview/92a04c7c0e96bf93a1b1b1cae7dfff1921969a7b',
|
||||||
|
cover: 'assets/images/cover2.jpg',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Come Together',
|
||||||
|
artist: 'Beatles',
|
||||||
|
url: 'https://p.scdn.co/mp3-preview/83090a4db6899eaca689ae35f69126dbe65d94c9',
|
||||||
|
cover: 'assets/images/cover3.jpg',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
random(): Track {
|
||||||
|
this.current = Math.floor(Math.random() * this.playlist.length);
|
||||||
|
return this.playlist[this.current];
|
||||||
|
}
|
||||||
|
|
||||||
|
next(): Track {
|
||||||
|
return this.getNextTrack();
|
||||||
|
}
|
||||||
|
|
||||||
|
prev() {
|
||||||
|
return this.getPrevTrack();
|
||||||
|
}
|
||||||
|
|
||||||
|
private getNextTrack(): Track {
|
||||||
|
if (this.current === this.playlist.length - 1) {
|
||||||
|
this.current = 0;
|
||||||
|
} else {
|
||||||
|
this.current++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.playlist[this.current];
|
||||||
|
}
|
||||||
|
|
||||||
|
private getPrevTrack(): Track {
|
||||||
|
if (this.current === 0) {
|
||||||
|
this.current = this.playlist.length - 1;
|
||||||
|
} else {
|
||||||
|
this.current--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.playlist[this.current];
|
||||||
|
}
|
||||||
|
}
|
||||||
58
src/app/@core/utils/seo.service.ts
Normal file
58
src/app/@core/utils/seo.service.ts
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
import { Injectable, Inject, PLATFORM_ID, OnDestroy } from '@angular/core';
|
||||||
|
import { isPlatformBrowser } from '@angular/common';
|
||||||
|
import { NavigationEnd, Router } from '@angular/router';
|
||||||
|
import { NB_DOCUMENT } from '@nebular/theme';
|
||||||
|
import { filter, takeUntil } from 'rxjs/operators';
|
||||||
|
import { Subject } from 'rxjs';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class SeoService implements OnDestroy {
|
||||||
|
|
||||||
|
private readonly destroy$ = new Subject<void>();
|
||||||
|
private readonly dom: Document;
|
||||||
|
private readonly isBrowser: boolean;
|
||||||
|
private linkCanonical: HTMLLinkElement;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private router: Router,
|
||||||
|
@Inject(NB_DOCUMENT) document,
|
||||||
|
@Inject(PLATFORM_ID) platformId,
|
||||||
|
) {
|
||||||
|
this.isBrowser = isPlatformBrowser(platformId);
|
||||||
|
this.dom = document;
|
||||||
|
|
||||||
|
if (this.isBrowser) {
|
||||||
|
this.createCanonicalTag();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
this.destroy$.next();
|
||||||
|
this.destroy$.complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
createCanonicalTag() {
|
||||||
|
this.linkCanonical = this.dom.createElement('link');
|
||||||
|
this.linkCanonical.setAttribute('rel', 'canonical');
|
||||||
|
this.dom.head.appendChild(this.linkCanonical);
|
||||||
|
this.linkCanonical.setAttribute('href', this.getCanonicalUrl());
|
||||||
|
}
|
||||||
|
|
||||||
|
trackCanonicalChanges() {
|
||||||
|
if (!this.isBrowser) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.router.events.pipe(
|
||||||
|
filter((event) => event instanceof NavigationEnd),
|
||||||
|
takeUntil(this.destroy$),
|
||||||
|
)
|
||||||
|
.subscribe(() => {
|
||||||
|
this.linkCanonical.setAttribute('href', this.getCanonicalUrl());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private getCanonicalUrl(): string {
|
||||||
|
return this.dom.location.origin + this.dom.location.pathname;
|
||||||
|
}
|
||||||
|
}
|
||||||
92
src/app/@core/utils/state.service.ts
Normal file
92
src/app/@core/utils/state.service.ts
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
import { Injectable, OnDestroy } from '@angular/core';
|
||||||
|
import { of as observableOf, Observable, BehaviorSubject } from 'rxjs';
|
||||||
|
import { takeWhile } from 'rxjs/operators';
|
||||||
|
|
||||||
|
import { NbLayoutDirectionService, NbLayoutDirection } from '@nebular/theme';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class StateService implements OnDestroy {
|
||||||
|
|
||||||
|
protected layouts: any = [
|
||||||
|
{
|
||||||
|
name: 'One Column',
|
||||||
|
icon: 'nb-layout-default',
|
||||||
|
id: 'one-column',
|
||||||
|
selected: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Two Column',
|
||||||
|
icon: 'nb-layout-two-column',
|
||||||
|
id: 'two-column',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Center Column',
|
||||||
|
icon: 'nb-layout-centre',
|
||||||
|
id: 'center-column',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
protected sidebars: any = [
|
||||||
|
{
|
||||||
|
name: 'Sidebar at layout start',
|
||||||
|
icon: 'nb-layout-sidebar-left',
|
||||||
|
id: 'start',
|
||||||
|
selected: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Sidebar at layout end',
|
||||||
|
icon: 'nb-layout-sidebar-right',
|
||||||
|
id: 'end',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
protected layoutState$ = new BehaviorSubject(this.layouts[0]);
|
||||||
|
protected sidebarState$ = new BehaviorSubject(this.sidebars[0]);
|
||||||
|
|
||||||
|
alive = true;
|
||||||
|
|
||||||
|
constructor(directionService: NbLayoutDirectionService) {
|
||||||
|
directionService.onDirectionChange()
|
||||||
|
.pipe(takeWhile(() => this.alive))
|
||||||
|
.subscribe(direction => this.updateSidebarIcons(direction));
|
||||||
|
|
||||||
|
this.updateSidebarIcons(directionService.getDirection());
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
this.alive = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private updateSidebarIcons(direction: NbLayoutDirection) {
|
||||||
|
const [ startSidebar, endSidebar ] = this.sidebars;
|
||||||
|
const isLtr = direction === NbLayoutDirection.LTR;
|
||||||
|
const startIconClass = isLtr ? 'nb-layout-sidebar-left' : 'nb-layout-sidebar-right';
|
||||||
|
const endIconClass = isLtr ? 'nb-layout-sidebar-right' : 'nb-layout-sidebar-left';
|
||||||
|
startSidebar.icon = startIconClass;
|
||||||
|
endSidebar.icon = endIconClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
setLayoutState(state: any): any {
|
||||||
|
this.layoutState$.next(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
getLayoutStates(): Observable<any[]> {
|
||||||
|
return observableOf(this.layouts);
|
||||||
|
}
|
||||||
|
|
||||||
|
onLayoutState(): Observable<any> {
|
||||||
|
return this.layoutState$.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
setSidebarState(state: any): any {
|
||||||
|
this.sidebarState$.next(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
getSidebarStates(): Observable<any[]> {
|
||||||
|
return observableOf(this.sidebars);
|
||||||
|
}
|
||||||
|
|
||||||
|
onSidebarState(): Observable<any> {
|
||||||
|
return this.sidebarState$.asObservable();
|
||||||
|
}
|
||||||
|
}
|
||||||
30
src/app/@theme/components/footer/footer.component.scss
Normal file
30
src/app/@theme/components/footer/footer.component.scss
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
@import '../../styles/themes';
|
||||||
|
@import '~@nebular/theme/styles/global/breakpoints';
|
||||||
|
@import '~bootstrap/scss/mixins/breakpoints';
|
||||||
|
|
||||||
|
@include nb-install-component() {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.socials {
|
||||||
|
font-size: 2rem;
|
||||||
|
|
||||||
|
a {
|
||||||
|
padding: 0.4rem;
|
||||||
|
color: nb-theme(text-hint-color);
|
||||||
|
transition: color ease-out 0.1s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: nb-theme(text-basic-color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@include media-breakpoint-down(is) {
|
||||||
|
.socials {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
src/app/@theme/components/footer/footer.component.ts
Normal file
19
src/app/@theme/components/footer/footer.component.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ngx-footer',
|
||||||
|
styleUrls: ['./footer.component.scss'],
|
||||||
|
template: `
|
||||||
|
<span class="created-by">
|
||||||
|
Created with ♥ by <b><a href="#" target="_blank">Chris</a></b> 2022
|
||||||
|
</span>
|
||||||
|
<!-- <div class="socials">
|
||||||
|
<a href="#" target="_blank" class="ion ion-social-github"></a>
|
||||||
|
<a href="#" target="_blank" class="ion ion-social-facebook"></a>
|
||||||
|
<a href="#" target="_blank" class="ion ion-social-twitter"></a>
|
||||||
|
<a href="#" target="_blank" class="ion ion-social-linkedin"></a>
|
||||||
|
</div> -->
|
||||||
|
`,
|
||||||
|
})
|
||||||
|
export class FooterComponent {
|
||||||
|
}
|
||||||
28
src/app/@theme/components/header/header.component.html
Normal file
28
src/app/@theme/components/header/header.component.html
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<div class="header-container">
|
||||||
|
<div class="logo-container">
|
||||||
|
<a (click)="toggleSidebar()" href="#" class="sidebar-toggle">
|
||||||
|
<nb-icon icon="menu-2-outline"></nb-icon>
|
||||||
|
</a>
|
||||||
|
<a class="logo" href="#" (click)="navigateHome()"><img class="h-100" src='/assets/images/ArkLogo.svg' />
|
||||||
|
{{header}}</a>
|
||||||
|
</div>
|
||||||
|
<!-- <nb-select [selected]="currentTheme" (selectedChange)="changeTheme($event)" status="primary">
|
||||||
|
<nb-option *ngFor="let theme of themes" [value]="theme.value"> {{ theme.name }}</nb-option>
|
||||||
|
</nb-select> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header-container">
|
||||||
|
<nb-actions size="small">
|
||||||
|
<!--
|
||||||
|
<nb-action class="control-item">
|
||||||
|
<nb-search type="rotate-layout"></nb-search>
|
||||||
|
</nb-action>
|
||||||
|
<nb-action class="control-item" icon="email-outline"></nb-action>
|
||||||
|
<nb-action class="control-item" icon="bell-outline"></nb-action> -->
|
||||||
|
<nb-action class="user-action" *ngIf="user">
|
||||||
|
<nb-user [nbContextMenu]="userMenu" nbContextMenuTag="UserProfileMenu" [onlyPicture]="userPictureOnly"
|
||||||
|
[name]="userFullName" [picture]="avatarImage">
|
||||||
|
</nb-user>
|
||||||
|
</nb-action>
|
||||||
|
</nb-actions>
|
||||||
|
</div>
|
||||||
76
src/app/@theme/components/header/header.component.scss
Normal file
76
src/app/@theme/components/header/header.component.scss
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
@import '~bootstrap/scss/mixins/breakpoints';
|
||||||
|
@import '~@nebular/theme/styles/global/breakpoints';
|
||||||
|
@import '../../styles/themes';
|
||||||
|
|
||||||
|
@include nb-install-component() {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.logo-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
width: calc(#{nb-theme(sidebar-width)} - #{nb-theme(header-padding)});
|
||||||
|
}
|
||||||
|
|
||||||
|
nb-action {
|
||||||
|
height: auto;
|
||||||
|
display: flex;
|
||||||
|
align-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
nb-user {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
::ng-deep nb-search button {
|
||||||
|
padding: 0!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
width: auto;
|
||||||
|
|
||||||
|
.sidebar-toggle {
|
||||||
|
@include nb-ltr(padding-right, 1.25rem);
|
||||||
|
@include nb-rtl(padding-left, 1.25rem);
|
||||||
|
text-decoration: none;
|
||||||
|
color: nb-theme(text-hint-color);
|
||||||
|
nb-icon {
|
||||||
|
font-size: 1.75rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
//padding: 0 1.25rem;
|
||||||
|
padding: 3px 0.25rem;
|
||||||
|
font-size: 1.75rem;
|
||||||
|
@include nb-ltr(border-left, 1px solid nb-theme(divider-color));
|
||||||
|
@include nb-rtl(border-right, 1px solid nb-theme(divider-color));
|
||||||
|
white-space: nowrap;
|
||||||
|
text-decoration: none;
|
||||||
|
height: 58px;
|
||||||
|
|
||||||
|
color: #c0d9b4;
|
||||||
|
font-size: 21px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@include media-breakpoint-down(sm) {
|
||||||
|
.control-item {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.user-action {
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@include media-breakpoint-down(is) {
|
||||||
|
nb-select {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
137
src/app/@theme/components/header/header.component.ts
Normal file
137
src/app/@theme/components/header/header.component.ts
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
import { NbMediaBreakpointsService, NbMenuItem, NbMenuService, NbSidebarService, NbThemeService } from '@nebular/theme';
|
||||||
|
|
||||||
|
import { UserData } from '../../../@core/data/users';
|
||||||
|
import { LayoutService } from '../../../@core/utils';
|
||||||
|
import { map, takeUntil, first } from 'rxjs/operators';
|
||||||
|
import { Subject } from 'rxjs';
|
||||||
|
import { HeaderService } from '../../../services/header.service';
|
||||||
|
import { NbAuthService } from '@nebular/auth';
|
||||||
|
import { AuthService } from '../../../services/auth.service';
|
||||||
|
import { UserProfileAction } from '../../../entity/Auth';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ngx-header',
|
||||||
|
styleUrls: ['./header.component.scss'],
|
||||||
|
templateUrl: './header.component.html',
|
||||||
|
})
|
||||||
|
export class HeaderComponent implements OnInit, OnDestroy {
|
||||||
|
header: string = '';
|
||||||
|
private destroy$: Subject<void> = new Subject<void>();
|
||||||
|
userPictureOnly: boolean = false;
|
||||||
|
|
||||||
|
themes = [
|
||||||
|
{
|
||||||
|
value: 'default',
|
||||||
|
name: 'Light',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'dark',
|
||||||
|
name: 'Dark',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'cosmic',
|
||||||
|
name: 'Cosmic',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'corporate',
|
||||||
|
name: 'Corporate',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
currentTheme = 'default';
|
||||||
|
|
||||||
|
userMenu: NbMenuItem[] = [
|
||||||
|
{
|
||||||
|
title: 'Profile',
|
||||||
|
data: UserProfileAction.GoToProfile
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Log out',
|
||||||
|
data: UserProfileAction.LogOut
|
||||||
|
}];
|
||||||
|
|
||||||
|
public get user() {
|
||||||
|
return this.authService.userAccess;
|
||||||
|
}
|
||||||
|
public get userFullName() {
|
||||||
|
if (this.user) {
|
||||||
|
return `${this.user.firstName} ${this.user.lastName}`;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public get avatarImage() {
|
||||||
|
if (this.user && this.user.avatarImage) {
|
||||||
|
return this.user.avatarImage
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
constructor(private sidebarService: NbSidebarService,
|
||||||
|
private menuService: NbMenuService,
|
||||||
|
private themeService: NbThemeService,
|
||||||
|
private userService: UserData,
|
||||||
|
private layoutService: LayoutService,
|
||||||
|
private breakpointService: NbMediaBreakpointsService,
|
||||||
|
private headerService: HeaderService,
|
||||||
|
private oAuthService: NbAuthService,
|
||||||
|
private authService: AuthService,
|
||||||
|
) {
|
||||||
|
|
||||||
|
this.headerService.headerChange$.pipe(takeUntil(this.destroy$)).subscribe(result => {
|
||||||
|
this.header = result;
|
||||||
|
});
|
||||||
|
this.menuService.onItemClick().pipe(takeUntil(this.destroy$))
|
||||||
|
.subscribe(result => {
|
||||||
|
if (result.item.title == 'Log out') this.logout();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.currentTheme = this.themeService.currentTheme;
|
||||||
|
|
||||||
|
const { xl } = this.breakpointService.getBreakpointsMap();
|
||||||
|
this.themeService.onMediaQueryChange()
|
||||||
|
.pipe(
|
||||||
|
map(([, currentBreakpoint]) => currentBreakpoint.width < xl),
|
||||||
|
takeUntil(this.destroy$),
|
||||||
|
)
|
||||||
|
.subscribe((isLessThanXl: boolean) => this.userPictureOnly = isLessThanXl);
|
||||||
|
|
||||||
|
this.themeService.onThemeChange()
|
||||||
|
.pipe(
|
||||||
|
map(({ name }) => name),
|
||||||
|
takeUntil(this.destroy$),
|
||||||
|
)
|
||||||
|
.subscribe(themeName => this.currentTheme = themeName);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
this.destroy$.next();
|
||||||
|
this.destroy$.complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
changeTheme(themeName: string) {
|
||||||
|
this.themeService.changeTheme(themeName);
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleSidebar(): boolean {
|
||||||
|
this.sidebarService.toggle(true, 'menu-sidebar');
|
||||||
|
this.layoutService.changeLayoutSize();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
navigateHome() {
|
||||||
|
this.menuService.navigateHome();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
logout() {
|
||||||
|
this.authService.logout();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
4
src/app/@theme/components/index.ts
Normal file
4
src/app/@theme/components/index.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export * from './header/header.component';
|
||||||
|
export * from './footer/footer.component';
|
||||||
|
export * from './search-input/search-input.component';
|
||||||
|
export * from './tiny-mce/tiny-mce.component';
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
:host {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
i.control-icon {
|
||||||
|
&::before {
|
||||||
|
font-size: 2.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
margin-left: 1rem;
|
||||||
|
width: 15rem;
|
||||||
|
transition: width 0.2s ease;
|
||||||
|
|
||||||
|
&.hidden {
|
||||||
|
width: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::ng-deep search-input {
|
||||||
|
input {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
import { Component, ElementRef, EventEmitter, Output, ViewChild } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ngx-search-input',
|
||||||
|
styleUrls: ['./search-input.component.scss'],
|
||||||
|
template: `
|
||||||
|
<i class="control-icon ion ion-ios-search"
|
||||||
|
(click)="showInput()"></i>
|
||||||
|
<input placeholder="Type your search request here..."
|
||||||
|
#input
|
||||||
|
[class.hidden]="!isInputShown"
|
||||||
|
(blur)="hideInput()"
|
||||||
|
(input)="onInput($event)">
|
||||||
|
`,
|
||||||
|
})
|
||||||
|
export class SearchInputComponent {
|
||||||
|
@ViewChild('input', { static: true }) input: ElementRef;
|
||||||
|
|
||||||
|
@Output() search: EventEmitter<string> = new EventEmitter<string>();
|
||||||
|
|
||||||
|
isInputShown = false;
|
||||||
|
|
||||||
|
showInput() {
|
||||||
|
this.isInputShown = true;
|
||||||
|
this.input.nativeElement.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
hideInput() {
|
||||||
|
this.isInputShown = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
onInput(val: string) {
|
||||||
|
this.search.emit(val);
|
||||||
|
}
|
||||||
|
}
|
||||||
37
src/app/@theme/components/tiny-mce/tiny-mce.component.ts
Normal file
37
src/app/@theme/components/tiny-mce/tiny-mce.component.ts
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import { Component, OnDestroy, AfterViewInit, Output, EventEmitter, ElementRef } from '@angular/core';
|
||||||
|
import { LocationStrategy } from '@angular/common';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ngx-tiny-mce',
|
||||||
|
template: '',
|
||||||
|
})
|
||||||
|
export class TinyMCEComponent implements OnDestroy, AfterViewInit {
|
||||||
|
|
||||||
|
@Output() editorKeyup = new EventEmitter<any>();
|
||||||
|
|
||||||
|
editor: any;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private host: ElementRef,
|
||||||
|
private locationStrategy: LocationStrategy,
|
||||||
|
) { }
|
||||||
|
|
||||||
|
ngAfterViewInit() {
|
||||||
|
tinymce.init({
|
||||||
|
target: this.host.nativeElement,
|
||||||
|
plugins: ['link', 'paste', 'table'],
|
||||||
|
skin_url: `${this.locationStrategy.getBaseHref()}assets/skins/lightgray`,
|
||||||
|
setup: editor => {
|
||||||
|
this.editor = editor;
|
||||||
|
editor.on('keyup', () => {
|
||||||
|
this.editorKeyup.emit(editor.getContent());
|
||||||
|
});
|
||||||
|
},
|
||||||
|
height: '320',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
tinymce.remove(this.editor);
|
||||||
|
}
|
||||||
|
}
|
||||||
0
src/app/@theme/directives/.gitkeep
Normal file
0
src/app/@theme/directives/.gitkeep
Normal file
4
src/app/@theme/layouts/index.ts
Normal file
4
src/app/@theme/layouts/index.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export * from './one-column/one-column.layout';
|
||||||
|
export * from './two-columns/two-columns.layout';
|
||||||
|
export * from './three-columns/three-columns.layout';
|
||||||
|
export * from './plain/plain.layout';
|
||||||
9
src/app/@theme/layouts/one-column/one-column.layout.scss
Normal file
9
src/app/@theme/layouts/one-column/one-column.layout.scss
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
@import '../../styles/themes';
|
||||||
|
@import '~bootstrap/scss/mixins/breakpoints';
|
||||||
|
@import '~@nebular/theme/styles/global/breakpoints';
|
||||||
|
|
||||||
|
@include nb-install-component() {
|
||||||
|
.menu-sidebar ::ng-deep .scrollable {
|
||||||
|
padding-top: nb-theme(layout-padding-top);
|
||||||
|
}
|
||||||
|
}
|
||||||
26
src/app/@theme/layouts/one-column/one-column.layout.ts
Normal file
26
src/app/@theme/layouts/one-column/one-column.layout.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ngx-one-column-layout',
|
||||||
|
styleUrls: ['./one-column.layout.scss'],
|
||||||
|
template: `
|
||||||
|
<nb-layout windowMode>
|
||||||
|
<nb-layout-header fixed>
|
||||||
|
<ngx-header></ngx-header>
|
||||||
|
</nb-layout-header>
|
||||||
|
|
||||||
|
<nb-sidebar class="menu-sidebar" tag="menu-sidebar" responsive>
|
||||||
|
<ng-content select="nb-menu"></ng-content>
|
||||||
|
</nb-sidebar>
|
||||||
|
|
||||||
|
<nb-layout-column>
|
||||||
|
<ng-content select="router-outlet"></ng-content>
|
||||||
|
</nb-layout-column>
|
||||||
|
|
||||||
|
<nb-layout-footer fixed>
|
||||||
|
<ngx-footer></ngx-footer>
|
||||||
|
</nb-layout-footer>
|
||||||
|
</nb-layout>
|
||||||
|
`,
|
||||||
|
})
|
||||||
|
export class OneColumnLayoutComponent {}
|
||||||
9
src/app/@theme/layouts/plain/plain.layout.scss
Normal file
9
src/app/@theme/layouts/plain/plain.layout.scss
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
@import '../../styles/themes';
|
||||||
|
@import '~bootstrap/scss/mixins/breakpoints';
|
||||||
|
@import '~@nebular/theme/styles/global/breakpoints';
|
||||||
|
|
||||||
|
@include nb-install-component() {
|
||||||
|
.menu-sidebar ::ng-deep .scrollable {
|
||||||
|
padding-top: nb-theme(layout-padding-top);
|
||||||
|
}
|
||||||
|
}
|
||||||
20
src/app/@theme/layouts/plain/plain.layout.ts
Normal file
20
src/app/@theme/layouts/plain/plain.layout.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ngx-plain-layout',
|
||||||
|
styleUrls: ['./plain.layout.scss'],
|
||||||
|
template: `
|
||||||
|
<nb-layout>
|
||||||
|
|
||||||
|
|
||||||
|
<nb-layout-column>
|
||||||
|
<ng-content select="router-outlet"></ng-content>
|
||||||
|
</nb-layout-column>
|
||||||
|
|
||||||
|
<nb-layout-footer fixed>
|
||||||
|
<ngx-footer></ngx-footer>
|
||||||
|
</nb-layout-footer>
|
||||||
|
</nb-layout>
|
||||||
|
`,
|
||||||
|
})
|
||||||
|
export class PlainLayoutComponent { }
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
@import '../../styles/themes';
|
||||||
|
@import '~bootstrap/scss/mixins/breakpoints';
|
||||||
|
@import '~@nebular/theme/styles/global/breakpoints';
|
||||||
|
|
||||||
|
@include nb-install-component() {
|
||||||
|
.menu-sidebar ::ng-deep .scrollable {
|
||||||
|
padding-top: nb-theme(layout-padding-top);
|
||||||
|
}
|
||||||
|
}
|
||||||
32
src/app/@theme/layouts/three-columns/three-columns.layout.ts
Normal file
32
src/app/@theme/layouts/three-columns/three-columns.layout.ts
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ngx-three-columns-layout',
|
||||||
|
styleUrls: ['./three-columns.layout.scss'],
|
||||||
|
template: `
|
||||||
|
<nb-layout windowMode>
|
||||||
|
<nb-layout-header fixed>
|
||||||
|
<ngx-header></ngx-header>
|
||||||
|
</nb-layout-header>
|
||||||
|
|
||||||
|
<nb-sidebar class="menu-sidebar" tag="menu-sidebar" responsive>
|
||||||
|
<ng-content select="nb-menu"></ng-content>
|
||||||
|
</nb-sidebar>
|
||||||
|
|
||||||
|
<nb-layout-column class="small">
|
||||||
|
</nb-layout-column>
|
||||||
|
|
||||||
|
<nb-layout-column>
|
||||||
|
<ng-content select="router-outlet"></ng-content>
|
||||||
|
</nb-layout-column>
|
||||||
|
|
||||||
|
<nb-layout-column class="small">
|
||||||
|
</nb-layout-column>
|
||||||
|
|
||||||
|
<nb-layout-footer fixed>
|
||||||
|
<ngx-footer></ngx-footer>
|
||||||
|
</nb-layout-footer>
|
||||||
|
</nb-layout>
|
||||||
|
`,
|
||||||
|
})
|
||||||
|
export class ThreeColumnsLayoutComponent {}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
@import '../../styles/themes';
|
||||||
|
@import '~bootstrap/scss/mixins/breakpoints';
|
||||||
|
@import '~@nebular/theme/styles/global/breakpoints';
|
||||||
|
|
||||||
|
@include nb-install-component() {
|
||||||
|
.menu-sidebar ::ng-deep .scrollable {
|
||||||
|
padding-top: nb-theme(layout-padding-top);
|
||||||
|
}
|
||||||
|
}
|
||||||
30
src/app/@theme/layouts/two-columns/two-columns.layout.ts
Normal file
30
src/app/@theme/layouts/two-columns/two-columns.layout.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ngx-two-columns-layout',
|
||||||
|
styleUrls: ['./two-columns.layout.scss'],
|
||||||
|
template: `
|
||||||
|
<nb-layout windowMode>
|
||||||
|
<nb-layout-header fixed>
|
||||||
|
<ngx-header></ngx-header>
|
||||||
|
</nb-layout-header>
|
||||||
|
|
||||||
|
<nb-sidebar class="menu-sidebar" tag="menu-sidebar" responsive>
|
||||||
|
<ng-content select="nb-menu"></ng-content>
|
||||||
|
</nb-sidebar>
|
||||||
|
|
||||||
|
<nb-layout-column class="small">
|
||||||
|
</nb-layout-column>
|
||||||
|
|
||||||
|
<nb-layout-column>
|
||||||
|
<ng-content select="router-outlet"></ng-content>
|
||||||
|
</nb-layout-column>
|
||||||
|
|
||||||
|
<nb-layout-footer fixed>
|
||||||
|
<ngx-footer></ngx-footer>
|
||||||
|
</nb-layout-footer>
|
||||||
|
|
||||||
|
</nb-layout>
|
||||||
|
`,
|
||||||
|
})
|
||||||
|
export class TwoColumnsLayoutComponent {}
|
||||||
0
src/app/@theme/pipes/.gitkeep
Normal file
0
src/app/@theme/pipes/.gitkeep
Normal file
11
src/app/@theme/pipes/capitalize.pipe.ts
Normal file
11
src/app/@theme/pipes/capitalize.pipe.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
|
|
||||||
|
@Pipe({ name: 'ngxCapitalize' })
|
||||||
|
export class CapitalizePipe implements PipeTransform {
|
||||||
|
|
||||||
|
transform(input: string): string {
|
||||||
|
return input && input.length
|
||||||
|
? (input.charAt(0).toUpperCase() + input.slice(1).toLowerCase())
|
||||||
|
: input;
|
||||||
|
}
|
||||||
|
}
|
||||||
5
src/app/@theme/pipes/index.ts
Normal file
5
src/app/@theme/pipes/index.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export * from './capitalize.pipe';
|
||||||
|
export * from './plural.pipe';
|
||||||
|
export * from './round.pipe';
|
||||||
|
export * from './timing.pipe';
|
||||||
|
export * from './number-with-commas.pipe';
|
||||||
9
src/app/@theme/pipes/number-with-commas.pipe.ts
Normal file
9
src/app/@theme/pipes/number-with-commas.pipe.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
|
|
||||||
|
@Pipe({ name: 'ngxNumberWithCommas' })
|
||||||
|
export class NumberWithCommasPipe implements PipeTransform {
|
||||||
|
|
||||||
|
transform(input: number): string {
|
||||||
|
return new Intl.NumberFormat().format(input);
|
||||||
|
}
|
||||||
|
}
|
||||||
14
src/app/@theme/pipes/plural.pipe.ts
Normal file
14
src/app/@theme/pipes/plural.pipe.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
|
|
||||||
|
@Pipe({ name: 'ngxPlural' })
|
||||||
|
export class PluralPipe implements PipeTransform {
|
||||||
|
|
||||||
|
transform(input: number, label: string, pluralLabel: string = ''): string {
|
||||||
|
input = input || 0;
|
||||||
|
return input === 1
|
||||||
|
? `${input} ${label}`
|
||||||
|
: pluralLabel
|
||||||
|
? `${input} ${pluralLabel}`
|
||||||
|
: `${input} ${label}s`;
|
||||||
|
}
|
||||||
|
}
|
||||||
9
src/app/@theme/pipes/round.pipe.ts
Normal file
9
src/app/@theme/pipes/round.pipe.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
|
|
||||||
|
@Pipe({ name: 'ngxRound' })
|
||||||
|
export class RoundPipe implements PipeTransform {
|
||||||
|
|
||||||
|
transform(input: number): number {
|
||||||
|
return Math.round(input);
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/app/@theme/pipes/timing.pipe.ts
Normal file
18
src/app/@theme/pipes/timing.pipe.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
|
|
||||||
|
@Pipe({ name: 'timing' })
|
||||||
|
export class TimingPipe implements PipeTransform {
|
||||||
|
transform(time: number): string {
|
||||||
|
if (time) {
|
||||||
|
const minutes = Math.floor(time / 60);
|
||||||
|
const seconds = Math.floor(time % 60);
|
||||||
|
return `${this.initZero(minutes)}${minutes}:${this.initZero(seconds)}${seconds}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return '00:00';
|
||||||
|
}
|
||||||
|
|
||||||
|
private initZero(time: number): string {
|
||||||
|
return time < 10 ? '0' : '';
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user