diff --git a/package-lock.json b/package-lock.json index a4db9111..74edde97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,11 +4,6 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@agm/core": { - "version": "1.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@agm/core/-/core-1.0.0-beta.5.tgz", - "integrity": "sha512-LVENJqtBZEWpX+uJkGI0zgg+Xkm2KkktQm4ojZozArbeNvQkVL6pqVc04Mme6vvOzwJpD1cET5w4byC8Xaq1QQ==" - }, "@angular-devkit/architect": { "version": "0.900.4", "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.900.4.tgz", diff --git a/package.json b/package.json index 027d62f8..776ab8a3 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "postinstall": "ngcc --properties es2015 es5 browser module main --first-only --create-ivy-entry-points" }, "dependencies": { - "@agm/core": "^1.0.0-beta.5", "@angular/animations": "^9.0.4", "@angular/cdk": "^8.0.0", "@angular/common": "^9.0.4", @@ -60,8 +59,6 @@ "leaflet": "1.2.0", "nebular-icons": "1.1.0", "ng2-ckeditor": "^1.2.2", - "ng2-completer": "3.0.3", - "ng2-smart-table": "1.5.0", "ngx-echarts": "^4.2.2", "node-sass": "^4.12.0", "normalize.css": "6.0.0", diff --git a/src/app/@core/core.module.ts b/src/app/@core/core.module.ts index 1135104a..a4592cce 100644 --- a/src/app/@core/core.module.ts +++ b/src/app/@core/core.module.ts @@ -153,6 +153,9 @@ export const NB_CORE_PROVIDERS = [ NbAuthModule, ], declarations: [], + providers: [ + ...NB_CORE_PROVIDERS + ] }) export class CoreModule { constructor(@Optional() @SkipSelf() parentModule: CoreModule) { @@ -160,7 +163,7 @@ export class CoreModule { } static forRoot(): ModuleWithProviders { - return { + return { ngModule: CoreModule, providers: [ ...NB_CORE_PROVIDERS, diff --git a/src/app/@core/mock/mock-data.module.ts b/src/app/@core/mock/mock-data.module.ts index 2d8c652e..6f9f2785 100644 --- a/src/app/@core/mock/mock-data.module.ts +++ b/src/app/@core/mock/mock-data.module.ts @@ -2,9 +2,47 @@ 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({ @@ -17,7 +55,7 @@ const SERVICES = [ }) export class MockDataModule { static forRoot(): ModuleWithProviders { - return { + return { ngModule: MockDataModule, providers: [ ...SERVICES, diff --git a/src/app/@theme/theme.module.ts b/src/app/@theme/theme.module.ts index cabc16fc..afacd352 100644 --- a/src/app/@theme/theme.module.ts +++ b/src/app/@theme/theme.module.ts @@ -19,9 +19,8 @@ import { NbSecurityModule } from '@nebular/security'; import { FooterComponent, HeaderComponent, - LayoutDirectionSwitcherComponent, SearchInputComponent, - SwitcherComponent, + TinyMCEComponent, } from './components'; import { CapitalizePipe, @@ -39,8 +38,6 @@ import { DEFAULT_THEME } from './styles/theme.default'; import { COSMIC_THEME } from './styles/theme.cosmic'; import { CORPORATE_THEME } from './styles/theme.corporate'; import { DARK_THEME } from './styles/theme.dark'; -import { MATERIAL_LIGHT_THEME } from './styles/theme.material-light'; -import { MATERIAL_DARK_THEME } from './styles/theme.material-dark'; const NB_MODULES = [ NbLayoutModule, @@ -57,11 +54,10 @@ const NB_MODULES = [ NbEvaIconsModule, ]; const COMPONENTS = [ - SwitcherComponent, - LayoutDirectionSwitcherComponent, HeaderComponent, FooterComponent, SearchInputComponent, + TinyMCEComponent, OneColumnLayoutComponent, ThreeColumnsLayoutComponent, TwoColumnsLayoutComponent, @@ -78,17 +74,25 @@ const PIPES = [ imports: [CommonModule, ...NB_MODULES], exports: [CommonModule, ...PIPES, ...COMPONENTS], declarations: [...COMPONENTS, ...PIPES], + providers: [ + ...NbThemeModule.forRoot( + { + name: 'default', + }, + [ DEFAULT_THEME, COSMIC_THEME, CORPORATE_THEME, DARK_THEME ], + ).providers, + ] }) export class ThemeModule { static forRoot(): ModuleWithProviders { - return { + return { ngModule: ThemeModule, providers: [ ...NbThemeModule.forRoot( { name: 'default', }, - [ DEFAULT_THEME, COSMIC_THEME, CORPORATE_THEME, DARK_THEME, MATERIAL_LIGHT_THEME, MATERIAL_DARK_THEME ], + [ DEFAULT_THEME, COSMIC_THEME, CORPORATE_THEME, DARK_THEME ], ).providers, ], }; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index d55f48ee..9db704c4 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -37,8 +37,8 @@ import { NbChatModule.forRoot({ messageGoogleMapKey: 'AIzaSyA_wNuCzia92MAmdLRzmqitRGvCF7wCZPY', }), - CoreModule.forRoot(), - ThemeModule.forRoot(), + CoreModule, + ThemeModule, ], bootstrap: [AppComponent], }) diff --git a/src/app/pages/maps/gmaps/gmaps.component.ts b/src/app/pages/maps/gmaps/gmaps.component.ts index a186733d..2271e76c 100644 --- a/src/app/pages/maps/gmaps/gmaps.component.ts +++ b/src/app/pages/maps/gmaps/gmaps.component.ts @@ -3,8 +3,19 @@ import { Component } from '@angular/core'; @Component({ selector: 'ngx-gmaps', styleUrls: ['./gmaps.component.scss'], - templateUrl: './gmaps.component.html', + template: ` + + Google Maps + + + + + `, }) export class GmapsComponent { - readonly position = { lat: 51.678418, lng: 7.809007 }; + + lat = 51.678418; + lng = 7.809007; } diff --git a/src/app/pages/maps/maps.module.ts b/src/app/pages/maps/maps.module.ts index de12b689..c33446e0 100644 --- a/src/app/pages/maps/maps.module.ts +++ b/src/app/pages/maps/maps.module.ts @@ -1,5 +1,5 @@ import { NgModule } from '@angular/core'; -import { GoogleMapsModule } from '@angular/google-maps'; +// import { AgmCoreModule } from '@agm/core'; import { LeafletModule } from '@asymmetrik/ngx-leaflet'; import { NgxEchartsModule } from 'ngx-echarts'; import { NbCardModule } from '@nebular/theme'; @@ -10,7 +10,10 @@ import { MapsRoutingModule, routedComponents } from './maps-routing.module'; @NgModule({ imports: [ ThemeModule, - GoogleMapsModule, + // AgmCoreModule.forRoot({ + // apiKey: 'AIzaSyCpVhQiwAllg1RAFaxMWSpQruuGARy0Y1k', + // libraries: ['places'], + // }), LeafletModule.forRoot(), MapsRoutingModule, NgxEchartsModule, diff --git a/src/app/pages/maps/search-map/map/map.component.html b/src/app/pages/maps/search-map/map/map.component.html index 04331a29..c5f827e6 100644 --- a/src/app/pages/maps/search-map/map/map.component.html +++ b/src/app/pages/maps/search-map/map/map.component.html @@ -1,3 +1,7 @@ - - - \ No newline at end of file + diff --git a/src/app/pages/maps/search-map/search/search.component.ts b/src/app/pages/maps/search-map/search/search.component.ts index 5cb325ca..dca89a4d 100644 --- a/src/app/pages/maps/search-map/search/search.component.ts +++ b/src/app/pages/maps/search-map/search/search.component.ts @@ -1,5 +1,7 @@ import { Component, ElementRef, EventEmitter, NgZone, OnInit, Output, ViewChild } from '@angular/core'; -import { PositionModel } from '../entity/position.model'; +// import { MapsAPILoader } from '@agm/core'; +import { Location } from '../entity/Location'; + @Component({ selector: 'ngx-search', @@ -7,34 +9,36 @@ import { PositionModel } from '../entity/position.model'; }) export class SearchComponent implements OnInit { - @Output() - positionChanged: EventEmitter = new EventEmitter(); + @Output() positionChanged = new EventEmitter(); @ViewChild('search', { static: true }) - searchElementRef: ElementRef; + public searchElementRef: ElementRef; - constructor(private ngZone: NgZone) {} + constructor(// private mapsAPILoader: MapsAPILoader, + private ngZone: NgZone) { + } ngOnInit() { - const autocomplete = new google.maps.places.Autocomplete( - this.searchElementRef.nativeElement, { types: ['address'] }, - ); + // load Places Autocomplete + // this.mapsAPILoader.load().then(() => { + // const autocomplete = new google.maps.places.Autocomplete(this.searchElementRef.nativeElement, { + // types: ['address'], + // }); + // autocomplete.addListener('place_changed', () => { + // this.ngZone.run(() => { + // // get the place result + // const place: google.maps.places.PlaceResult = autocomplete.getPlace(); - autocomplete.addListener('place_changed', () => { - this.ngZone.run(() => { - // get the place result - const place: google.maps.places.PlaceResult = autocomplete.getPlace(); + // // verify result + // if (place.geometry === undefined || place.geometry === null) { + // return; + // } - // verify result - if (place.geometry === undefined || place.geometry === null) { - return; - } - - this.positionChanged.emit(new PositionModel( - place.geometry.location.lat(), - place.geometry.location.lng(), - )); - }); - }); + // this.positionChanged.emit( + // new Location(place.geometry.location.lat(), + // place.geometry.location.lng())); + // }); + // }); + // }); } } diff --git a/src/app/pages/tables/smart-table/smart-table.component.html b/src/app/pages/tables/smart-table/smart-table.component.html new file mode 100644 index 00000000..8522c1b9 --- /dev/null +++ b/src/app/pages/tables/smart-table/smart-table.component.html @@ -0,0 +1,10 @@ + + + Smart Table + + + + + + diff --git a/src/app/pages/tables/smart-table/smart-table.component.ts b/src/app/pages/tables/smart-table/smart-table.component.ts new file mode 100644 index 00000000..d14f8d17 --- /dev/null +++ b/src/app/pages/tables/smart-table/smart-table.component.ts @@ -0,0 +1,70 @@ +import { Component } from '@angular/core'; +// import { LocalDataSource } from 'ng2-smart-table'; + +import { SmartTableData } from '../../../@core/data/smart-table'; + +@Component({ + selector: 'ngx-smart-table', + templateUrl: './smart-table.component.html', + styleUrls: ['./smart-table.component.scss'], +}) +export class SmartTableComponent { + + settings = { + add: { + addButtonContent: '', + createButtonContent: '', + cancelButtonContent: '', + }, + edit: { + editButtonContent: '', + saveButtonContent: '', + cancelButtonContent: '', + }, + delete: { + deleteButtonContent: '', + confirmDelete: true, + }, + columns: { + id: { + title: 'ID', + type: 'number', + }, + firstName: { + title: 'First Name', + type: 'string', + }, + lastName: { + title: 'Last Name', + type: 'string', + }, + username: { + title: 'Username', + type: 'string', + }, + email: { + title: 'E-mail', + type: 'string', + }, + age: { + title: 'Age', + type: 'number', + }, + }, + }; + + // source: LocalDataSource = new LocalDataSource(); + + constructor(private service: SmartTableData) { + // const data = this.service.getData(); + // this.source.load(data); + } + + onDeleteConfirm(event): void { + if (window.confirm('Are you sure you want to delete?')) { + event.confirm.resolve(); + } else { + event.confirm.reject(); + } + } +} diff --git a/src/app/pages/tables/tables-routing.module.ts b/src/app/pages/tables/tables-routing.module.ts new file mode 100644 index 00000000..dd0725e1 --- /dev/null +++ b/src/app/pages/tables/tables-routing.module.ts @@ -0,0 +1,33 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { TablesComponent } from './tables.component'; +// import { SmartTableComponent } from './smart-table/smart-table.component'; +import { TreeGridComponent } from './tree-grid/tree-grid.component'; + +const routes: Routes = [{ + path: '', + component: TablesComponent, + children: [ + // { + // path: 'smart-table', + // component: SmartTableComponent, + // }, + { + path: 'tree-grid', + component: TreeGridComponent, + }, + ], +}]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class TablesRoutingModule { } + +export const routedComponents = [ + TablesComponent, + // SmartTableComponent, + TreeGridComponent, +]; diff --git a/src/app/pages/tables/tables.module.ts b/src/app/pages/tables/tables.module.ts new file mode 100644 index 00000000..7c4a5ad8 --- /dev/null +++ b/src/app/pages/tables/tables.module.ts @@ -0,0 +1,24 @@ +import { NgModule } from '@angular/core'; +import { NbCardModule, NbIconModule, NbInputModule, NbTreeGridModule } from '@nebular/theme'; +// import { Ng2SmartTableModule } from 'ng2-smart-table'; + +import { ThemeModule } from '../../@theme/theme.module'; +import { TablesRoutingModule, routedComponents } from './tables-routing.module'; +import { FsIconComponent } from './tree-grid/tree-grid.component'; + +@NgModule({ + imports: [ + NbCardModule, + NbTreeGridModule, + NbIconModule, + NbInputModule, + ThemeModule, + TablesRoutingModule, + // Ng2SmartTableModule, + ], + declarations: [ + ...routedComponents, + FsIconComponent, + ], +}) +export class TablesModule { }