PluginProbe
The Innovative Form Builder – IvyForms / 1.1
The Innovative Form Builder – IvyForms v1.1
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 / composables / registerLiteComponents.ts

registerLiteComponents.ts in The Innovative Form Builder – IvyForms 1.1, at frontend/src/composables/registerLiteComponents.ts

173 lines 7.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Register all Lite components to window.IvyForms.components
3 *
4 * This makes all Lite components available to the Pro plugin and other extenders.
5 * Pro plugin cannot import components directly because they are in separate bundles.
6 * Instead, they access components through the global window.IvyForms.components registry.
7 */
8
9 import type { Component } from 'vue'
10
11 // Import all Lite components
12 import IvyFormItem from '@/views/_components/form/IvyFormItem.vue'
13 import IvyTextInput from '@/views/_components/input/IvyTextInput.vue'
14 import IvyIcon from '@/views/_components/icon/IvyIcon.vue'
15 import IvyNumberInput from '@/views/_components/input/IvyNumberInput.vue'
16 import IvyPhoneInput from '@/views/_components/input/IvyPhoneInput.vue'
17 import IvySelectInput from '@/views/_components/input/IvySelectInput.vue'
18 import IvySelectOption from '@/views/_components/input/IvySelectOption.vue'
19 import IvyTextNumberInput from '@/views/_components/input/IvyTextNumberInput.vue'
20 import IvyComingSoonInput from '@/views/_components/input/IvyComingSoonInput.vue'
21 import IvyRating from '@/views/_components/input/IvyRating.vue'
22 import IvyButtonAction from '@/views/_components/button/IvyButtonAction.vue'
23 import IvyButtonOption from '@/views/_components/button/IvyButtonOption.vue'
24 import IvyIndicatorButton from '@/views/_components/button/IvyIndicatorButton.vue'
25 import IvyTemplateCard from '@/views/_components/card/IvyTemplateCard.vue'
26 import IvyDivider from '@/views/_components/divider/IvyDivider.vue'
27 import IvyScrollbar from '@/views/_components/scrollbar/IvyScrollbar.vue'
28 import IvyCheckbox from '@/views/_components/checkbox/IvyCheckbox.vue'
29 import IvyCheckboxGroup from '@/views/_components/checkbox/IvyCheckboxGroup.vue'
30 import IvyRadio from '@/views/_components/radio/IvyRadio.vue'
31 import IvyRadioGroup from '@/views/_components/radio/IvyRadioGroup.vue'
32 import IvyToggle from '@/views/_components/toggle/IvyToggle.vue'
33 import IvyChoiceItem from '@/views/_components/choice/IvyChoiceItem.vue'
34 import IvyChoiceList from '@/views/_components/choice/IvyChoiceList.vue'
35 import IvyPageChoiceList from '@/views/_components/choice/IvyPageChoiceList.vue'
36 import IvyFilter from '@/views/_components/filter/IvyFilter.vue'
37 import IvyFilterItems from '@/views/_components/filter/IvyFilterItems.vue'
38 import IvyDropdown from '@/views/_components/dropdown/IvyDropdown.vue'
39 import IvyDropdownItem from '@/views/_components/dropdown/IvyDropdownItem.vue'
40 import IvyDropdownMenu from '@/views/_components/dropdown/IvyDropdownMenu.vue'
41 import IvyMenu from '@/views/_components/menu/IvyMenu.vue'
42 import IvyMenuAccordion from '@/views/_components/menu/IvyMenuAccordion.vue'
43 import IvyHeaderButton from '@/views/_components/menu/IvyHeaderButton.vue'
44 import IvyModal from '@/views/_components/modal/IvyModal.vue'
45 import IvyDialog from '@/views/_components/dialog/IvyDialog.vue'
46 import IvyShortDialog from '@/views/_components/sub-dialog/IvyShortDialog.vue'
47 import ProUpgradeDialog from '@/views/_components/dialog/ProUpgradeDialog.vue'
48 import IvyAlert from '@/views/_components/alert/IvyAlert.vue'
49 import IvyNotification from '@/views/_components/notification/IvyNotification.vue'
50 import IvyTooltip from '@/views/_components/tooltip/IvyTooltip.vue'
51 import IvyTable from '@/views/_components/table/IvyTable.vue'
52 import IvyTabs from '@/views/_components/tabs/IvyTabs.vue'
53 import IvyCollapse from '@/views/_components/collapse/IvyCollapse.vue'
54 import IvyCollapseItem from '@/views/_components/collapse/IvyCollapseItem.vue'
55 import IvySkeleton from '@/views/_components/skeleton/IvySkeleton.vue'
56 import IvySkeletonItem from '@/views/_components/skeleton/IvySkeletonItem.vue'
57 import IvyPagination from '@/views/_components/pagination/IvyPagination.vue'
58 import IvyEditor from '@/views/_components/html-editor/IvyEditor.vue'
59 import IvyDatePicker from '@/views/_components/datepicker/IvyDatePicker.vue'
60 import IvyTimePicker from '@/views/_components/timepicker/IvyTimePicker.vue'
61 import IvyPopover from '@/views/_components/popover/IvyPopover.vue'
62 import IvyPlaceholdersPopover from '@/views/_components/popover/IvyPlaceholdersPopover.vue'
63 import IvyContextMenu from '@/views/_components/context-menu/IvyContextMenu.vue'
64 import IvyContextMenuActions from '@/views/_components/context-menu/IvyContextMenuActions.vue'
65 import IvyLink from '@/views/_components/link/IvyLink.vue'
66 import IvyLogo from '@/views/_components/logo/IvyLogo.vue'
67 import IvySearch from '@/views/_components/search/IvySearch.vue'
68 import IvySlider from '@/views/_components/slider/IvySlider.vue'
69 import IvyThemeSwitch from '@/views/_components/theme-switch/IvyThemeSwitch.vue'
70 import ComingSoonBadge from '@/views/_components/badges/ComingSoonBadge.vue'
71 import Recaptcha from '@/views/_components/recaptcha/Recaptcha.vue'
72 import IvyNotificationBanner from '@/views/_components/banners/IvyNotificationBanner.vue'
73 import IvyNotificationActionsBanner from '@/views/_components/banners/IvyNotificationActionsBanner.vue'
74 import PageEmptyState from '@/views/admin/parts/PageEmptyState.vue'
75 import FieldOptionsItem from '@/views/admin/form-builder/form-builder-page/form-builder/panel/tabs/_components/FieldOptionsItem.vue'
76
77 /**
78 * Register all Lite components to a registry object
79 *
80 * @param componentsRegistry - The registry object to populate
81 * @param registerGlobal - Optional Vue app instance to register components globally (admin only)
82 */
83 export function registerLiteComponents(
84 componentsRegistry: Record<string, Component>,
85 registerGlobal?: { component: (name: string, component: Component) => void },
86 ): void {
87 const components = {
88 IvyFormItem,
89 IvyTextInput,
90 IvyIcon,
91 IvyNumberInput,
92 IvyPhoneInput,
93 IvySelectInput,
94 IvySelectOption,
95 IvyTextNumberInput,
96 IvyComingSoonInput,
97 IvyRating,
98 IvyButtonAction,
99 IvyButtonOption,
100 IvyIndicatorButton,
101 IvyTemplateCard,
102 IvyDivider,
103 IvyScrollbar,
104 IvyCheckbox,
105 IvyCheckboxGroup,
106 IvyRadio,
107 IvyRadioGroup,
108 IvyToggle,
109 IvyChoiceItem,
110 IvyChoiceList,
111 IvyPageChoiceList,
112 IvyFilter,
113 IvyFilterItems,
114 IvyDropdown,
115 IvyDropdownItem,
116 IvyDropdownMenu,
117 IvyMenu,
118 IvyMenuAccordion,
119 IvyHeaderButton,
120 IvyModal,
121 IvyDialog,
122 IvyShortDialog,
123 ProUpgradeDialog,
124 IvyAlert,
125 IvyNotification,
126 IvyTooltip,
127 IvyTable,
128 IvyTabs,
129 IvyCollapse,
130 IvyCollapseItem,
131 IvySkeleton,
132 IvySkeletonItem,
133 IvyPagination,
134 IvyEditor,
135 IvyDatePicker,
136 IvyTimePicker,
137 IvyPopover,
138 IvyPlaceholdersPopover,
139 IvyContextMenu,
140 IvyContextMenuActions,
141 IvyLink,
142 IvyLogo,
143 IvySearch,
144 IvySlider,
145 IvyThemeSwitch,
146 ComingSoonBadge,
147 Recaptcha,
148 IvyNotificationBanner,
149 IvyNotificationActionsBanner,
150 PageEmptyState,
151 FieldOptionsItem,
152 }
153
154 // Register each component
155 Object.entries(components).forEach(([name, component]) => {
156 componentsRegistry[name] = component
157
158 // Notify listeners (e.g., Pro) that a component is now available
159 if (typeof window !== 'undefined') {
160 window.dispatchEvent(
161 new CustomEvent('ivyforms:component-registered', {
162 detail: { componentName: name },
163 }),
164 )
165 }
166
167 // Also register globally to Vue app if provided (admin only)
168 if (registerGlobal) {
169 registerGlobal.component(name, component)
170 }
171 })
172 }
173