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

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