Remove packages uncompatible with Ivy

This commit is contained in:
eugene-sinitsyn 2020-03-03 11:52:57 +03:00 committed by Maksim Karatkevich
parent b60471c100
commit bb1a759acf
14 changed files with 246 additions and 50 deletions

5
package-lock.json generated
View file

@ -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",

View file

@ -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",

View file

@ -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<CoreModule> {
return {
return <ModuleWithProviders>{
ngModule: CoreModule,
providers: [
...NB_CORE_PROVIDERS,

View file

@ -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<MockDataModule> {
return {
return <ModuleWithProviders>{
ngModule: MockDataModule,
providers: [
...SERVICES,

View file

@ -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<ThemeModule> {
return {
return <ModuleWithProviders>{
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,
],
};

View file

@ -37,8 +37,8 @@ import {
NbChatModule.forRoot({
messageGoogleMapKey: 'AIzaSyA_wNuCzia92MAmdLRzmqitRGvCF7wCZPY',
}),
CoreModule.forRoot(),
ThemeModule.forRoot(),
CoreModule,
ThemeModule,
],
bootstrap: [AppComponent],
})

View file

@ -3,8 +3,19 @@ import { Component } from '@angular/core';
@Component({
selector: 'ngx-gmaps',
styleUrls: ['./gmaps.component.scss'],
templateUrl: './gmaps.component.html',
template: `
<nb-card>
<nb-card-header>Google Maps</nb-card-header>
<nb-card-body>
<!-- <agm-map [latitude]="lat" [longitude]="lng">
<agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
</agm-map> -->
</nb-card-body>
</nb-card>
`,
})
export class GmapsComponent {
readonly position = { lat: 51.678418, lng: 7.809007 };
lat = 51.678418;
lng = 7.809007;
}

View file

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

View file

@ -1,3 +1,7 @@
<google-map [center]="position" [zoom]="zoom" width="100%" height="36.5625rem">
<map-marker [position]="position"></map-marker>
</google-map>
<!-- <agm-map [latitude]="latitude"
[longitude]="longitude"
[scrollwheel]="false"
[zoom]="zoom">
<agm-marker [latitude]="latitude"
[longitude]="longitude"></agm-marker>
</agm-map> -->

View file

@ -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<PositionModel> = new EventEmitter<PositionModel>();
@Output() positionChanged = new EventEmitter<Location>();
@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()));
// });
// });
// });
}
}

View file

@ -0,0 +1,10 @@
<nb-card>
<nb-card-header>
Smart Table
</nb-card-header>
<nb-card-body>
<!-- <ng2-smart-table [settings]="settings" [source]="source" (deleteConfirm)="onDeleteConfirm($event)">
</ng2-smart-table> -->
</nb-card-body>
</nb-card>

View file

@ -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: '<i class="nb-plus"></i>',
createButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
},
edit: {
editButtonContent: '<i class="nb-edit"></i>',
saveButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
},
delete: {
deleteButtonContent: '<i class="nb-trash"></i>',
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();
}
}
}

View file

@ -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,
];

View file

@ -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 { }