2022-09-12 07:13:52 +00:00
|
|
|
const ChipsProps = [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'modelValue',
|
|
|
|
type: 'array',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Value of the component.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'max',
|
|
|
|
type: 'number',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Maximum number of entries allowed.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'separator',
|
|
|
|
type: 'string',
|
|
|
|
default: 'null',
|
2022-09-12 07:13:52 +00:00
|
|
|
description: 'Separator char to add an item when pressed in addition to the enter key. Currently only possible value is ","'
|
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'addOnBlur',
|
|
|
|
type: 'boolean',
|
|
|
|
default: 'false',
|
|
|
|
description: 'Whether to add an item when the input loses focus.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'allowDuplicate',
|
|
|
|
type: 'boolean',
|
|
|
|
default: 'false',
|
|
|
|
description: 'Whether to allow duplicate values or not.'
|
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: 'placeholder',
|
|
|
|
type: 'string',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Placeholder text for the input.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'inputId',
|
|
|
|
type: 'string',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Identifier of the focus input to match a label defined for the chips.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'inputClass',
|
2023-03-09 07:02:25 +00:00
|
|
|
type: 'string | object',
|
2022-09-14 14:26:41 +00:00
|
|
|
default: 'null',
|
|
|
|
description: 'Style class of the input field.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'inputStyle',
|
2023-03-09 07:02:25 +00:00
|
|
|
type: 'object',
|
2022-09-14 14:26:41 +00:00
|
|
|
default: 'null',
|
|
|
|
description: 'Inline style of the input field.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'inputProps',
|
|
|
|
type: 'object',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Uses to pass all properties of the HTMLInputElement to the focusable input element inside the component.'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
const ChipsEvents = [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'add',
|
|
|
|
description: 'Callback to invoke when a chip is added.',
|
2022-09-12 07:13:52 +00:00
|
|
|
arguments: [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'originalEvent',
|
|
|
|
type: 'object',
|
|
|
|
description: 'Browser event'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'value',
|
|
|
|
type: 'array',
|
|
|
|
description: 'Added item value'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'remove',
|
|
|
|
description: 'Callback to invoke when a chip is removed.',
|
2022-09-12 07:13:52 +00:00
|
|
|
arguments: [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'originalEvent',
|
|
|
|
type: 'object',
|
|
|
|
description: 'Browser event'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'value',
|
|
|
|
type: 'array',
|
|
|
|
description: 'Removed item value'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
const ChipsSlots = [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'chips',
|
|
|
|
description: 'Custom content for the chips'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
chips: {
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'chips',
|
|
|
|
description: 'Chips is used to enter multiple values on an input field.',
|
2022-09-12 07:13:52 +00:00
|
|
|
props: ChipsProps,
|
|
|
|
events: ChipsEvents,
|
|
|
|
slots: ChipsSlots
|
|
|
|
}
|
|
|
|
};
|