From 0123d62774599b686933d04dc136b0f95e5dcb78 Mon Sep 17 00:00:00 2001 From: Sercan Yemen Date: Sat, 29 Jul 2017 16:42:53 +0300 Subject: [PATCH] ngx-datatable --- package-lock.json | 900 ++++++++++++++++++ src/app/app.module.ts | 4 +- .../components/navigation/navigation.model.ts | 6 +- src/app/core/modules/shared.module.ts | 14 +- src/app/fuse-fake-db/contacts.ts | 355 +++++++ src/app/fuse-fake-db/fuse-fake-db.service.ts | 4 +- src/app/main/components/components.module.ts | 24 + .../datatable/ngx-datatable.component.html | 12 + .../datatable/ngx-datatable.component.scss | 3 + .../datatable/ngx-datatable.component.ts | 40 + 10 files changed, 1351 insertions(+), 11 deletions(-) create mode 100644 src/app/fuse-fake-db/contacts.ts create mode 100644 src/app/main/components/components.module.ts create mode 100644 src/app/main/components/datatable/ngx-datatable.component.html create mode 100644 src/app/main/components/datatable/ngx-datatable.component.scss create mode 100644 src/app/main/components/datatable/ngx-datatable.component.ts diff --git a/package-lock.json b/package-lock.json index 0cd9b2b7..53e4efb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1201,6 +1201,7 @@ "requires": { "anymatch": "1.3.0", "async-each": "1.0.1", + "fsevents": "1.1.2", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -2930,6 +2931,905 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "fsevents": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", + "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", + "dev": true, + "optional": true, + "requires": { + "nan": "2.6.2", + "node-pre-gyp": "0.6.36" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.2.9" + } + }, + "asn1": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true, + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.7", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "caseless": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true, + "dev": true, + "optional": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "bundled": true, + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.4", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "bundled": true, + "dev": true + }, + "mime-types": { + "version": "2.1.15", + "bundled": true, + "dev": true, + "requires": { + "mime-db": "1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.36", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.0", + "osenv": "0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true, + "dev": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "bundled": true, + "dev": true, + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" + } + }, + "rimraf": { + "version": "2.6.1", + "bundled": true, + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.0.1", + "bundled": true, + "dev": true + }, + "semver": { + "version": "5.3.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "stringstream": { + "version": "0.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, + "dev": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "dev": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "uuid": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + } + } + }, "fstream": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 8b38b961..1d2a67b0 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -20,6 +20,7 @@ import { InMemoryWebApiModule } from 'angular-in-memory-web-api'; import { FuseFakeDbService } from './fuse-fake-db/fuse-fake-db.service'; import { PagesModule } from './main/pages/pages.module'; import { UIModule } from './main/ui/ui.module'; +import { ComponentsModule } from './main/components/components.module'; const PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { suppressScrollX: true @@ -70,7 +71,8 @@ const appRoutes: Routes = [ ProjectModule, PagesModule, - UIModule + UIModule, + ComponentsModule ], providers : [ FuseNavigationService, diff --git a/src/app/core/components/navigation/navigation.model.ts b/src/app/core/components/navigation/navigation.model.ts index 4e2ae775..1ec6d6ee 100644 --- a/src/app/core/components/navigation/navigation.model.ts +++ b/src/app/core/components/navigation/navigation.model.ts @@ -352,14 +352,14 @@ export class FuseNavigation 'type' : 'subheader' }, { - 'title' : 'Datatable', + 'title' : 'Datatables', 'type' : 'nav-collapse', 'icon' : 'border_all', 'children': [ { - 'title': 'Smart Table', + 'title': 'ngx-datatable', 'type' : 'nav-item', - 'url' : '/component/tables/smart-table' + 'url' : '/components/datatables/ngx-datatable' } ] }, diff --git a/src/app/core/modules/shared.module.ts b/src/app/core/modules/shared.module.ts index 0e00301d..bfcbacd8 100644 --- a/src/app/core/modules/shared.module.ts +++ b/src/app/core/modules/shared.module.ts @@ -5,7 +5,6 @@ import { CommonModule } from '@angular/common'; import { MaterialModule } from './material.module'; import { FlexLayoutModule } from '@angular/flex-layout'; -import { NgxDatatableModule } from '@swimlane/ngx-datatable'; import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar'; import { @@ -17,6 +16,7 @@ import { ColorPickerModule } from 'ngx-color-picker'; import { FuseConfirmDialogComponent } from '../components/confirm-dialog/confirm-dialog.component'; import { NgxDnDModule } from '@swimlane/ngx-dnd'; import { FuseCountdownComponent } from '../components/countdown/countdown.component'; +import { NgxDatatableModule } from '@swimlane/ngx-datatable'; @NgModule({ declarations : [ @@ -28,19 +28,18 @@ import { FuseCountdownComponent } from '../components/countdown/countdown.compon imports : [ FlexLayoutModule, MaterialModule, - NgxDatatableModule, CommonModule, FormsModule, FusePipesModule, PerfectScrollbarModule, ReactiveFormsModule, ColorPickerModule, - NgxDnDModule + NgxDnDModule, + NgxDatatableModule ], exports : [ FlexLayoutModule, MaterialModule, - NgxDatatableModule, CommonModule, FormsModule, FuseMdSidenavHelperDirective, @@ -50,9 +49,12 @@ import { FuseCountdownComponent } from '../components/countdown/countdown.compon ReactiveFormsModule, ColorPickerModule, NgxDnDModule, - FuseCountdownComponent + FuseCountdownComponent, + NgxDatatableModule ], - entryComponents: [FuseConfirmDialogComponent] + entryComponents: [ + FuseConfirmDialogComponent + ] }) export class SharedModule diff --git a/src/app/fuse-fake-db/contacts.ts b/src/app/fuse-fake-db/contacts.ts new file mode 100644 index 00000000..caa222d8 --- /dev/null +++ b/src/app/fuse-fake-db/contacts.ts @@ -0,0 +1,355 @@ +export class ContactsFakeDb +{ + public static contacts = [ + { + 'id' : '5725a680b3249760ea21de52', + 'name' : 'Abbott', + 'lastName': 'Keitch', + 'avatar' : 'assets/images/avatars/Abbott.jpg', + 'nickname': 'Royalguard', + 'company' : 'Saois', + 'jobTitle': 'Digital Archivist', + 'email' : 'abbott@withinpixels.com', + 'phone' : '+1-202-555-0175', + 'address' : '933 8th Street Stamford, CT 06902', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a680606588342058356d', + 'name' : 'Arnold', + 'lastName': 'Matlock', + 'avatar' : 'assets/images/avatars/Arnold.jpg', + 'nickname': 'Wanderer', + 'company' : 'Laotcone', + 'jobTitle': 'Graphic Artist', + 'email' : 'arnold@withinpixels.com', + 'phone' : '+1-202-555-0141', + 'address' : '906 Valley Road Michigan City, IN 46360', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a68009e20d0a9e9acf2a', + 'name' : 'Barrera', + 'lastName': 'Bradbury', + 'avatar' : 'assets/images/avatars/Barrera.jpg', + 'nickname': 'Jackal', + 'company' : 'Unizim', + 'jobTitle': 'Graphic Designer', + 'email' : 'barrera@withinpixels.com', + 'phone' : '+1-202-555-0196', + 'address' : '183 River Street Passaic, NJ 07055', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a6809fdd915739187ed5', + 'name' : 'Blair', + 'lastName': 'Strangeway', + 'avatar' : 'assets/images/avatars/Blair.jpg', + 'nickname': 'Knight', + 'company' : 'Conedubdax', + 'jobTitle': 'Visual Designer', + 'email' : 'blair@withinpixels.com', + 'phone' : '+1-202-555-0118', + 'address' : '143 Jones Street Eau Claire, WI 54701', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a68007920cf75051da64', + 'name' : 'Boyle', + 'lastName': 'Winters', + 'avatar' : 'assets/images/avatars/Boyle.jpg', + 'nickname': 'Jester', + 'company' : 'Newo', + 'jobTitle': 'Catalogue Illustrator', + 'email' : 'boyle@withinpixels.com', + 'phone' : '+1-202-555-0177', + 'address' : '218 Pearl Street Brandon, FL 33510', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a68031fdbb1db2c1af47', + 'name' : 'Christy', + 'lastName': 'Camacho', + 'avatar' : 'assets/images/avatars/Christy.jpg', + 'nickname': 'Mist', + 'company' : 'uniway', + 'jobTitle': '3D Animator', + 'email' : 'christy@withinpixels.com', + 'phone' : '+1-202-555-0136', + 'address' : '329 Bridge Street Desoto, TX 75115', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a680bc670af746c435e2', + 'name' : 'Copeland', + 'lastName': 'Redcliff', + 'avatar' : 'assets/images/avatars/Copeland.jpg', + 'nickname': 'Cloudlaw', + 'company' : 'Tempron', + 'jobTitle': 'Multimedia Artist', + 'email' : 'copeland@withinpixels.com', + 'phone' : '+1-202-555-0107', + 'address' : '956 6th Avenue North Bergen, NJ 0704', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a680e7eb988a58ddf303', + 'name' : 'Estes', + 'lastName': 'Stevens', + 'avatar' : 'assets/images/avatars/Estes.jpg', + 'nickname': 'Roamer', + 'company' : 'nam-dex', + 'jobTitle': 'Special Effects Artist', + 'email' : 'estes@withinpixels.com', + 'phone' : '+1-202-555-0113', + 'address' : '664 York Street Cambridge, MA 02138', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a680dcb077889f758961', + 'name' : 'Harper', + 'lastName': 'MacGuffin', + 'avatar' : 'assets/images/avatars/Harper.jpg', + 'nickname': 'Tempest', + 'company' : 'runcane', + 'jobTitle': 'Application Developer', + 'email' : 'harper@withinpixels.com', + 'phone' : '+1-202-555-0173', + 'address' : '738 Route 11 Cornelius, NC 28031', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a6806acf030f9341e925', + 'name' : 'Helen', + 'lastName': 'Sheridan', + 'avatar' : 'assets/images/avatars/Helen.jpg', + 'nickname': 'Magicbattler', + 'company' : 'Subhow', + 'jobTitle': 'Content Developer', + 'email' : 'helen@withinpixels.com', + 'phone' : '+1-202-555-0163', + 'address' : '194 Washington Avenue Saint Petersburg, FL 33702', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a680ae1ae9a3c960d487', + 'name' : 'Henderson', + 'lastName': 'Cambias', + 'avatar' : 'assets/images/avatars/Henderson.jpg', + 'nickname': 'Blizzard', + 'company' : 'Howcom', + 'jobTitle': 'Web Designer', + 'email' : 'henderson@withinpixels.com', + 'phone' : '+1-202-555-0151', + 'address' : '686 Roosevelt Avenue Oviedo, FL 32765', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a680b8d240c011dd224b', + 'name' : 'Josefina', + 'lastName': 'Lakefield', + 'avatar' : 'assets/images/avatars/Josefina.jpg', + 'nickname': 'Violet', + 'company' : 'Gecko', + 'jobTitle': 'Web Developer', + 'email' : 'josefina@withinpixels.com', + 'phone' : '+1-202-555-0160', + 'address' : '202 Hartford Road Lynchburg, VA 24502', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a68034cb3968e1f79eac', + 'name' : 'Katina', + 'lastName': 'Bletchley', + 'avatar' : 'assets/images/avatars/Katina.jpg', + 'nickname': 'Rose', + 'company' : 'Lexicom', + 'jobTitle': 'Software Designer', + 'email' : 'katina@withinpixels.com', + 'phone' : '+1-202-555-0186', + 'address' : '219 Woodland Road Valrico, FL 33594', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a6801146cce777df2a08', + 'name' : 'Lily', + 'lastName': 'Peasegood', + 'avatar' : 'assets/images/avatars/Lily.jpg', + 'nickname': 'Star', + 'company' : 'zooflex', + 'jobTitle': 'Software Specialist', + 'email' : 'lily@withinpixels.com', + 'phone' : '+1-202-555-0115', + 'address' : '305 Willow Drive Superior, WI 54880', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a6808a178bfd034d6ecf', + 'name' : 'Mai', + 'lastName': 'Nox', + 'avatar' : 'assets/images/avatars/Mai.jpg', + 'nickname': 'Violetmage', + 'company' : 'quadzone', + 'jobTitle': 'Software Engineer', + 'email' : 'mai@withinpixels.com', + 'phone' : '+1-202-555-0199', + 'address' : '148 Heather Lane Mcminnville, TN 37110', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a680653c265f5c79b5a9', + 'name' : 'Nancy', + 'lastName': 'Jaggers', + 'avatar' : 'assets/images/avatars/Nancy.jpg', + 'nickname': 'Silverwarden', + 'company' : 'Opetamnix', + 'jobTitle': 'Software Architect', + 'email' : 'nancy@withinpixels.com', + 'phone' : '+1-202-555-0120', + 'address' : '345 Laurel Lane Union City, NJ 07087', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a680bbcec3cc32a8488a', + 'name' : 'Nora', + 'lastName': 'Franklin', + 'avatar' : 'assets/images/avatars/Nora.jpg', + 'nickname': 'Katanachanter', + 'company' : 'Saoway', + 'jobTitle': 'Database Coordinator', + 'email' : 'nora@withinpixels.com', + 'phone' : '+1-202-555-0172', + 'address' : '572 Rose Street Summerfield, FL 34491', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a6803d87f1b77e17b62b', + 'name' : 'Odessa', + 'lastName': 'Goodman', + 'avatar' : 'assets/images/avatars/Odessa.jpg', + 'nickname': 'Rose', + 'company' : 'transace', + 'jobTitle': 'Database Administration Manager', + 'email' : 'odessa@withinpixels.com', + 'phone' : '+1-202-555-0190', + 'address' : '527 Jefferson Court Conyers, GA 30012', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a680e87cb319bd9bd673', + 'name' : 'Reyna', + 'lastName': 'Preece', + 'avatar' : 'assets/images/avatars/Reyna.jpg', + 'nickname': 'Holydawn', + 'company' : 'Dingex', + 'jobTitle': 'Data Processing Planner', + 'email' : 'reyna@withinpixels.com', + 'phone' : '+1-202-555-0116', + 'address' : '297 Strawberry Lane Faribault, MN 55021', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a6802d10e277a0f35775', + 'name' : 'Shauna', + 'lastName': 'Atherton', + 'avatar' : 'assets/images/avatars/Shauna.jpg', + 'nickname': 'Faunasoul', + 'company' : 'Vivaflex', + 'jobTitle': 'Art Director', + 'email' : 'shauna@withinpixels.com', + 'phone' : '+1-202-555-0159', + 'address' : '928 Canterbury Court Pittsburgh, PA 15206', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a680aef1e5cf26dd3d1f', + 'name' : 'Shepard', + 'lastName': 'Rosco', + 'avatar' : 'assets/images/avatars/Shepard.jpg', + 'nickname': 'Fireking', + 'company' : 'Goldenla', + 'jobTitle': 'Magazine Designer', + 'email' : 'shepard@withinpixels.com', + 'phone' : '+1-202-555-0173', + 'address' : '904 Ridge Road Pickerington, OH 43147', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a680cd7efa56a45aea5d', + 'name' : 'Tillman', + 'lastName': 'Lee', + 'avatar' : 'assets/images/avatars/Tillman.jpg', + 'nickname': 'Gust', + 'company' : 'K-techno', + 'jobTitle': 'News Photographer', + 'email' : 'tillman@withinpixels.com', + 'phone' : '+1-202-555-0183', + 'address' : '447 Charles Street Dorchester, MA 02125', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a680fb65c91a82cb35e2', + 'name' : 'Trevino', + 'lastName': 'Bush', + 'avatar' : 'assets/images/avatars/Trevino.jpg', + 'nickname': 'Wolf', + 'company' : 'Dalthex', + 'jobTitle': 'Photojournalist', + 'email' : 'trevino@withinpixels.com', + 'phone' : '+1-202-555-0138', + 'address' : '84 Valley View Road Norman, OK 73072', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a68018c663044be49cbf', + 'name' : 'Tyson', + 'lastName': 'Marshall', + 'avatar' : 'assets/images/avatars/Tyson.jpg', + 'nickname': 'Honordread', + 'company' : 'Geocon', + 'jobTitle': 'Manuscript Editor', + 'email' : 'tyson@withinpixels.com', + 'phone' : '+1-202-555-0146', + 'address' : '204 Clark Street Monsey, NY 10952', + 'birthday': null, + 'notes' : '' + }, + { + 'id' : '5725a6809413bf8a0a5272b1', + 'name' : 'Velazquez', + 'lastName': 'Smethley', + 'avatar' : 'assets/images/avatars/Velazquez.jpg', + 'nickname': 'Strifedream', + 'company' : 'ranex', + 'jobTitle': 'Publications Editor', + 'email' : 'velezquez@withinpixels.com', + 'phone' : '+1-202-555-0146', + 'address' : '261 Cleveland Street Riverside, NJ 08075', + 'birthday': null, + 'notes' : '' + } + ]; +} diff --git a/src/app/fuse-fake-db/fuse-fake-db.service.ts b/src/app/fuse-fake-db/fuse-fake-db.service.ts index 2080070f..60efff5d 100644 --- a/src/app/fuse-fake-db/fuse-fake-db.service.ts +++ b/src/app/fuse-fake-db/fuse-fake-db.service.ts @@ -5,6 +5,7 @@ import { ChatFakeDb } from './chat'; import { CalendarFakeDb } from './calendar'; import { TodoFakeDb } from './todo'; import { ProfileFakeDb } from './profile'; +import { ContactsFakeDb } from './contacts'; export class FuseFakeDbService implements InMemoryDbService { @@ -24,7 +25,8 @@ export class FuseFakeDbService implements InMemoryDbService 'todo-tags' : TodoFakeDb.tags, 'profile-timeline' : ProfileFakeDb.timeline, 'profile-photos-videos': ProfileFakeDb.photosVideos, - 'profile-about' : ProfileFakeDb.about + 'profile-about' : ProfileFakeDb.about, + 'contacts' : ContactsFakeDb.contacts }; } } diff --git a/src/app/main/components/components.module.ts b/src/app/main/components/components.module.ts new file mode 100644 index 00000000..304aec20 --- /dev/null +++ b/src/app/main/components/components.module.ts @@ -0,0 +1,24 @@ +import { NgModule } from '@angular/core'; +import { SharedModule } from '../../core/modules/shared.module'; +import { RouterModule } from '@angular/router'; +import { NgxDatatableComponent } from './datatable/ngx-datatable.component'; + +const routes = [ + { + path : 'components/datatables/ngx-datatable', + component: NgxDatatableComponent + } +]; + +@NgModule({ + imports : [ + SharedModule, + RouterModule.forChild(routes) + ], + declarations: [ + NgxDatatableComponent + ] +}) +export class ComponentsModule +{ +} diff --git a/src/app/main/components/datatable/ngx-datatable.component.html b/src/app/main/components/datatable/ngx-datatable.component.html new file mode 100644 index 00000000..9ba4178f --- /dev/null +++ b/src/app/main/components/datatable/ngx-datatable.component.html @@ -0,0 +1,12 @@ + + \ No newline at end of file diff --git a/src/app/main/components/datatable/ngx-datatable.component.scss b/src/app/main/components/datatable/ngx-datatable.component.scss new file mode 100644 index 00000000..8fdbe2d4 --- /dev/null +++ b/src/app/main/components/datatable/ngx-datatable.component.scss @@ -0,0 +1,3 @@ +:host { + +} \ No newline at end of file diff --git a/src/app/main/components/datatable/ngx-datatable.component.ts b/src/app/main/components/datatable/ngx-datatable.component.ts new file mode 100644 index 00000000..9049e13b --- /dev/null +++ b/src/app/main/components/datatable/ngx-datatable.component.ts @@ -0,0 +1,40 @@ +import { Component, OnInit } from '@angular/core'; +import { Http } from '@angular/http'; + +@Component({ + selector : 'fuse-ngx-datatable', + templateUrl: './ngx-datatable.component.html', + styleUrls : ['./ngx-datatable.component.scss'] +}) +export class NgxDatatableComponent implements OnInit +{ + rows: any[]; + loadingIndicator = true; + reorderable = true; + + columns = [ + { + prop: 'name' + }, + { + prop: 'lastName' + }, + { + prop: 'company' + } + ]; + + constructor(private http: Http) + { + + } + + ngOnInit() + { + this.http.get('api/contacts') + .subscribe(contacts => { + this.rows = contacts.json().data; + this.loadingIndicator = false; + }); + } +}