2022-09-12 07:13:52 +00:00
|
|
|
const RatingProps = [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'modelValue',
|
|
|
|
type: 'number',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Value of the rating.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
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-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
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-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'stars',
|
|
|
|
type: 'number',
|
|
|
|
default: '5',
|
|
|
|
description: 'Number of stars.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
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.'
|
2023-04-04 12:41:50 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
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.'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
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.'
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2022-09-12 07:13:52 +00:00
|
|
|
const RatingEvents = [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'change',
|
|
|
|
description: 'Callback to invoke on value change.',
|
2022-09-12 07:13:52 +00:00
|
|
|
arguments: [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.originalEvent',
|
|
|
|
type: 'object',
|
|
|
|
description: 'Browser event'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.value',
|
|
|
|
type: 'number',
|
|
|
|
description: 'Selected option value'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
rating: {
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'rating',
|
|
|
|
description: 'Rating component is a star based selection input.',
|
2022-09-12 07:13:52 +00:00
|
|
|
props: RatingProps,
|
2023-04-18 13:42:36 +00:00
|
|
|
slots: RatingSlots,
|
2022-09-12 07:13:52 +00:00
|
|
|
events: RatingEvents
|
|
|
|
}
|
|
|
|
};
|