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

149 lines
4.0 KiB
JavaScript
Raw Normal View History

const EditorProps = [
{
2022-09-14 14:26:41 +00:00
name: 'modelValue',
type: 'string',
default: 'null',
description: 'Value of the content.'
},
{
2022-09-14 14:26:41 +00:00
name: 'placeholder',
type: 'string',
default: 'null',
description: 'Placeholder text to show when editor is empty.'
},
{
2022-09-14 14:26:41 +00:00
name: 'readonly',
type: 'boolean',
default: 'false',
description: 'Whether to instantiate the editor to readonly mode.'
},
{
2022-09-14 14:26:41 +00:00
name: 'formats',
type: 'string[]',
default: 'null',
description: 'Whitelist of formats to display.'
},
{
2022-09-14 14:26:41 +00:00
name: 'editorStyle',
type: 'any',
default: 'null',
description: 'Inline style of the container.'
},
{
name: 'modules',
type: 'object',
default: 'null',
description: 'Modules configuration, see <a href="http://quilljs.com/docs/modules/">here</a> for available options.'
2023-05-05 10:15:25 +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.'
}
];
const EditorEvents = [
{
2022-09-14 14:26:41 +00:00
name: 'text-change',
description: 'Callback to invoke when text of editor changes.',
arguments: [
{
2022-09-14 14:26:41 +00:00
name: 'event.delta',
type: 'object',
description: 'Representation of the change.'
},
{
2022-09-14 14:26:41 +00:00
name: 'event.source',
type: 'string',
description: 'Source of change. Will be either "user" or "api".'
},
{
2022-09-14 14:26:41 +00:00
name: 'event.htmlValue',
type: 'string',
description: 'Current value as html.'
},
{
2022-09-14 14:26:41 +00:00
name: 'event.textValue',
type: 'string',
description: 'Current value as text.'
},
{
2022-09-14 14:26:41 +00:00
name: 'event.instance',
type: 'object',
description: 'Text editor instance.'
}
]
},
{
2022-09-14 14:26:41 +00:00
name: 'selection-change',
description: 'Callback to invoke when selection of the text changes.',
arguments: [
{
2022-09-14 14:26:41 +00:00
name: 'event.range',
type: 'object',
description: 'Representation of the selection boundaries.'
},
{
2022-09-14 14:26:41 +00:00
name: 'event.oldRange',
type: 'string',
description: 'Representation of the previous selection boundaries.'
},
{
2022-09-14 14:26:41 +00:00
name: 'event.source',
type: 'string',
description: 'Source of change. Will be either "user" or "api".'
},
{
2022-09-14 14:26:41 +00:00
name: 'event.htmlValue',
type: 'string',
description: 'Current value as html.'
},
{
2022-09-14 14:26:41 +00:00
name: 'event.textValue',
type: 'string',
description: 'Current value as text.'
},
{
2022-09-14 14:26:41 +00:00
name: 'event.instance',
type: 'object',
description: 'Text editor instance.'
}
]
},
{
name: 'load',
description: 'Callback to invoke when the quill modules are loaded.',
arguments: [
{
name: 'event.instance',
type: 'any',
description: 'Quill instance'
}
]
}
];
const EditorSlots = [
{
2022-09-14 14:26:41 +00:00
name: 'toolbar',
description: "Custom content for the component's toolbar"
}
];
module.exports = {
editor: {
2022-09-14 14:26:41 +00:00
name: 'Editor',
description: 'Editor is rich text editor component based on Quill.',
props: EditorProps,
events: EditorEvents,
slots: EditorSlots
}
};