Files
nocodb/packages/nc-gui/store/widget.ts
mertmit 69a29568c7 chore: sync
Signed-off-by: mertmit <mertmit99@gmail.com>
2026-01-10 00:21:02 +03:00

54 lines
1.1 KiB
TypeScript

export const useWidgetStore = defineStore('widget', () => {
const widgets = ref(new Map())
const activeDashboardWidgets = computed(() => [])
const isGaugeWidgetEnabled = computed(() => false)
const selectedWidget = ref(null)
const loadWidgets = async (_params: any) => []
const getWidget = async (_params: any) => null
const createWidget = async (..._params: any) => null
const updateWidget = async (..._params: any) => null
const duplicateWidget = async (..._params: any) => null
const deleteWidget = async (..._params: any) => true
const updateWidgetPosition = async (..._params: any) => null
const clearWidgets = (..._params: any) => null
const loadWidgetData = async (..._params: any) => null
return {
// State
widgets,
// Getters
activeDashboardWidgets,
selectedWidget,
isGaugeWidgetEnabled,
// Actions
loadWidgets,
getWidget,
createWidget,
duplicateWidget,
updateWidget,
deleteWidget,
updateWidgetPosition,
clearWidgets,
loadWidgetData,
}
})
// Enable HMR
if (import.meta.hot) {
import.meta.hot.accept(acceptHMRUpdate(useWidgetStore, import.meta.hot))
}