1.4.7 • Published 11 months ago

guachos-datatable v1.4.7

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

Guachos Datatable

Guachos Datatable es una librería para angular para manejar datos en una tabla genérica, capaz de manejar plantillas y acciones customizadas.

Instalación

Con npm

npm i @guachos/datatable --save

Con yarn

yarn add @guachos/datatable

Con pnpm

pnpm add @guachos/datatable

Importar las dependencias en tu proyecto.

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { MatIconModule } from "@angular/material/icon";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { TranslateLoader, TranslateModule } from "@ngx-translate/core";
import { HttpClient, HttpClientModule } from "@angular/common/http";
import { TranslateHttpLoader } from "@ngx-translate/http-loader";

import { GuajiritosDatatable } from "@guajiritos/data-table";

export function HttpLoaderFactory(http: HttpClient) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}

BrowserModule,
  HttpClientModule,
  BrowserAnimationsModule,
  TranslateModule.forRoot({
    loader: {
      provide: TranslateLoader,
      useFactory: HttpLoaderFactory,
      deps: [HttpClient]
    }
  }),
  GuachosDatatableModule,
  MatIconModule
],
providers: [],
  bootstrap
:
[AppComponent]
})

Uso de la librería

<guachos-data-table
    (add)="onAdd()"
    (delete)="onDelete($event)"
    (detail)="onEdit($event)"
    (edit)="onEdit($event)"
    *ngIf="dataTableOption"
    [options]="dataTableOption"
    [refresh]="refreshData"
></guachos-data-table>
import { AfterViewInit, ChangeDetectorRef, Component } from '@angular/core';

import {
  ButtonMode,
  ColumnFilterOptionsType,
  ColumnOptionsType,
  DataTableOptions,
  DisplayOptionItemType,
  MaterialColor
} from "@guajiritos/data-table";


@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements AfterViewInit {
  constructor(
    private _cdRef: ChangeDetectorRef
  ) {
  }

  private url: string = 'https://www.guajiritos.cu/'

  public dataTableOption: DataTableOptions;

  public onAdd(): void {
  ...
  }

  public onDelete(element: any): void {
  ...
  }

  public onEdit(element: any): void {
  ...
  }

  ngAfterViewInit(): void {
    this.dataTableOption = {
      ...
    };

    this._cdRef.detectChanges();
  }
}

Interfaz DataTableOptions

Es la interfaz que controla todas las acciones y propiedades de la librería.

interface DataTableOptions {
  bodyRequest?: ApiFormData;
  title?: string;
  id?: string;
  order?: string;
  service: any;
  listMethod: string;
  showFooter?: boolean;
  permissions?: CrudOptions;
  selection: SelectionOptions;
  customOptions?: CustomOptions;
  pageSizeOptions: number[];
  customActions?: CustomAction[];
  basicActions?: BasicActions;
  staticFilters?: StaticFilter[];
  staticToggleOptions?: ToggleOptions[];
  displayedColumns: ColumnOptions[];
  displayedColumnsFilters?: ColumnFilterOptions[];
}
1.34.0

1 year ago

1.4.5

11 months ago

1.4.4

11 months ago

1.4.3

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.4.7

11 months ago

1.3.0

1 year ago

1.2.11

1 year ago

1.2.10

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.0.69

2 years ago

1.0.68

2 years ago

1.0.71

2 years ago

1.0.70

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.66

2 years ago

1.0.65

2 years ago

1.0.67

2 years ago

1.0.62

3 years ago

1.0.61

3 years ago

1.0.60

3 years ago

1.0.64

3 years ago

1.0.27

3 years ago

1.0.39

3 years ago

1.0.40

3 years ago

1.0.44

3 years ago

1.0.43

3 years ago

1.0.42

3 years ago

1.0.41

3 years ago

1.0.48

3 years ago

1.0.47

3 years ago

1.0.46

3 years ago

1.0.45

3 years ago

1.0.49

3 years ago

1.0.51

3 years ago

1.0.50

3 years ago

1.0.55

3 years ago

1.0.54

3 years ago

1.0.53

3 years ago

1.0.58

3 years ago

1.0.57

3 years ago

1.0.56

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.30

3 years ago

1.0.37

3 years ago

1.0.34

3 years ago

1.0.38

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.23

3 years ago

1.0.11

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.10

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

1.0.0

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago