DataView .d.ts updated
parent
f8d8a968ac
commit
1ac9b2a49a
|
@ -1,12 +1,19 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* DataView displays data in grid or list layout with pagination and sorting features.
|
||||||
|
*
|
||||||
|
* [Live Demo](https://www.primevue.org/dataview/)
|
||||||
|
*
|
||||||
|
* @module dataview
|
||||||
|
*
|
||||||
|
*/
|
||||||
import { VNode } from 'vue';
|
import { VNode } from 'vue';
|
||||||
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
||||||
|
|
||||||
type DataViewLayoutType = 'list' | 'grid' | undefined;
|
/**
|
||||||
|
* Custom change event.
|
||||||
type DataTablePositionType = 'top' | 'bottom' | 'both' | undefined;
|
* @see page
|
||||||
|
*/
|
||||||
type DataViewSortFieldType = string | ((item: any) => string) | undefined;
|
|
||||||
|
|
||||||
export interface DataViewPageEvent {
|
export interface DataViewPageEvent {
|
||||||
/**
|
/**
|
||||||
* New page number
|
* New page number
|
||||||
|
@ -26,6 +33,9 @@ export interface DataViewPageEvent {
|
||||||
pageCount: number;
|
pageCount: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines valid properties in DataView component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
||||||
|
*/
|
||||||
export interface DataViewProps {
|
export interface DataViewProps {
|
||||||
/**
|
/**
|
||||||
* An array of objects to display.
|
* An array of objects to display.
|
||||||
|
@ -33,18 +43,17 @@ export interface DataViewProps {
|
||||||
value?: any[] | undefined;
|
value?: any[] | undefined;
|
||||||
/**
|
/**
|
||||||
* Layout of the items, valid values are 'list' and 'grid'.
|
* Layout of the items, valid values are 'list' and 'grid'.
|
||||||
* @see DataViewLayoutType
|
* @defaultValue list
|
||||||
* Default value is 'list'.
|
|
||||||
*/
|
*/
|
||||||
layout?: any;
|
layout?: 'list' | 'grid' | undefined;
|
||||||
/**
|
/**
|
||||||
* Number of rows to display per page.
|
* Number of rows to display per page.
|
||||||
* Default value is 0.
|
* @defaultValue 0
|
||||||
*/
|
*/
|
||||||
rows?: number | undefined;
|
rows?: number | undefined;
|
||||||
/**
|
/**
|
||||||
* Index of the first record to render.
|
* Index of the first record to render.
|
||||||
* Default value is 0.
|
* @defaultValue 0
|
||||||
*/
|
*/
|
||||||
first?: number | undefined;
|
first?: number | undefined;
|
||||||
/**
|
/**
|
||||||
|
@ -53,21 +62,21 @@ export interface DataViewProps {
|
||||||
totalRecords?: number | undefined;
|
totalRecords?: number | undefined;
|
||||||
/**
|
/**
|
||||||
* When specified as true, enables the pagination.
|
* When specified as true, enables the pagination.
|
||||||
|
* @defaultValue false
|
||||||
*/
|
*/
|
||||||
paginator?: boolean | undefined;
|
paginator?: boolean | undefined;
|
||||||
/**
|
/**
|
||||||
* Position of the paginator, options are 'top','bottom' or 'both'.
|
* Position of the paginator, options are 'top','bottom' or 'both'.
|
||||||
* @see DataTablePositionType
|
* @defaultValue bottom
|
||||||
* Default value is 'bottom'.
|
|
||||||
*/
|
*/
|
||||||
paginatorPosition?: DataTablePositionType;
|
paginatorPosition?: 'top' | 'bottom' | 'both' | undefined;
|
||||||
/**
|
/**
|
||||||
* Whether to show it even there is only one page.
|
* Whether to show it even there is only one page.
|
||||||
* Default value is true.
|
* @defaultValue true
|
||||||
*/
|
*/
|
||||||
alwaysShowPaginator?: boolean | undefined;
|
alwaysShowPaginator?: boolean | undefined;
|
||||||
/**
|
/**
|
||||||
* Template of the paginator. It can be customized using the template property using the predefined keys, default value is 'FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown'. Here are the available elements that can be placed inside a paginator in any order.
|
* Template of the paginator. It can be customized using the template property using the predefined keys,
|
||||||
*
|
*
|
||||||
* - FirstPageLink
|
* - FirstPageLink
|
||||||
* - PrevPageLink
|
* - PrevPageLink
|
||||||
|
@ -78,11 +87,13 @@ export interface DataViewProps {
|
||||||
* - JumpToPageDropdown
|
* - JumpToPageDropdown
|
||||||
* - JumpToPageInput
|
* - JumpToPageInput
|
||||||
* - CurrentPageReport
|
* - CurrentPageReport
|
||||||
|
*
|
||||||
|
* @defaultValue FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown
|
||||||
*/
|
*/
|
||||||
paginatorTemplate?: string | undefined;
|
paginatorTemplate?: string | undefined;
|
||||||
/**
|
/**
|
||||||
* Number of page links to display.
|
* Number of page links to display.
|
||||||
* Default value is 5.
|
* @defaultValue 5
|
||||||
*/
|
*/
|
||||||
pageLinkSize?: number | undefined;
|
pageLinkSize?: number | undefined;
|
||||||
/**
|
/**
|
||||||
|
@ -90,7 +101,7 @@ export interface DataViewProps {
|
||||||
*/
|
*/
|
||||||
rowsPerPageOptions?: number[] | undefined;
|
rowsPerPageOptions?: number[] | undefined;
|
||||||
/**
|
/**
|
||||||
* Template of the current page report element. It displays information about the pagination state. Default value is ({currentPage} of {totalPages}) whereas available placeholders are the following;
|
* Template of the current page report element. It displays information about the pagination state.
|
||||||
*
|
*
|
||||||
* - {currentPage}
|
* - {currentPage}
|
||||||
* - {totalPages}
|
* - {totalPages}
|
||||||
|
@ -98,19 +109,21 @@ export interface DataViewProps {
|
||||||
* - {first}
|
* - {first}
|
||||||
* - {last}
|
* - {last}
|
||||||
* - {totalRecords}
|
* - {totalRecords}
|
||||||
|
*
|
||||||
|
* @defaultValue ({currentPage} of {totalPages})
|
||||||
*/
|
*/
|
||||||
currentPageReportTemplate?: string | undefined;
|
currentPageReportTemplate?: string | undefined;
|
||||||
/**
|
/**
|
||||||
* Property name or a getter function of data to use in sorting by default.
|
* Property name or a getter function of data to use in sorting by default.
|
||||||
* @see DataViewSortFieldType
|
|
||||||
*/
|
*/
|
||||||
sortField?: DataViewSortFieldType;
|
sortField?: string | ((item: any) => string) | undefined;
|
||||||
/**
|
/**
|
||||||
* Order to sort the data by default.
|
* Order to sort the data by default.
|
||||||
*/
|
*/
|
||||||
sortOrder?: number | undefined;
|
sortOrder?: number | undefined;
|
||||||
/**
|
/**
|
||||||
* Defines if data is loaded and interacted with in lazy manner.
|
* Defines if data is loaded and interacted with in lazy manner.
|
||||||
|
* @defaultValue false
|
||||||
*/
|
*/
|
||||||
lazy?: boolean | undefined;
|
lazy?: boolean | undefined;
|
||||||
/**
|
/**
|
||||||
|
@ -119,32 +132,35 @@ export interface DataViewProps {
|
||||||
dataKey: string | undefined;
|
dataKey: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines valid slots in DataView component.
|
||||||
|
*/
|
||||||
export interface DataViewSlots {
|
export interface DataViewSlots {
|
||||||
/**
|
/**
|
||||||
* Custom header template.
|
* Custom header template.
|
||||||
*/
|
*/
|
||||||
header: () => VNode[];
|
header(): VNode[];
|
||||||
/**
|
/**
|
||||||
* Custom footer template.
|
* Custom footer template.
|
||||||
*/
|
*/
|
||||||
footer: () => VNode[];
|
footer(): VNode[];
|
||||||
/**
|
/**
|
||||||
* Custom empty template.
|
* Custom empty template.
|
||||||
*/
|
*/
|
||||||
empty: () => VNode[];
|
empty(): VNode[];
|
||||||
/**
|
/**
|
||||||
* Custom paginator start template.
|
* Custom paginator start template.
|
||||||
*/
|
*/
|
||||||
paginatorstart: () => VNode[];
|
paginatorstart(): VNode[];
|
||||||
/**
|
/**
|
||||||
* Custom paginator end template.
|
* Custom paginator end template.
|
||||||
*/
|
*/
|
||||||
paginatorend: () => VNode[];
|
paginatorend(): VNode[];
|
||||||
/**
|
/**
|
||||||
* Custom list template.
|
* Custom list template.
|
||||||
* @param {Object} scope - list slot's params.
|
* @param {Object} scope - list slot's params.
|
||||||
*/
|
*/
|
||||||
list: (scope: {
|
list(scope: {
|
||||||
/**
|
/**
|
||||||
* Value of the component
|
* Value of the component
|
||||||
*/
|
*/
|
||||||
|
@ -153,12 +169,12 @@ export interface DataViewSlots {
|
||||||
* Index of the grid
|
* Index of the grid
|
||||||
*/
|
*/
|
||||||
index: number;
|
index: number;
|
||||||
}) => VNode[];
|
}): VNode[];
|
||||||
/**
|
/**
|
||||||
* Custom list template.
|
* Custom list template.
|
||||||
* @param {Object} scope - list slot's params.
|
* @param {Object} scope - list slot's params.
|
||||||
*/
|
*/
|
||||||
grid: (scope: {
|
grid(scope: {
|
||||||
/**
|
/**
|
||||||
* Value of the component
|
* Value of the component
|
||||||
*/
|
*/
|
||||||
|
@ -167,27 +183,42 @@ export interface DataViewSlots {
|
||||||
* Index of the grid
|
* Index of the grid
|
||||||
*/
|
*/
|
||||||
index: number;
|
index: number;
|
||||||
}) => VNode[];
|
}): VNode[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export declare type DataViewEmits = {
|
/**
|
||||||
|
* Defines valid slots in DataView component.
|
||||||
|
*/
|
||||||
|
export interface DataViewEmits {
|
||||||
/**
|
/**
|
||||||
* Emitted when the first changes.
|
* Emitted when the first changes.
|
||||||
* @param {number} value - New value.
|
* @param {number} value - New value.
|
||||||
*/
|
*/
|
||||||
'update:first': (value: number) => void;
|
'update:first'(value: number): void;
|
||||||
/**
|
/**
|
||||||
* Emitted when the rows changes.
|
* Emitted when the rows changes.
|
||||||
* @param {number} value - New value.
|
* @param {number} value - New value.
|
||||||
*/
|
*/
|
||||||
'update:rows': (value: number) => void;
|
'update:rows'(value: number): void;
|
||||||
/**
|
/**
|
||||||
* Callback to invoke when page changes, the event object contains information about the new state.
|
* Callback to invoke when page changes, the event object contains information about the new state.
|
||||||
* @param {DataViewPageEvent} event - Custom page event.
|
* @param {DataViewPageEvent} event - Custom page event.
|
||||||
*/
|
*/
|
||||||
page: (event: DataViewPageEvent) => void;
|
page(event: DataViewPageEvent): void;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* **PrimeVue - DataViewLayoutOptions**
|
||||||
|
*
|
||||||
|
* _DataView displays data in grid or list layout with pagination and sorting features._
|
||||||
|
*
|
||||||
|
* [Live Demo](https://www.primevue.org/dataview/)
|
||||||
|
* --- ---
|
||||||
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
||||||
|
*
|
||||||
|
* @group Component
|
||||||
|
*
|
||||||
|
*/
|
||||||
declare class DataView extends ClassComponent<DataViewProps, DataViewSlots, DataViewEmits> {}
|
declare class DataView extends ClassComponent<DataViewProps, DataViewSlots, DataViewEmits> {}
|
||||||
|
|
||||||
declare module '@vue/runtime-core' {
|
declare module '@vue/runtime-core' {
|
||||||
|
@ -196,17 +227,4 @@ declare module '@vue/runtime-core' {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* DataView displays data in grid or list layout with pagination and sorting features.
|
|
||||||
*
|
|
||||||
* Helper API:
|
|
||||||
*
|
|
||||||
* - PrimeFlex
|
|
||||||
*
|
|
||||||
* Demos:
|
|
||||||
*
|
|
||||||
* - [DataView](https://www.primefaces.org/primevue/dataview)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export default DataView;
|
export default DataView;
|
||||||
|
|
Loading…
Reference in New Issue