mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-02-23 08:24:07 +01:00
Remove packages uncompatible with Ivy
This commit is contained in:
parent
b60471c100
commit
bb1a759acf
14 changed files with 246 additions and 50 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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> -->
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
10
src/app/pages/tables/smart-table/smart-table.component.html
Normal file
10
src/app/pages/tables/smart-table/smart-table.component.html
Normal 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>
|
||||
70
src/app/pages/tables/smart-table/smart-table.component.ts
Normal file
70
src/app/pages/tables/smart-table/smart-table.component.ts
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
33
src/app/pages/tables/tables-routing.module.ts
Normal file
33
src/app/pages/tables/tables-routing.module.ts
Normal 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,
|
||||
];
|
||||
24
src/app/pages/tables/tables.module.ts
Normal file
24
src/app/pages/tables/tables.module.ts
Normal 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 { }
|
||||
Loading…
Add table
Add a link
Reference in a new issue