1.3.0 • Published 17 days ago

guachos-datatable v1.3.0

Weekly downloads
-
License
MIT
Repository
-
Last release
17 days 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.3.0

17 days ago

1.2.11

19 days ago

1.2.10

5 months ago

1.2.9

5 months ago

1.2.8

5 months ago

1.2.7

5 months ago

1.2.6

5 months ago

1.2.5

6 months ago

1.2.4

6 months ago

1.2.3

6 months ago

1.2.2

6 months ago

1.2.1

6 months ago

1.0.69

6 months ago

1.0.68

6 months ago

1.0.71

6 months ago

1.0.70

6 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.1.4

6 months ago

1.1.3

6 months ago

1.1.2

6 months ago

1.0.66

7 months ago

1.0.65

8 months ago

1.0.67

7 months ago

1.0.62

1 year ago

1.0.61

1 year ago

1.0.60

1 year ago

1.0.64

1 year ago

1.0.27

2 years ago

1.0.39

2 years ago

1.0.40

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.41

2 years ago

1.0.48

2 years ago

1.0.47

2 years ago

1.0.46

2 years ago

1.0.45

2 years ago

1.0.49

2 years ago

1.0.51

1 year ago

1.0.50

1 year ago

1.0.55

1 year ago

1.0.54

1 year ago

1.0.53

1 year ago

1.0.58

1 year ago

1.0.57

1 year ago

1.0.56

1 year ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.37

2 years ago

1.0.34

2 years ago

1.0.38

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.23

2 years ago

1.0.11

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.10

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

1.0.0

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago