@tul/table
v2.2.6
Published
> Management of tul table.
Downloads
144
Readme
TUL TABLE
Management of tul table.
Table of Contents
Installation
npm i @tul/table --save
Usage
Html
<lib-tul-tabler></lib-tul-tabler>
Emitters
Inputs
@Input() title: string = '';
@Input() columns: Array<Column> = [];
@Input() data: Array<any> = [];
@Input() table: TableList<any> | TableEntity<any>;
Outputs
@Output() executeOption = new EventEmitter<any>();
Models
Enums
export enum TypeOption {
EDIT = 'edit',
DELETE = 'delete',
DETAILS = 'details',
}
export enum TypeHeaderOptions {
ADD = 'add',
EXPORT = 'export',
REFRESH = 'refresh',
}
export enum TypeTable {
ENTITY = 'entity',
LIST = 'list',
}
export enum TypeColumn {
TEXT = 'text',
NUMBER = 'number',
DATE = 'date',
CURRENCY = 'currency',
SELECT = 'select',
}
export enum SubTypeDateColumn {
DATE = 'DATE',
DATETIME = 'DATETIME',
MONTH = 'MONTH',
YEAR = 'YEAR',
TIME = 'TIME',
}
Interfaces
export interface SelectColumn extends Column {
listValues: Array<{ text: string; value: string }>;
}
export interface DateColumn extends Column {
subType: SubTypeDateColumn;
}
export interface Column {
header: string;
attribute: string;
attributeFilter?: string;
type?: TypeColumn;
link?: string;
safeNull?: string;
sort?: boolean;
filter?: boolean;
filterActive?: boolean;
}
export interface Country {
code: string;
prefixNumber: string;
digitsCellphone: number;
currency: string;
latitude: number;
longitude: number;
}
interface Styles {
header?: {
th: { [key: string]: string };
};
body?: {
td: { [key: string]: string };
};
options?: {
td: { [key: string]: string };
th: { [key: string]: string };
};
}
export interface OptionsTable {
id: string;
type: TypeOption;
url?: string | Function;
disabled?: Observable<boolean> | boolean | Function;
}
export interface HeaderOptions {
id: string;
type: TypeHeaderOptions;
url?: string | Function;
disabled?: Observable<boolean> | boolean | Function;
}
interface Table {
idTable: IdTable;
options?: Array<OptionsTable>;
optionsHeader?: Array<HeaderOptions>;
styles?: Styles;
title?: string;
pageSizeOptions?: Array<number>;
showPagination?: boolean;
size?: number;
}
export interface TableEntity extends Table {
// tslint:disable-next-line
url?: string | Function;
httpSubscribe?: any;
// tslint:disable-next-line
mapHttpSubscribe?: Function;
readonly typeTable?: TypeTable.ENTITY;
}
export interface TableList extends Table {
readonly typeTable?: TypeTable.LIST;
}
Release History
0.1.0
- Structure was created
Pizza Owner
Andres Felipe Chia Avila