2026-01-02 13:41:09 +00:00
|
|
|
// Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
|
2024-06-13 11:58:57 +00:00
|
|
|
|
2025-06-16 15:51:14 +00:00
|
|
|
import { type Component } from 'vue'
|
|
|
|
|
|
2025-05-28 06:51:42 +00:00
|
|
|
import type { FieldEditorClass } from './types.ts'
|
2024-06-13 11:58:57 +00:00
|
|
|
|
2026-01-29 13:32:30 +00:00
|
|
|
type EditorComponentMap = {
|
|
|
|
|
[key: string]: Component | null
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-13 11:58:57 +00:00
|
|
|
// Provide your own map with the following keys, the values given here are just examples.
|
|
|
|
|
let editorClasses: FieldEditorClass = {
|
|
|
|
|
actionBar: {
|
|
|
|
|
tableMenuContainer: '',
|
2025-06-26 10:10:13 +00:00
|
|
|
tableMenuGrid: '',
|
2024-06-13 11:58:57 +00:00
|
|
|
button: {
|
|
|
|
|
base: '',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
input: {
|
|
|
|
|
container: '',
|
2025-11-10 15:42:05 +00:00
|
|
|
inlineContainer: '',
|
2024-06-13 11:58:57 +00:00
|
|
|
},
|
2026-01-29 13:32:30 +00:00
|
|
|
tableMenu: {
|
|
|
|
|
triggerButton: '',
|
|
|
|
|
},
|
2024-06-13 11:58:57 +00:00
|
|
|
}
|
|
|
|
|
|
2026-01-29 13:32:30 +00:00
|
|
|
let editorComponents: EditorComponentMap = {
|
2025-06-16 15:51:14 +00:00
|
|
|
actionBar: null,
|
|
|
|
|
actionMenu: null,
|
|
|
|
|
suggestionList: null,
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-13 11:58:57 +00:00
|
|
|
export const initializeFieldEditorClasses = (classes: FieldEditorClass) => {
|
|
|
|
|
editorClasses = classes
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const getFieldEditorClasses = () => editorClasses
|
2025-06-16 15:51:14 +00:00
|
|
|
|
2026-01-29 13:32:30 +00:00
|
|
|
export const initializeEditorComponents = (components: EditorComponentMap) => {
|
2025-06-16 15:51:14 +00:00
|
|
|
editorComponents = components
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const getEditorComponents = () => editorComponents
|