2022-09-12 07:13:52 +00:00
|
|
|
const DataViewProps = [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'value',
|
|
|
|
type: 'array',
|
|
|
|
default: 'null',
|
|
|
|
description: 'An array of objects to display.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'layout',
|
|
|
|
type: 'string',
|
|
|
|
default: 'list',
|
2022-09-12 07:13:52 +00:00
|
|
|
description: 'Layout of the items, valid values are "list" and "grid".'
|
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'rows',
|
|
|
|
type: 'number',
|
|
|
|
default: '0',
|
|
|
|
description: 'Number of rows to display per page.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'first',
|
|
|
|
type: 'number',
|
|
|
|
default: '0',
|
|
|
|
description: 'ndex of the first record to render.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'totalRecords',
|
|
|
|
type: 'number',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Number of total records, defaults to length of value when not defined.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'paginator',
|
|
|
|
type: 'boolean',
|
|
|
|
default: 'false',
|
|
|
|
description: 'When specified as true, enables the pagination.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'paginatorPosition',
|
|
|
|
type: 'string',
|
|
|
|
default: 'bottom',
|
2022-09-12 07:13:52 +00:00
|
|
|
description: 'Position of the paginator, options are "top","bottom" or "both".'
|
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'alwaysShowPaginator',
|
|
|
|
type: 'boolean',
|
|
|
|
default: 'true',
|
|
|
|
description: 'Whether to show it even there is only one page.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'paginatorTemplate',
|
|
|
|
type: 'string',
|
|
|
|
default: 'FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown',
|
|
|
|
description: 'Template of the paginator.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'pageLinkSize',
|
|
|
|
type: 'number',
|
|
|
|
default: '5',
|
|
|
|
description: 'Number of page links to display.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'rowsPerPageOptions',
|
|
|
|
type: 'array',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Array of integer values to display inside rows per page dropdown.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'currentPageReportTemplate',
|
|
|
|
type: 'string',
|
|
|
|
default: '({currentPage} of {totalPages})',
|
|
|
|
description: 'Template of the current page report element.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'sortField',
|
|
|
|
type: 'string',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Property name or a getter function of data to use in sorting by default.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'sortOrder',
|
|
|
|
type: 'number',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Order to sort the data by default.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'lazy',
|
|
|
|
type: 'boolean',
|
|
|
|
default: 'false',
|
|
|
|
description: 'Defines if data is loaded and interacted with in lazy manner.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'dataKey',
|
|
|
|
type: 'string',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Name of the data that uniquely identifies the a record in the data.'
|
2023-05-09 22:39:10 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'pt',
|
|
|
|
type: 'any',
|
|
|
|
default: 'null',
|
2023-08-01 14:01:12 +00:00
|
|
|
description: 'Used to pass attributes to DOM elements inside the component.'
|
2023-07-06 13:20:37 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'unstyled',
|
|
|
|
type: 'boolean',
|
|
|
|
default: 'false',
|
|
|
|
description: 'When enabled, it removes component related styles in the core.'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
const DataViewEvents = [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'page',
|
|
|
|
description: 'Callback to invoke when page changes, the event object contains information about the new state.',
|
2022-09-12 07:13:52 +00:00
|
|
|
arguments: [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.page',
|
|
|
|
type: 'number',
|
|
|
|
description: 'New page number'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.first',
|
|
|
|
type: 'number',
|
|
|
|
description: 'Index of first record'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.rows',
|
|
|
|
type: 'number',
|
|
|
|
description: 'Number of rows to display in new page'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.pageCount',
|
|
|
|
type: 'number',
|
|
|
|
description: 'Total number of pages'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
const DataViewSlots = [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'header',
|
2022-09-12 07:13:52 +00:00
|
|
|
description: "Custom content for the component's header"
|
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'paginatorstart',
|
2022-09-12 07:13:52 +00:00
|
|
|
description: "Custom content for the component paginator's left side"
|
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'paginatorend',
|
2022-09-12 07:13:52 +00:00
|
|
|
description: "Custom content for the component paginator's right side"
|
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'list',
|
|
|
|
description: 'Content for the list layout'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'grid',
|
|
|
|
description: 'Content for the grid layout'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'empty',
|
|
|
|
description: 'Custom content when there is no data to display'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'footer',
|
2022-09-12 07:13:52 +00:00
|
|
|
description: "Custom content for the component's footer"
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
dataview: {
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'DataView',
|
|
|
|
description: 'DataView displays data in grid or list layout with pagination and sorting features.',
|
2022-09-12 07:13:52 +00:00
|
|
|
props: DataViewProps,
|
|
|
|
events: DataViewEvents,
|
|
|
|
slots: DataViewSlots
|
|
|
|
}
|
|
|
|
};
|