PluginProbe
The Innovative Form Builder – IvyForms / 0.8.2
The Innovative Form Builder – IvyForms v0.8.2
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / frontend / src / stores / proUpgradeDialogStore.ts

proUpgradeDialogStore.ts in The Innovative Form Builder – IvyForms 0.8.2, at frontend/src/stores/proUpgradeDialogStore.ts

54 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Pro Upgrade Dialog Store
3 *
4 * Centralized store for managing Pro feature upgrade dialogs
5 */
6
7 import { defineStore } from 'pinia'
8 import { ref } from 'vue'
9 import type { Ref } from 'vue'
10
11 type ButtonType = 'primary' | 'secondary' | 'tertiary'
12
13 export type ProUpgradeDialogData = {
14 title: string
15 subtitle?: string
16 iconName?: string
17 buttons?: {
18 close?: {
19 type?: ButtonType
20 text: string
21 function?: () => void
22 }
23 confirm?: {
24 type?: ButtonType
25 text: string
26 function?: () => void
27 }
28 }
29 }
30
31 export const useProUpgradeDialogStore = defineStore('proUpgradeDialog', () => {
32 const dialogVisible: Ref<boolean> = ref(false)
33 const dialogData: Ref<ProUpgradeDialogData> = ref({
34 title: '',
35 subtitle: '',
36 })
37
38 const showDialog = (data: ProUpgradeDialogData) => {
39 dialogData.value = data
40 dialogVisible.value = true
41 }
42
43 const hideDialog = () => {
44 dialogVisible.value = false
45 }
46
47 return {
48 dialogVisible,
49 dialogData,
50 showDialog,
51 hideDialog,
52 }
53 })
54