@skillbill/vuelace-3
Version:
[](https://opensource.org/licenses/MIT) [](https://badge.fury.io/js/@skillbill%2Fvuelace-3)
73 lines (71 loc) • 2.31 kB
TypeScript
import { default as PrimeVueColumn } from 'primevue/column';
import { Component } from 'vue';
import { VLDialogProps } from '../VLDialog';
import { VLCrudFilterType } from '../VLCrudFilters';
import { VLFileInputErrorEvent } from '../VLFileInput';
import { VLCrudFormFieldType } from '../VLCrudForm';
export interface VLCrudHeaderType {
i18n_key: string;
value: string;
sortable?: boolean;
type?: string;
componentProps?: Object;
columnProps?: Omit<InstanceType<typeof PrimeVueColumn>['$props'], 'key' | 'field' | 'sortable' | 'header'>;
}
export interface VLCrudActionType {
name: string;
i18n_key: string;
icon_name: string;
component?: Component;
onClick?: (data: any) => void | Promise<boolean>;
isVisible?: (data: any) => boolean;
properties?: Object;
dialogProperties?: Omit<VLDialogProps, 'modelValue' | 'onRequestClose'>;
}
export interface VLCrudProps {
id: string;
primary_key: string;
singular_label: string;
headers: VLCrudHeaderType[];
filters: Omit<VLCrudFilterType, 'label'>[];
filters_title?: string;
form_fields: Omit<VLCrudFormFieldType, 'label'>[];
actions: VLCrudActionType[];
editable?: boolean;
showAddButton?: boolean;
components?: {
[key: string]: Component;
};
actionHeaderI18nKey?: string;
rowsPerPage?: number;
rowsPerPageOptions?: number[];
cancelI18nKey?: string;
addI18nKey?: string;
editI18nKey?: string;
requiredI18nKey?: string;
applyI18nKey?: string;
resetI18nKey?: string;
addButtonI18nKey?: string;
addTitleI18nKey?: string;
editTitleI18nKey?: string;
editTooltipI18nKey?: string;
goToInsertedRow?: boolean;
highlightLastEdited?: boolean;
hightlightLastEditedClass?: string;
persistActionDialog?: boolean;
getItems: (page: number, rowsPerPage: number, filters: any) => Promise<{
result: any[];
page: {
currentPage: number;
pageRows: number;
totalRows: number;
};
} | undefined>;
addItem?: (item: any) => any;
editItem?: (item: any) => any;
translationFn?: (key: string, props?: {
[key: string]: any;
}) => string;
onFetchError?: () => void;
onError?: (error: VLFileInputErrorEvent) => void;
}