mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 15:40:11 +01:00
fix(tables): improve smart-table styles
This commit is contained in:
parent
bc536dbded
commit
0f546d950f
6 changed files with 21 additions and 74 deletions
|
|
@ -4,11 +4,13 @@ import { CommonModule } from '@angular/common';
|
|||
import { UserService } from './users.service';
|
||||
import { ElectricityService } from './electricity.service';
|
||||
import { StateService } from './state.service';
|
||||
import { SmartTableService } from './smart-table.service';
|
||||
|
||||
const SERVICES = [
|
||||
UserService,
|
||||
ElectricityService,
|
||||
StateService,
|
||||
SmartTableService,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
|
|
|||
|
|
@ -425,59 +425,7 @@ export class SmartTableService {
|
|||
'age': 16,
|
||||
}];
|
||||
|
||||
metricsTableData = [{
|
||||
image: 'app/browsers/chrome.svg',
|
||||
browser: 'Google Chrome',
|
||||
visits: '10,392',
|
||||
isVisitsUp: true,
|
||||
purchases: '4,214',
|
||||
isPurchasesUp: true,
|
||||
percent: '45%',
|
||||
isPercentUp: true,
|
||||
}, {
|
||||
image: 'app/browsers/firefox.svg',
|
||||
browser: 'Mozilla Firefox',
|
||||
visits: '7,873',
|
||||
isVisitsUp: true,
|
||||
purchases: '3,031',
|
||||
isPurchasesUp: false,
|
||||
percent: '28%',
|
||||
isPercentUp: true,
|
||||
}, {
|
||||
image: 'app/browsers/ie.svg',
|
||||
browser: 'Internet Explorer',
|
||||
visits: '5,890',
|
||||
isVisitsUp: false,
|
||||
purchases: '2,102',
|
||||
isPurchasesUp: false,
|
||||
percent: '17%',
|
||||
isPercentUp: false,
|
||||
}, {
|
||||
image: 'app/browsers/safari.svg',
|
||||
browser: 'Safari',
|
||||
visits: '4,001',
|
||||
isVisitsUp: false,
|
||||
purchases: '1,001',
|
||||
isPurchasesUp: false,
|
||||
percent: '14%',
|
||||
isPercentUp: true,
|
||||
}, {
|
||||
image: 'app/browsers/opera.svg',
|
||||
browser: 'Opera',
|
||||
visits: '1,833',
|
||||
isVisitsUp: true,
|
||||
purchases: '83',
|
||||
isPurchasesUp: true,
|
||||
percent: '5%',
|
||||
isPercentUp: false,
|
||||
}];
|
||||
|
||||
getData(): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
resolve(this.data);
|
||||
}, 2000);
|
||||
});
|
||||
getData() {
|
||||
return this.data;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
@import '../../../@theme/styles/variables';
|
||||
@import '~@akveo/nga-theme/components/card/card.component.theme';
|
||||
@import '~@akveo/nga-theme/styles/global/typography/typography';
|
||||
|
||||
@include nga-install-component() {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<nga-card>
|
||||
<nga-card-header>Smart Table</nga-card-header>
|
||||
<nga-card-body>
|
||||
<ng2-smart-table [settings]="settings" [source]="source" (deleteConfirm)="onDeleteConfirm($event)"></ng2-smart-table>
|
||||
</nga-card-body>
|
||||
</nga-card>
|
||||
</div>
|
||||
</div>
|
||||
<nga-card>
|
||||
<nga-card-header>
|
||||
Smart Table
|
||||
</nga-card-header>
|
||||
|
||||
<nga-card-body>
|
||||
<ng2-smart-table [settings]="settings" [source]="source" (deleteConfirm)="onDeleteConfirm($event)">
|
||||
</ng2-smart-table>
|
||||
</nga-card-body>
|
||||
</nga-card>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { LocalDataSource } from 'ng2-smart-table';
|
||||
|
||||
import { SmartTableService } from './smart-table.service';
|
||||
import { SmartTableService } from '../../../@core/data/smart-table.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-smart-table',
|
||||
|
|
@ -9,11 +9,9 @@ import { SmartTableService } from './smart-table.service';
|
|||
})
|
||||
export class SmartTableComponent {
|
||||
|
||||
query: string = '';
|
||||
|
||||
settings = {
|
||||
add: {
|
||||
addButtonContent: '<i class="ion-ios-plus-outline"></i>',
|
||||
addButtonContent: '<i class="ion-plus"></i>',
|
||||
createButtonContent: '<i class="ion-checkmark"></i>',
|
||||
cancelButtonContent: '<i class="ion-close"></i>',
|
||||
},
|
||||
|
|
@ -23,7 +21,7 @@ export class SmartTableComponent {
|
|||
cancelButtonContent: '<i class="ion-close"></i>',
|
||||
},
|
||||
delete: {
|
||||
deleteButtonContent: '<i class="ion-trash-a"></i>',
|
||||
deleteButtonContent: '<i class="ion-ios-trash-outline"></i>',
|
||||
confirmDelete: true,
|
||||
},
|
||||
columns: {
|
||||
|
|
@ -57,9 +55,8 @@ export class SmartTableComponent {
|
|||
source: LocalDataSource = new LocalDataSource();
|
||||
|
||||
constructor(private service: SmartTableService) {
|
||||
this.service.getData().then((data) => {
|
||||
this.source.load(data);
|
||||
});
|
||||
let data = this.service.getData();
|
||||
this.source.load(data);
|
||||
}
|
||||
|
||||
onDeleteConfirm(event): void {
|
||||
|
|
@ -69,5 +66,4 @@ export class SmartTableComponent {
|
|||
event.confirm.reject();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { Ng2SmartTableModule } from 'ng2-smart-table';
|
|||
import { SharedModule } from '../../shared.module';
|
||||
|
||||
import { TablesRoutingModule, routedComponents } from './tables-routing.module';
|
||||
import { SmartTableService } from './smart-table/smart-table.service';
|
||||
import { SmartTableService } from '../../@core/data/smart-table.service';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue