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

95 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.'
},
{
2022-09-14 14:26:41 +00:00
name: 'cancel',
type: 'boolean',
default: 'true',
description: 'When specified a cancel icon is displayed to allow clearing the value.'
},
{
name: 'onIcon',
type: 'string',
default: 'null',
description: 'Icon for the on state.'
},
{
name: 'offIcon',
type: 'string',
default: 'null',
description: 'Icon for the off state.'
},
{
name: 'cancelIcon',
type: 'string',
default: 'null',
description: 'Icon for the cancelable state.'
}
];
2023-04-18 13:42:36 +00:00
const RatingSlots = [
{
name: 'cancelicon',
description: 'Custom cancel icon template.'
},
{
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
}
};