PluginProbe
The Innovative Form Builder – IvyForms / 0.5
The Innovative Form Builder – IvyForms v0.5
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 0.5, at frontend/src/composables/registerLiteComponents.ts

146 lines 6.0 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 IvyButtonAction from '@/views/_components/button/IvyButtonAction.vue'
22 import IvyButtonOption from '@/views/_components/button/IvyButtonOption.vue'
23 import IvyIndicatorButton from '@/views/_components/button/IvyIndicatorButton.vue'
24 import IvyCard from '@/views/_components/card/IvyCard.vue'
25 import IvyDivider from '@/views/_components/divider/IvyDivider.vue'
26 import IvyScrollbar from '@/views/_components/scrollbar/IvyScrollbar.vue'
27 import IvyCheckbox from '@/views/_components/checkbox/IvyCheckbox.vue'
28 import IvyCheckboxGroup from '@/views/_components/checkbox/IvyCheckboxGroup.vue'
29 import IvyRadio from '@/views/_components/radio/IvyRadio.vue'
30 import IvyRadioGroup from '@/views/_components/radio/IvyRadioGroup.vue'
31 import IvyToggle from '@/views/_components/toggle/IvyToggle.vue'
32 import IvyChoiceItem from '@/views/_components/choice/IvyChoiceItem.vue'
33 import IvyChoiceList from '@/views/_components/choice/IvyChoiceList.vue'
34 import IvyFilter from '@/views/_components/filter/IvyFilter.vue'
35 import IvyFilterItems from '@/views/_components/filter/IvyFilterItems.vue'
36 import IvyDropdown from '@/views/_components/dropdown/IvyDropdown.vue'
37 import IvyDropdownItem from '@/views/_components/dropdown/IvyDropdownItem.vue'
38 import IvyDropdownMenu from '@/views/_components/dropdown/IvyDropdownMenu.vue'
39 import IvyMenu from '@/views/_components/menu/IvyMenu.vue'
40 import IvyMenuAccordion from '@/views/_components/menu/IvyMenuAccordion.vue'
41 import IvyHeaderButton from '@/views/_components/menu/IvyHeaderButton.vue'
42 import IvyModal from '@/views/_components/modal/IvyModal.vue'
43 import IvyDialog from '@/views/_components/dialog/IvyDialog.vue'
44 import IvyShortDialog from '@/views/_components/sub-dialog/IvyShortDialog.vue'
45 import IvyAlert from '@/views/_components/alert/IvyAlert.vue'
46 import IvyNotification from '@/views/_components/notification/IvyNotification.vue'
47 import IvyTooltip from '@/views/_components/tooltip/IvyTooltip.vue'
48 import IvyTable from '@/views/_components/table/IvyTable.vue'
49 import IvyTabs from '@/views/_components/tabs/IvyTabs.vue'
50 import IvyCollapse from '@/views/_components/collapse/IvyCollapse.vue'
51 import IvyCollapseItem from '@/views/_components/collapse/IvyCollapseItem.vue'
52 import IvySkeleton from '@/views/_components/skeleton/IvySkeleton.vue'
53 import IvySkeletonItem from '@/views/_components/skeleton/IvySkeletonItem.vue'
54 import IvyPagination from '@/views/_components/pagination/IvyPagination.vue'
55 import IvyEditor from '@/views/_components/html-editor/IvyEditor.vue'
56 import IvyDatePicker from '@/views/_components/datepicker/IvyDatePicker.vue'
57 import IvyPopover from '@/views/_components/popover/IvyPopover.vue'
58 import IvyPlaceholdersPopover from '@/views/_components/popover/IvyPlaceholdersPopover.vue'
59 import IvyContextMenu from '@/views/_components/context-menu/IvyContextMenu.vue'
60 import IvyContextMenuActions from '@/views/_components/context-menu/IvyContextMenuActions.vue'
61 import IvyLink from '@/views/_components/link/IvyLink.vue'
62 import IvyLogo from '@/views/_components/logo/IvyLogo.vue'
63 import IvySearch from '@/views/_components/search/IvySearch.vue'
64 import IvyThemeSwitch from '@/views/_components/theme-switch/IvyThemeSwitch.vue'
65 import ComingSoonBadge from '@/views/_components/badges/ComingSoonBadge.vue'
66 import Recaptcha from '@/views/_components/recaptcha/Recaptcha.vue'
67
68 /**
69 * Register all Lite components to a registry object
70 *
71 * @param componentsRegistry - The registry object to populate
72 * @param registerGlobal - Optional Vue app instance to register components globally (admin only)
73 */
74 export function registerLiteComponents(
75 componentsRegistry: Record<string, Component>,
76 registerGlobal?: { component: (name: string, component: Component) => void },
77 ): void {
78 const components = {
79 IvyFormItem,
80 IvyTextInput,
81 IvyIcon,
82 IvyNumberInput,
83 IvyPhoneInput,
84 IvySelectInput,
85 IvySelectOption,
86 IvyTextNumberInput,
87 IvyComingSoonInput,
88 IvyButtonAction,
89 IvyButtonOption,
90 IvyIndicatorButton,
91 IvyCard,
92 IvyDivider,
93 IvyScrollbar,
94 IvyCheckbox,
95 IvyCheckboxGroup,
96 IvyRadio,
97 IvyRadioGroup,
98 IvyToggle,
99 IvyChoiceItem,
100 IvyChoiceList,
101 IvyFilter,
102 IvyFilterItems,
103 IvyDropdown,
104 IvyDropdownItem,
105 IvyDropdownMenu,
106 IvyMenu,
107 IvyMenuAccordion,
108 IvyHeaderButton,
109 IvyModal,
110 IvyDialog,
111 IvyShortDialog,
112 IvyAlert,
113 IvyNotification,
114 IvyTooltip,
115 IvyTable,
116 IvyTabs,
117 IvyCollapse,
118 IvyCollapseItem,
119 IvySkeleton,
120 IvySkeletonItem,
121 IvyPagination,
122 IvyEditor,
123 IvyDatePicker,
124 IvyPopover,
125 IvyPlaceholdersPopover,
126 IvyContextMenu,
127 IvyContextMenuActions,
128 IvyLink,
129 IvyLogo,
130 IvySearch,
131 IvyThemeSwitch,
132 ComingSoonBadge,
133 Recaptcha,
134 }
135
136 // Register each component
137 Object.entries(components).forEach(([name, component]) => {
138 componentsRegistry[name] = component
139
140 // Also register globally to Vue app if provided (admin only)
141 if (registerGlobal) {
142 registerGlobal.component(name, component)
143 }
144 })
145 }
146