primevue-mirror/apps/showcase/api-generator/components/rating.js

91 lines
2.1 KiB
JavaScript
Raw Normal View History

const RatingProps = [
{
2022-09-14 14:26:41 +00:00
name: 'modelValue',
type: 'number',
default: 'null',
description: 'Value of the rating.'
},
{
2022-09-14 14:26:41 +00:00
name: 'disabled',
type: 'boolean',
default: 'false',
description: 'When present, it specifies that the element should be disabled.'
},
{
2022-09-14 14:26:41 +00:00
name: 'readonly',
type: 'boolean',
default: 'false',
description: 'When present, it specifies that component is read-only.'
},
{
2022-09-14 14:26:41 +00:00
name: 'stars',
type: 'number',
default: '5',
description: 'Number of stars.'
},
{
name: 'onIcon',
type: 'string',
default: 'null',
description: 'Icon for the on state.'
},
{
name: 'offIcon',
type: 'string',
default: 'null',
description: 'Icon for the off state.'
},
2023-05-08 12:18:27 +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.'
}
];
2023-04-18 13:42:36 +00:00
const RatingSlots = [
{
name: 'onicon',
description: 'Custom on icon template.'
},
{
name: 'officon',
description: 'Custom off icon template.'
}
];
const RatingEvents = [
{
2022-09-14 14:26:41 +00:00
name: 'change',
description: 'Callback to invoke on value change.',
arguments: [
{
2022-09-14 14:26:41 +00:00
name: 'event.originalEvent',
type: 'object',
description: 'Browser event'
},
{
2022-09-14 14:26:41 +00:00
name: 'event.value',
type: 'number',
description: 'Selected option value'
}
]
}
];
module.exports = {
rating: {
2022-09-14 14:26:41 +00:00
name: 'rating',
description: 'Rating component is a star based selection input.',
props: RatingProps,
2023-04-18 13:42:36 +00:00
slots: RatingSlots,
events: RatingEvents
}
};