v4web-components
Version:
Stencil Component Starter
118 lines (117 loc) • 2.65 kB
TypeScript
/// <reference types="react" />
import { EventEmitter } from '../../../stencil-public-runtime';
export interface IDataHeader {
title?: string;
icon?: string;
type?: 'text' | 'number' | 'badge' | 'badge' | 'select' | 'quantify' | 'customize';
colKey: string;
positionTitle?: 'left' | 'right';
sortable?: boolean;
customSort?: boolean;
}
export interface IBadgeProps {
label: string;
variant?: 'outlined' | 'ghost' | 'dot';
size?: 'small' | 'medium';
state?: 'success' | 'error' | 'warning';
}
export interface ISelectProps {
options: Array<{
label: string;
isChecked: boolean;
key: string;
nameAvatar?: string;
imgSRCAvatar?: string;
}>;
optionsSelected?: Array<{
label: string;
isChecked: boolean;
key: string;
nameAvatar?: string;
imgSRCAvatar?: string;
}>;
type?: 'checkbox' | 'radioButton';
avatar?: boolean;
value?: string;
isSearchable?: boolean;
titleInput?: string;
label?: string;
placeholderSearch?: string;
disabled?: boolean;
helperText?: string;
state?: 'error' | 'default';
onChangeInput?: ({ detail }: {
detail: any;
}) => void;
onChangeInputOptions?: ({ detail }: {
detail: any;
}) => void;
}
export interface IQuantifyProps {
maxValue?: number;
value?: number;
state?: 'error' | 'default';
onHandleCounterValue?: ({ detail }: {
detail: any;
}) => void;
}
export interface IContextMenuProps {
items: Array<{
icon?: string;
label: string;
key: string;
disabled?: boolean;
event: () => void;
}>;
destructiveItem?: {
icon?: string;
label: string;
key: string;
disabled?: boolean;
event?: () => void;
};
}
export interface IDataRow {
text?: {
title?: string;
avatar?: boolean;
avatarImgSRC?: string;
icon?: string;
};
number?: {
title?: string;
};
key?: string;
handleRow?: () => void;
badge?: IBadgeProps;
select?: ISelectProps;
quantify?: IQuantifyProps;
action?: IContextMenuProps;
customize?: {
component?: string;
props?: JSX.Element;
};
}
export interface IData {
headers: IDataHeader[];
rows: Record<string, IDataRow>[];
}
export declare class LabDsTable {
data: IData;
actionField: boolean;
loading: boolean;
finalLineNextPage: EventEmitter<boolean>;
sortAsc: EventEmitter<string>;
sortDesc: EventEmitter<string>;
headerPosition: 'left' | 'right';
sortConfig: {
key: string;
direction: string;
};
handleSortAsc(d: IDataHeader): void;
handleSortDesc(d: IDataHeader): void;
sortData(sortConfig: any): void;
el: HTMLElement;
componentDidRender(): void;
render(): any;
}