fst-ngx-view-index
v1.0.13
Published
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.15.
Downloads
28
Readme
NgxViewIndex
This library was generated with Angular CLI version 9.1.15.
Code scaffolding
Run ng generate component component-name --project NgxViewIndex
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project NgxViewIndex
.
Note: Don't forget to add
--project NgxViewIndex
or else it will be added to the default project in yourangular.json
file.
Build
Run ng build NgxViewIndex
and npm run copyStylesViewIndex
to build the project. The build artifacts will be stored in the dist/
directory.
Publishing
After building your library with ng build NgxViewIndex
, go to the dist folder cd dist/ngx-view-index
and run npm publish
.
Running unit tests
Run ng test NgxViewIndex
to execute the unit tests via Karma.
Installation
npm install fst-ngx-view-index@latest
Import the styles in your main stylesheet:
@import '../node_modules/fst-ngx-view-index/scss/ngx-view-index.component';
Angular component.ts
private sections: { value: string, name: string }[] = [];
public viewIndex: Configuration = {
graphqlService: this.mockGraphqlService,
notifiService: this.mockNotificationService,
query: 'getData',
columns: [
{ field: 'id', title: 'ID', cssClass: 'box__headline' },
{ field: 'name', title: 'Jmeno', cssClass: 'box__headline', selectList: this.sections },
],
possibilities: [
{ type: 'url', url: '/advices/edit/:id:', title: 'Editace', icon: 'icon--pencil', permission: 'edit'},
{ type: 'trash', mutation: 'deleteAdvice', title: 'Smazání', icon: 'icon--times-circle', permission: 'trash'},
],
topActions: [
{ type: 'url', url: '/settings/advices-order', title: 'Upravit pořadí', icon: 'icon--cog', permission: 'edit'},
{ type: 'url', url: '/settings/advices-sections', title: 'Spravovat sekce', icon: 'icon--bars', permission: 'edit'},
{ type: 'url', url: '/advices/edit/new', title: 'Nová položka', icon: 'icon--plus', permission: 'add'},
],
filtrations: [
{ type: 'text', field: 'q', title: 'Otázka' },
{ type: 'text', field: 'q', title: 'Odpověď' },
{ type: 'select', field: 'section', title: 'sekci', list: this.sections },
],
conditions: {},
removeTrash: true,
preloaderIndex: true,
data: [],
dataAll: [],
sortKey: 'created',
sortDirection: 'DESC',
styles: {
filtration: 'col-12',
},
};
Angular component.html
<ngx-view-index [viewIndex]="viewIndex"></ngx-view-index>
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.
Author
Fastest Solution s.r.o.