@solidstarters/solid-core-ui 1.1.211 → 1.1.212

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. package/dist/components/Svg/DevDocs.tsx +9 -0
  2. package/dist/components/Svg/DocsSvg.tsx +9 -0
  3. package/dist/components/Svg/ExcelSvg.tsx +15 -0
  4. package/dist/components/Svg/FieldSvg.tsx +9 -0
  5. package/dist/components/Svg/FileSvg.tsx +18 -0
  6. package/dist/components/Svg/HomePageModuleSvg.tsx +179 -0
  7. package/dist/components/Svg/ModelSvg.tsx +9 -0
  8. package/dist/components/Svg/ModuleSvg.tsx +9 -0
  9. package/dist/components/Svg/PDFSvg.tsx +15 -0
  10. package/dist/components/Svg/RightArrowSvg.tsx +9 -0
  11. package/dist/components/Svg/SettingsSvg.tsx +9 -0
  12. package/dist/components/auth/AuthLayout.tsx +223 -0
  13. package/dist/components/auth/ForgotPasswordThankYou.tsx +33 -0
  14. package/dist/components/auth/GoogleAuthChecking.tsx +63 -0
  15. package/dist/components/auth/SolidChangeForcePassword.tsx +222 -0
  16. package/dist/components/auth/SolidForgotPassword.tsx +127 -0
  17. package/dist/components/auth/SolidInitialLoginOtp.tsx +271 -0
  18. package/dist/components/auth/SolidInitiateRegisterOtp.tsx +218 -0
  19. package/dist/components/auth/SolidLogin.d.ts.map +1 -1
  20. package/dist/components/auth/SolidLogin.js +14 -8
  21. package/dist/components/auth/SolidLogin.js.map +1 -1
  22. package/dist/components/auth/SolidLogin.tsx +428 -0
  23. package/dist/components/auth/SolidOTPVerify.tsx +133 -0
  24. package/dist/components/auth/SolidRegister.tsx +454 -0
  25. package/dist/components/auth/SolidResetPassword.tsx +194 -0
  26. package/dist/components/common/AuthBanner.tsx +41 -0
  27. package/dist/components/common/AutoCompleteField.tsx +79 -0
  28. package/dist/components/common/BackButton.tsx +72 -0
  29. package/dist/components/common/CancelButton.tsx +61 -0
  30. package/dist/components/common/CodeEditor.tsx +38 -0
  31. package/dist/components/common/CreateButton.tsx +17 -0
  32. package/dist/components/common/DownloadProgressToast.tsx +55 -0
  33. package/dist/components/common/DropzonePlaceholder.tsx +31 -0
  34. package/dist/components/common/DropzoneUpload.tsx +11 -0
  35. package/dist/components/common/FileReaderExt.tsx +20 -0
  36. package/dist/components/common/GeneralSettings.tsx +1225 -0
  37. package/dist/components/common/HeaderDynamicTitles.tsx +13 -0
  38. package/dist/components/common/MarkdownViewer.tsx +84 -0
  39. package/dist/components/common/MultipleSelectAutoCompleteField.tsx +64 -0
  40. package/dist/components/common/NotFound.tsx +22 -0
  41. package/dist/components/common/SingleSelectAutoCompleteField.tsx +73 -0
  42. package/dist/components/common/SocialMediaLogin.tsx +53 -0
  43. package/dist/components/common/SolidAdmin.tsx +6 -0
  44. package/dist/components/common/SolidBreadcrumb.tsx +129 -0
  45. package/dist/components/common/SolidExport.tsx +563 -0
  46. package/dist/components/common/SolidExportStepper.tsx +135 -0
  47. package/dist/components/common/SolidFieldTooltip.tsx +23 -0
  48. package/dist/components/common/SolidFormHeader.tsx +25 -0
  49. package/dist/components/common/SolidFormStepper.tsx +350 -0
  50. package/dist/components/common/SolidModuleHome.tsx +128 -0
  51. package/dist/components/common/SolidPopupContainer.tsx +37 -0
  52. package/dist/components/common/SolidSettings/LlmSettings/AnthropicProviderComponent.tsx +45 -0
  53. package/dist/components/common/SolidSettings/LlmSettings/OpenAiProviderComponent.tsx +45 -0
  54. package/dist/components/common/SolidSettings/SettingDropzoneActivePlaceholder.tsx +20 -0
  55. package/dist/components/common/SolidSettings/SettingsImageRemoveButton.tsx +15 -0
  56. package/dist/components/common/SolidSettings/SolidUploadedImage.tsx +16 -0
  57. package/dist/components/common/SolidThemeLink.tsx +6 -0
  58. package/dist/components/common/SolidThemeProvider.tsx +44 -0
  59. package/dist/components/common/StepperArrows/ActiveArrowStep.tsx +18 -0
  60. package/dist/components/common/StepperArrows/ActiveBeforeStepArrow.tsx +18 -0
  61. package/dist/components/common/StepperArrows/InactiveStepArrow.tsx +19 -0
  62. package/dist/components/common/error.tsx +30 -0
  63. package/dist/components/common/useHandleFormCustomButtonClick.ts +40 -0
  64. package/dist/components/common/useHandleListCustomButtonClick.ts +42 -0
  65. package/dist/components/core/chatter/SolidChatter.tsx +248 -0
  66. package/dist/components/core/chatter/SolidChatterAuditMessage.tsx +35 -0
  67. package/dist/components/core/chatter/SolidChatterCustomMessage.tsx +46 -0
  68. package/dist/components/core/chatter/SolidChatterDateDivider.tsx +16 -0
  69. package/dist/components/core/chatter/SolidChatterHeader.tsx +218 -0
  70. package/dist/components/core/chatter/SolidChatterMessageBox.tsx +163 -0
  71. package/dist/components/core/chatter/SolidMessageComposer.tsx +146 -0
  72. package/dist/components/core/common/AvatarWidget.tsx +55 -0
  73. package/dist/components/core/common/DateFieldViewComponent.tsx +36 -0
  74. package/dist/components/core/common/FilterComponent.tsx +458 -0
  75. package/dist/components/core/common/LoadDynamicJsxComponent.tsx +70 -0
  76. package/dist/components/core/common/PDFViewer.tsx +117 -0
  77. package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.tsx +89 -0
  78. package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.tsx +188 -0
  79. package/dist/components/core/common/SolidAccountSettings/SolidNotifications.tsx +139 -0
  80. package/dist/components/core/common/SolidAccountSettings/SolidPersonalInfo.tsx +311 -0
  81. package/dist/components/core/common/SolidCreateButton.tsx +48 -0
  82. package/dist/components/core/common/SolidGenericImport/DocumentSvg.tsx +15 -0
  83. package/dist/components/core/common/SolidGenericImport/SolidGenericImport.tsx +64 -0
  84. package/dist/components/core/common/SolidGenericImport/SolidImportDropzone.tsx +125 -0
  85. package/dist/components/core/common/SolidGenericImport/SolidImportInstructions.tsx +122 -0
  86. package/dist/components/core/common/SolidGenericImport/SolidImportStepper.tsx +217 -0
  87. package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.tsx +205 -0
  88. package/dist/components/core/common/SolidGenericImport/SolidImportTransactionStatus.tsx +158 -0
  89. package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.tsx +29 -0
  90. package/dist/components/core/common/SolidGlobalSearchElement.tsx +1470 -0
  91. package/dist/components/core/common/SolidLayoutViews.tsx +87 -0
  92. package/dist/components/core/common/SolidListViewOptions.tsx +31 -0
  93. package/dist/components/core/common/SolidLoaders/SolidCircularLoader.tsx +7 -0
  94. package/dist/components/core/common/SolidPasswordHelperText.tsx +34 -0
  95. package/dist/components/core/common/SolidSaveCustomFilterForm.tsx +75 -0
  96. package/dist/components/core/common/SolidSearchBox.tsx +17 -0
  97. package/dist/components/core/common/SolidViewLayoutManager.ts +421 -0
  98. package/dist/components/core/common/SolidXAiIframe.tsx +77 -0
  99. package/dist/components/core/dashboard/SolidDashboard.tsx +332 -0
  100. package/dist/components/core/dashboard/SolidDashboardBody.tsx +117 -0
  101. package/dist/components/core/dashboard/SolidDashboardFilterRequired.tsx +28 -0
  102. package/dist/components/core/dashboard/SolidDashboardHeader.tsx +10 -0
  103. package/dist/components/core/dashboard/SolidDashboardLoading.tsx +55 -0
  104. package/dist/components/core/dashboard/SolidDashboardNotAvailable.tsx +32 -0
  105. package/dist/components/core/dashboard/SolidDashboardRenderError.tsx +29 -0
  106. package/dist/components/core/dashboard/SolidDashboardVariable.tsx +256 -0
  107. package/dist/components/core/dashboard/SolidQuestionRenderer.tsx +78 -0
  108. package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.tsx +18 -0
  109. package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.tsx +54 -0
  110. package/dist/components/core/dashboard/chart-renderers/init-chartjs.ts +25 -0
  111. package/dist/components/core/dashboard/dashboard-utils.ts +39 -0
  112. package/dist/components/core/extension/solid-core/CustomIcon/StatusIcon.tsx +17 -0
  113. package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.tsx +36 -0
  114. package/dist/components/core/extension/solid-core/emailTemplate/emailFormTypeChangeHandler.ts +18 -0
  115. package/dist/components/core/extension/solid-core/emailTemplate/emailFormTypeLoad.ts +18 -0
  116. package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx +114 -0
  117. package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx +213 -0
  118. package/dist/components/core/extension/solid-core/moduleMetadata/list/DeleteModuleRowAction.tsx +138 -0
  119. package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.tsx +209 -0
  120. package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx +131 -0
  121. package/dist/components/core/field/FieldListViewData.tsx +313 -0
  122. package/dist/components/core/filter/SolidBooleanFilterElement.tsx +30 -0
  123. package/dist/components/core/filter/SolidFilterFields.tsx +131 -0
  124. package/dist/components/core/filter/SolidManyToManyFilterElement.tsx +64 -0
  125. package/dist/components/core/filter/SolidManyToOneFilterElement.tsx +61 -0
  126. package/dist/components/core/filter/SolidSelectionDynamicFilterElement.tsx +50 -0
  127. package/dist/components/core/filter/SolidSelectionStaticFilterElement.tsx +32 -0
  128. package/dist/components/core/filter/SolidVarInputsFilterElement.tsx +209 -0
  129. package/dist/components/core/filter/fields/SolidBigintField.tsx +9 -0
  130. package/dist/components/core/filter/fields/SolidBooleanField.tsx +68 -0
  131. package/dist/components/core/filter/fields/SolidComputedField.tsx +23 -0
  132. package/dist/components/core/filter/fields/SolidDateField.tsx +63 -0
  133. package/dist/components/core/filter/fields/SolidDatetimeField.tsx +54 -0
  134. package/dist/components/core/filter/fields/SolidDecimalField.tsx +9 -0
  135. package/dist/components/core/filter/fields/SolidExternalIdField.tsx +52 -0
  136. package/dist/components/core/filter/fields/SolidFloatField.tsx +9 -0
  137. package/dist/components/core/filter/fields/SolidIdField.tsx +46 -0
  138. package/dist/components/core/filter/fields/SolidIntField.tsx +61 -0
  139. package/dist/components/core/filter/fields/SolidLongTextField.tsx +9 -0
  140. package/dist/components/core/filter/fields/SolidMediaMultipleField.tsx +60 -0
  141. package/dist/components/core/filter/fields/SolidMediaSingleField.tsx +62 -0
  142. package/dist/components/core/filter/fields/SolidRelationField.tsx +17 -0
  143. package/dist/components/core/filter/fields/SolidRichTextField.tsx +9 -0
  144. package/dist/components/core/filter/fields/SolidSelectionDynamicField.tsx +52 -0
  145. package/dist/components/core/filter/fields/SolidSelectionStaticField.tsx +54 -0
  146. package/dist/components/core/filter/fields/SolidShortTextField.tsx +60 -0
  147. package/dist/components/core/filter/fields/SolidTimeField.tsx +48 -0
  148. package/dist/components/core/filter/fields/SolidUuidField.tsx +51 -0
  149. package/dist/components/core/filter/fields/relations/SolidRelationManyToManyField.tsx +62 -0
  150. package/dist/components/core/filter/fields/relations/SolidRelationManyToOneField.tsx +84 -0
  151. package/dist/components/core/form/SolidFormActionHeader.tsx +497 -0
  152. package/dist/components/core/form/SolidFormFieldRender.tsx +53 -0
  153. package/dist/components/core/form/SolidFormFieldRenderExtension.tsx +26 -0
  154. package/dist/components/core/form/SolidFormFooter.tsx +162 -0
  155. package/dist/components/core/form/SolidFormLayouts.tsx +104 -0
  156. package/dist/components/core/form/SolidFormUserViewLayout.tsx +84 -0
  157. package/dist/components/core/form/SolidFormView.tsx +1856 -0
  158. package/dist/components/core/form/SolidFormViewContextMenuHeaderButton.tsx +52 -0
  159. package/dist/components/core/form/SolidFormViewNormalHeaderButton.tsx +52 -0
  160. package/dist/components/core/form/SolidFormViewShimmerLoading.tsx +109 -0
  161. package/dist/components/core/form/fields/ISolidField.tsx +71 -0
  162. package/dist/components/core/form/fields/SolidBooleanField.tsx +434 -0
  163. package/dist/components/core/form/fields/SolidDateField.tsx +247 -0
  164. package/dist/components/core/form/fields/SolidDateTimeField.tsx +229 -0
  165. package/dist/components/core/form/fields/SolidDecimalField.tsx +171 -0
  166. package/dist/components/core/form/fields/SolidEmailField.tsx +176 -0
  167. package/dist/components/core/form/fields/SolidIntegerField.tsx +282 -0
  168. package/dist/components/core/form/fields/SolidJsonField.tsx +185 -0
  169. package/dist/components/core/form/fields/SolidLongTextField.tsx +618 -0
  170. package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +663 -0
  171. package/dist/components/core/form/fields/SolidMediaSingleField.tsx +547 -0
  172. package/dist/components/core/form/fields/SolidPasswordField.tsx +390 -0
  173. package/dist/components/core/form/fields/SolidRelationField.tsx +56 -0
  174. package/dist/components/core/form/fields/SolidRichTextField.tsx +188 -0
  175. package/dist/components/core/form/fields/SolidSelectionDynamicField.tsx +340 -0
  176. package/dist/components/core/form/fields/SolidSelectionStaticField.tsx +462 -0
  177. package/dist/components/core/form/fields/SolidShortTextField.tsx +399 -0
  178. package/dist/components/core/form/fields/SolidTimeField.tsx +245 -0
  179. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +453 -0
  180. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +1036 -0
  181. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +627 -0
  182. package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.tsx +38 -0
  183. package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.ts +64 -0
  184. package/dist/components/core/form/fields/widgets/SolidAiInteractionMessageFieldFormWidget.tsx +135 -0
  185. package/dist/components/core/form/fields/widgets/SolidAiInteractionMetadataFieldFormWidget.tsx +144 -0
  186. package/dist/components/core/form/fields/widgets/SolidIconEditWidget.tsx +265 -0
  187. package/dist/components/core/form/fields/widgets/SolidIconViewWidget.tsx +32 -0
  188. package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.tsx +50 -0
  189. package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.tsx +222 -0
  190. package/dist/components/core/form/fields/widgets/SolidShortTextFieldAvatarWidget.tsx +70 -0
  191. package/dist/components/core/form/widgets/CustomHtml.tsx +20 -0
  192. package/dist/components/core/kanban/KanbanBoard.tsx +150 -0
  193. package/dist/components/core/kanban/KanbanCard.tsx +279 -0
  194. package/dist/components/core/kanban/KanbanColumn.tsx +139 -0
  195. package/dist/components/core/kanban/KanbanUserViewLayout.tsx +84 -0
  196. package/dist/components/core/kanban/SolidKanbanView.tsx +894 -0
  197. package/dist/components/core/kanban/SolidKanbanViewConfigure.tsx +154 -0
  198. package/dist/components/core/kanban/SolidKanbanViewFields.tsx +164 -0
  199. package/dist/components/core/kanban/SolidManyToOneFilterElement.tsx +59 -0
  200. package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.tsx +50 -0
  201. package/dist/components/core/kanban/SolidSelectionStaticFilterElement.tsx +32 -0
  202. package/dist/components/core/kanban/SolidVarInputsFilterElement.tsx +184 -0
  203. package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.tsx +9 -0
  204. package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.tsx +16 -0
  205. package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.tsx +23 -0
  206. package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.tsx +14 -0
  207. package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.tsx +13 -0
  208. package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.tsx +9 -0
  209. package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.tsx +12 -0
  210. package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.tsx +9 -0
  211. package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.tsx +14 -0
  212. package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.tsx +20 -0
  213. package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.tsx +9 -0
  214. package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx +140 -0
  215. package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +164 -0
  216. package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.tsx +13 -0
  217. package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.tsx +9 -0
  218. package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.tsx +14 -0
  219. package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.tsx +14 -0
  220. package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +121 -0
  221. package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.tsx +12 -0
  222. package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.tsx +13 -0
  223. package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx +16 -0
  224. package/dist/components/core/list/ListViewRowActionPopup.tsx +41 -0
  225. package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.tsx +242 -0
  226. package/dist/components/core/list/SolidEmptyListViewPlaceholder.tsx +111 -0
  227. package/dist/components/core/list/SolidListView.tsx +2007 -0
  228. package/dist/components/core/list/SolidListViewColumn.tsx +165 -0
  229. package/dist/components/core/list/SolidListViewConfigure.tsx +339 -0
  230. package/dist/components/core/list/SolidListViewHeaderButton.tsx +31 -0
  231. package/dist/components/core/list/SolidListViewHeaderContextMenuButton.tsx +30 -0
  232. package/dist/components/core/list/SolidListViewRowButtonContextMenu.tsx +41 -0
  233. package/dist/components/core/list/SolidListViewShimmerLoading.tsx +78 -0
  234. package/dist/components/core/list/SolidListingHeader.tsx +42 -0
  235. package/dist/components/core/list/SolidManyToOneFilterElement.tsx +60 -0
  236. package/dist/components/core/list/SolidSelectionDynamicFilterElement.tsx +50 -0
  237. package/dist/components/core/list/SolidSelectionStaticFilterElement.tsx +32 -0
  238. package/dist/components/core/list/SolidTableRowCell.tsx +35 -0
  239. package/dist/components/core/list/SolidVarInputsFilterElement.tsx +184 -0
  240. package/dist/components/core/list/columns/SolidBigintColumn.tsx +9 -0
  241. package/dist/components/core/list/columns/SolidBooleanColumn.tsx +90 -0
  242. package/dist/components/core/list/columns/SolidComputedColumn.tsx +27 -0
  243. package/dist/components/core/list/columns/SolidDateColumn.tsx +90 -0
  244. package/dist/components/core/list/columns/SolidDatetimeColumn.tsx +79 -0
  245. package/dist/components/core/list/columns/SolidDecimalColumn.tsx +9 -0
  246. package/dist/components/core/list/columns/SolidExternalIdColumn.tsx +80 -0
  247. package/dist/components/core/list/columns/SolidFloatColumn.tsx +9 -0
  248. package/dist/components/core/list/columns/SolidIdColumn.tsx +79 -0
  249. package/dist/components/core/list/columns/SolidIntColumn.tsx +87 -0
  250. package/dist/components/core/list/columns/SolidLongTextColumn.tsx +9 -0
  251. package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +301 -0
  252. package/dist/components/core/list/columns/SolidMediaSingleColumn.tsx +170 -0
  253. package/dist/components/core/list/columns/SolidRelationColumn.tsx +21 -0
  254. package/dist/components/core/list/columns/SolidRichTextColumn.tsx +9 -0
  255. package/dist/components/core/list/columns/SolidSelectionDynamicColumn.tsx +80 -0
  256. package/dist/components/core/list/columns/SolidSelectionStaticColumn.tsx +81 -0
  257. package/dist/components/core/list/columns/SolidShortTextColumn.tsx +160 -0
  258. package/dist/components/core/list/columns/SolidTimeColumn.tsx +78 -0
  259. package/dist/components/core/list/columns/SolidUuidColumn.tsx +79 -0
  260. package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.tsx +106 -0
  261. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +117 -0
  262. package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.tsx +110 -0
  263. package/dist/components/core/list/widgets/SolidManyToManyRelationAvatarListWidget.tsx +30 -0
  264. package/dist/components/core/list/widgets/SolidManyToOneRelationAvatarListWidget.tsx +30 -0
  265. package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.tsx +70 -0
  266. package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.tsx +21 -0
  267. package/dist/components/core/locales/SolidChatterLocaleTabView.tsx +91 -0
  268. package/dist/components/core/locales/SolidLocale.tsx +127 -0
  269. package/dist/components/core/model/CreateModel.tsx +495 -0
  270. package/dist/components/core/model/FieldMetaData.tsx +263 -0
  271. package/dist/components/core/model/FieldMetaDataForm.tsx +3509 -0
  272. package/dist/components/core/model/FieldSelector.tsx +62 -0
  273. package/dist/components/core/model/ModelListViewData.tsx +384 -0
  274. package/dist/components/core/model/ModelMetaData.tsx +921 -0
  275. package/dist/components/core/module/CreateModule.tsx +617 -0
  276. package/dist/components/core/module/ModuleListViewData.tsx +431 -0
  277. package/dist/components/core/solid-ai/SolidAiMainWrapper.tsx +8 -0
  278. package/dist/components/core/solid-ai/SolidXAIIcon.tsx +37 -0
  279. package/dist/components/core/users/CreateUser.tsx +467 -0
  280. package/dist/components/core/users/CreateUserRole.tsx +212 -0
  281. package/dist/components/core/users/UserListView.tsx +376 -0
  282. package/dist/components/layout/AdminLayout.tsx +57 -0
  283. package/dist/components/layout/AdminSidebar.tsx +65 -0
  284. package/dist/components/layout/AppConfig.tsx +104 -0
  285. package/dist/components/layout/AppSidebar.tsx +232 -0
  286. package/dist/components/layout/ButtonLoader.tsx +7 -0
  287. package/dist/components/layout/CustomPagination.tsx +55 -0
  288. package/dist/components/layout/DashboardHeader.tsx +89 -0
  289. package/dist/components/layout/FilterMenu.tsx +122 -0
  290. package/dist/components/layout/Footer.tsx +13 -0
  291. package/dist/components/layout/GlobalSearch.tsx +37 -0
  292. package/dist/components/layout/Header.tsx +8 -0
  293. package/dist/components/layout/Layout.tsx +205 -0
  294. package/dist/components/layout/ListingHeader.tsx +204 -0
  295. package/dist/components/layout/Loader.tsx +16 -0
  296. package/dist/components/layout/UserSidebar.tsx +53 -0
  297. package/dist/components/layout/context/layoutcontext.tsx +52 -0
  298. package/dist/components/layout/navbar-one.tsx +258 -0
  299. package/dist/components/layout/navbar-two-menu.tsx +72 -0
  300. package/dist/components/layout/navbar-two.tsx +37 -0
  301. package/dist/components/layout/user-profile-menu.tsx +213 -0
  302. package/dist/components/layout/user-profile.tsx +7 -0
  303. package/dist/components/modelsComponents/filterIcon.tsx +9 -0
  304. package/dist/constants/error-messages.ts +238 -0
  305. package/dist/declarations.d.ts +22 -0
  306. package/dist/helpers/AppTitle.tsx +12 -0
  307. package/dist/helpers/ToastContainer.tsx +94 -0
  308. package/dist/helpers/autoCompleteVirtualScroll.ts +41 -0
  309. package/dist/helpers/countries.tsx +260 -0
  310. package/dist/helpers/downloadFileWithProgress.ts +91 -0
  311. package/dist/helpers/downloadMediaFile.tsx +21 -0
  312. package/dist/helpers/getAcceptedFileTypes.tsx +22 -0
  313. package/dist/helpers/getRandomColors.tsx +68 -0
  314. package/dist/helpers/helpers.ts +61 -0
  315. package/dist/helpers/hydrateRelationRules.ts +120 -0
  316. package/dist/helpers/permissions.ts +7 -0
  317. package/dist/helpers/registry.ts +337 -0
  318. package/dist/helpers/resendOtpHelper.tsx +5 -0
  319. package/dist/helpers/revalidate.ts +7 -0
  320. package/dist/helpers/rolesHelper.ts +17 -0
  321. package/dist/helpers/solidIcons.tsx +1831 -0
  322. package/dist/helpers/updatePasswordField.ts +41 -0
  323. package/dist/index.ts +421 -0
  324. package/dist/nextAuth/authProviders.d.ts.map +1 -1
  325. package/dist/nextAuth/authProviders.js +6 -5
  326. package/dist/nextAuth/authProviders.js.map +1 -1
  327. package/dist/nextAuth/authProviders.tsx +232 -0
  328. package/dist/nextAuth/handleLogout.tsx +39 -0
  329. package/dist/nextAuth/refreshAccessToken.tsx +28 -0
  330. package/dist/redux/api/aiInteractionApi.ts +59 -0
  331. package/dist/redux/api/authApi.ts +131 -0
  332. package/dist/redux/api/dashboardApi.ts +56 -0
  333. package/dist/redux/api/dashboardQuestionApi.ts +17 -0
  334. package/dist/redux/api/exportTemplateApi.tsx +59 -0
  335. package/dist/redux/api/fetchBaseQuery.tsx +118 -0
  336. package/dist/redux/api/fieldApi.ts +86 -0
  337. package/dist/redux/api/importTransactionApi.tsx +69 -0
  338. package/dist/redux/api/mediaApi.ts +55 -0
  339. package/dist/redux/api/mediaStorageProviderApi.ts +55 -0
  340. package/dist/redux/api/modelApi.ts +80 -0
  341. package/dist/redux/api/moduleApi.ts +72 -0
  342. package/dist/redux/api/permissionApi.ts +32 -0
  343. package/dist/redux/api/pincodeApi.tsx +56 -0
  344. package/dist/redux/api/roleApi.ts +58 -0
  345. package/dist/redux/api/solidActionApi.ts +66 -0
  346. package/dist/redux/api/solidChatterMessageApi.ts +25 -0
  347. package/dist/redux/api/solidEntityApi.tsx +164 -0
  348. package/dist/redux/api/solidMenuApi.ts +71 -0
  349. package/dist/redux/api/solidServiceApi.ts +31 -0
  350. package/dist/redux/api/solidSettingsApi.tsx +83 -0
  351. package/dist/redux/api/solidViewApi.ts +73 -0
  352. package/dist/redux/api/stateApi.tsx +56 -0
  353. package/dist/redux/api/testApi.ts +21 -0
  354. package/dist/redux/api/userApi.ts +135 -0
  355. package/dist/redux/features/authSlice.ts +19 -0
  356. package/dist/redux/features/dataViewSlice.ts +26 -0
  357. package/dist/redux/features/navbarSlice.ts +21 -0
  358. package/dist/redux/features/popupSlice.ts +37 -0
  359. package/dist/redux/features/settingsSlice.ts +60 -0
  360. package/dist/redux/features/themeSlice.ts +17 -0
  361. package/dist/redux/features/userSlice.ts +28 -0
  362. package/dist/redux/hooks/useSolidPopup.ts +20 -0
  363. package/dist/redux/store/defaultStoreConfig.ts +62 -0
  364. package/dist/styles.ts +4 -0
  365. package/dist/types/handlebars.d.ts +4 -0
  366. package/dist/types/index.d.ts +76 -0
  367. package/dist/types/layout.d.ts +94 -0
  368. package/dist/types/next-auth.d.ts +0 -0
  369. package/dist/types/next.d.ts +46 -0
  370. package/dist/types/solid-core.d.ts +320 -0
  371. package/package.json +1 -1
  372. package/src/components/auth/SolidLogin.tsx +26 -13
  373. package/src/nextAuth/authProviders.tsx +9 -5
@@ -0,0 +1,1036 @@
1
+ 'use client';
2
+ import { createSolidEntityApi } from "../../../../../redux/api/solidEntityApi";
3
+ import { AutoComplete, AutoCompleteCompleteEvent } from "primereact/autocomplete";
4
+ import { Message } from "primereact/message";
5
+ import qs from "qs";
6
+ import { useEffect, useRef, useState } from "react";
7
+ import * as Yup from 'yup';
8
+ import { FormikObject, ISolidField, SolidFieldProps } from "../ISolidField";
9
+ import { camelCase } from "lodash";
10
+ import { Button } from "primereact/button";
11
+ import { Dialog } from "primereact/dialog";
12
+ import SolidFormView from '../../../../../components/core/form/SolidFormView';
13
+ import { getExtensionComponent } from "../../../../../helpers/registry";
14
+ import { SolidFormFieldWidgetProps } from "../../../../../types/solid-core";
15
+ // import Handlebars from "handlebars/dist/handlebars";
16
+ import * as Handlebars from "handlebars";
17
+ import { Toast } from "primereact/toast";
18
+ import { SolidFieldTooltip } from "../../../../../components/common/SolidFieldTooltip";
19
+ import { ERROR_MESSAGES } from "../../../../../constants/error-messages";
20
+ import { getVirtualScrollerOptions } from "../../../../../helpers/autoCompleteVirtualScroll";
21
+
22
+
23
+ export type FormViewParams = {
24
+ moduleName: any;
25
+ modelName: any;
26
+ id: any;
27
+ embeded: any;
28
+ inlineCreateAutoSave: any;
29
+ layout: any;
30
+ }
31
+
32
+ export class SolidRelationManyToOneField implements ISolidField {
33
+
34
+ private fieldContext: SolidFieldProps;
35
+
36
+ constructor(fieldContext: SolidFieldProps) {
37
+ this.fieldContext = fieldContext;
38
+ }
39
+
40
+ initialValue(): any {
41
+
42
+ const manyToOneFieldData = this.fieldContext?.data[this.fieldContext?.field?.attrs?.name];
43
+ const fieldMetadata = this.fieldContext?.fieldMetadata;
44
+ const userKeyField = fieldMetadata?.relationModel?.userKeyField?.name;
45
+ const manyToOneColVal = manyToOneFieldData ? manyToOneFieldData[userKeyField] : '';
46
+ if (manyToOneColVal) {
47
+ return { solidManyToOneLabel: manyToOneColVal || '', solidManyToOneValue: manyToOneFieldData?.id || '', ...manyToOneFieldData };
48
+ }
49
+ if (this.fieldContext.parentData) {
50
+ const parentDataForKey = this.fieldContext.parentData[userKeyField];
51
+ if (parentDataForKey && typeof parentDataForKey === 'object') {
52
+ const [key, value]: any = Object.entries(this.fieldContext.parentData)[0] || [];
53
+ if (key && value !== undefined) {
54
+ return { solidManyToOneLabel: value.solidManyToOneLabel, solidManyToOneValue: value.solidManyToOneValue };
55
+ }
56
+ }
57
+ }
58
+ return {}
59
+ }
60
+
61
+ updateFormData(value: any, formData: FormData): any {
62
+ const fieldLayoutInfo = this.fieldContext.field;
63
+ if (value?.solidManyToOneValue) {
64
+ formData.append(`${fieldLayoutInfo.attrs.name}Id`, value.solidManyToOneValue);
65
+ }
66
+ }
67
+
68
+ validationSchema(): Yup.Schema {
69
+ const fieldMetadata = this.fieldContext.fieldMetadata;
70
+ const fieldLayoutInfo = this.fieldContext.field;
71
+ const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
72
+
73
+ let schema = Yup.mixed();
74
+ // Custom validation for relation field
75
+ if (fieldMetadata.required) {
76
+ schema = schema.test(
77
+ ERROR_MESSAGES.REQUIRED_REALTION,
78
+ ERROR_MESSAGES.FIELD_REUQIRED(fieldLabel),
79
+ function (value: any) {
80
+ // Handle empty values
81
+ if (!value) return false;
82
+
83
+ // If it's an object with solidManyToOneValue, check if it's valid
84
+ if (typeof value === 'object' && value !== null && (value as any).solidManyToOneValue) {
85
+ return true;
86
+ }
87
+
88
+ // If it's a string (user typed but didn't select), it's invalid for required field
89
+ if (typeof value === 'string') {
90
+ return false;
91
+ }
92
+
93
+ return false;
94
+ }
95
+ );
96
+ }
97
+
98
+ // Add validation to ensure valid selection
99
+ schema = schema.test(
100
+ ERROR_MESSAGES.VALIDATE_SELECTION,
101
+ ERROR_MESSAGES.SELECT_VALID_FROM_DROPDOWN(fieldLabel),
102
+ function (value: any) {
103
+ // If not required and empty, it's valid
104
+ if (!fieldMetadata.required && (!value || value === '')) {
105
+ return true;
106
+ }
107
+
108
+ // If it's an object with solidManyToOneValue, it's a valid selection
109
+ if (typeof value === 'object' && value !== null && (value as any).solidManyToOneValue) {
110
+ return true;
111
+ }
112
+
113
+ // If it's a string (user typed but didn't select), it's invalid
114
+ if (typeof value === 'string' && value.trim() !== '') {
115
+ return false;
116
+ }
117
+
118
+ // Empty value for non-required field
119
+ return !fieldMetadata.required;
120
+ }
121
+ );
122
+
123
+ return schema;
124
+ }
125
+
126
+
127
+ render(formik: FormikObject) {
128
+ const fieldMetadata = this.fieldContext.fieldMetadata;
129
+ const fieldLayoutInfo = this.fieldContext.field;
130
+ const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
131
+ const className = fieldLayoutInfo.attrs?.className || 'field col-12';
132
+
133
+ const isVisible = this.fieldContext.parentData
134
+ ? fieldLayoutInfo.attrs?.visible === true
135
+ : fieldLayoutInfo.attrs?.visible !== false;
136
+
137
+ if (!isVisible) {
138
+ return null;
139
+ }
140
+
141
+ let viewWidget = fieldLayoutInfo.attrs.viewWidget;
142
+ let editWidget = fieldLayoutInfo.attrs.editWidget;
143
+ if (!editWidget) {
144
+ editWidget = 'DefaultRelationManyToOneFormEditWidget';
145
+ }
146
+ if (!viewWidget) {
147
+ viewWidget = 'DefaultRelationManyToOneFormViewWidget';
148
+ }
149
+ const viewMode: string = this.fieldContext.viewMode;
150
+ return (
151
+ <>
152
+ <div className={className}>
153
+
154
+ {viewMode === "view" &&
155
+ this.renderExtensionRenderMode(viewWidget, formik)
156
+ }
157
+ {viewMode === "edit" && (
158
+ <>
159
+ {editWidget &&
160
+ this.renderExtensionRenderMode(editWidget, formik)
161
+ }
162
+ </>
163
+ )
164
+ }
165
+ </div>
166
+ </>
167
+ );
168
+ }
169
+
170
+ renderExtensionRenderMode(widget: string, formik: FormikObject) {
171
+ let DynamicWidget = getExtensionComponent(widget);
172
+ const widgetProps: SolidFormFieldWidgetProps = {
173
+ formik: formik,
174
+ fieldContext: this.fieldContext,
175
+ }
176
+ return (
177
+ <>
178
+ {DynamicWidget && <DynamicWidget {...widgetProps} />}
179
+ </>
180
+ )
181
+ }
182
+ }
183
+
184
+ export const DefaultRelationManyToOneFormEditWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
185
+ const toast = useRef<Toast>(null);
186
+
187
+ const fieldMetadata = fieldContext.fieldMetadata;
188
+ const fieldLayoutInfo = fieldContext.field;
189
+ const className = fieldLayoutInfo.attrs?.className || 'field col-12';
190
+ const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
191
+ const solidFormViewMetaData = fieldContext.solidFormViewMetaData;
192
+ const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
193
+ const readOnlyPermission = fieldContext.readOnly;
194
+ const [visibleCreateRelationEntity, setvisibleCreateRelationEntity] = useState(false);
195
+ const [formViewParams, setformViewParams] = useState<FormViewParams>()
196
+
197
+ const showToast = (severity: "success" | "error", summary: string, detail: string) => {
198
+ toast.current?.show({
199
+ severity,
200
+ summary,
201
+ detail,
202
+ ...(severity === "error"
203
+ ? { sticky: true } // stays until user closes
204
+ : { life: 3000 }),
205
+ });
206
+ };
207
+ // auto complete specific code.
208
+ const entityApi = createSolidEntityApi(fieldMetadata.relationCoModelSingularName);
209
+ const { useLazyGetSolidEntitiesQuery } = entityApi;
210
+ const [triggerGetSolidEntities] = useLazyGetSolidEntitiesQuery();
211
+
212
+ const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
213
+ const fieldReadonly = fieldLayoutInfo.attrs?.readonly;
214
+
215
+ const formDisabled = solidFormViewMetaData.data.solidView?.layout?.attrs?.disabled;
216
+ const formReadonly = solidFormViewMetaData.data.solidView?.layout?.attrs?.readonly;
217
+ const whereClause = fieldLayoutInfo.attrs.whereClause;
218
+
219
+ const [autoCompleteItems, setAutoCompleteItems] = useState<any[]>([]);
220
+ const [offset, setOffset] = useState(0);
221
+ const [hasMore, setHasMore] = useState(true);
222
+ const [currentQuery, setCurrentQuery] = useState("");
223
+ const LIMIT = 50;
224
+ const [loading, setLoading] = useState(false);
225
+
226
+ useEffect(() => {
227
+ const formviewparams: FormViewParams = {
228
+ moduleName: fieldContext.fieldMetadata.relationModelModuleName,
229
+ modelName: camelCase(fieldContext.fieldMetadata.relationCoModelSingularName),
230
+ id: "new",
231
+ embeded: true,
232
+ inlineCreateAutoSave: fieldLayoutInfo?.attrs?.inlineCreateAutoSave,
233
+ layout: fieldLayoutInfo?.attrs?.inlineCreateLayout
234
+ }
235
+ setformViewParams(formviewparams);
236
+ }, [])
237
+
238
+ const autoCompleteSearch = async (event: AutoCompleteCompleteEvent) => {
239
+ setOffset(0);
240
+ setCurrentQuery(event.query || "");
241
+ setHasMore(true);
242
+ // Get the list view layout & metadata first.
243
+ const queryData = {
244
+ offset: 0,
245
+ limit: LIMIT,
246
+ filters: {
247
+ $and: [
248
+ {
249
+ [fieldMetadata?.relationModel?.userKeyField?.name]: {
250
+ [fieldLayoutInfo?.attrs?.autocompleteMatchMode || '$containsi']: event.query
251
+ }
252
+ }
253
+ ]
254
+ }
255
+ };
256
+ let fixedFilterToBeApplied = false;
257
+ let fixedFilterParsed = false;
258
+ if (solidFormViewMetaData?.data?.solidView?.model?.singularName === "listOfValues" && fieldContext.fieldMetadata.relationCoModelSingularName !== "moduleMetadata") {
259
+ fixedFilterToBeApplied = true;
260
+ }
261
+ if (fieldMetadata?.relationFieldFixedFilter || fieldLayoutInfo?.attrs?.whereClause) {
262
+ const convertedFixedFilter = fieldLayoutInfo?.attrs?.whereClause ? fieldLayoutInfo?.attrs?.whereClause : fieldMetadata?.relationFieldFixedFilter;
263
+ fixedFilterToBeApplied = true;
264
+ const fixedFilterTemplate = Handlebars.compile(convertedFixedFilter);
265
+ const renderedFilter = fixedFilterTemplate(formik.values);
266
+
267
+ // Parse the result into a JS object
268
+ let parsedFilter;
269
+ try {
270
+ parsedFilter = JSON.parse(renderedFilter);
271
+ const isValid = (obj: any): boolean => {
272
+ if (!obj || typeof obj !== 'object') return false;
273
+
274
+ // Recursively check all nested values
275
+ const hasValidValue = (val: any): boolean => {
276
+ if (val === null || val === undefined || val === '') return false;
277
+ if (typeof val === 'object') {
278
+ return Object.values(val).some(hasValidValue);
279
+ }
280
+ return true;
281
+ };
282
+
283
+ return hasValidValue(obj);
284
+ };
285
+
286
+ if (isValid(parsedFilter)) {
287
+ queryData.filters.$and.push(parsedFilter);
288
+ fixedFilterParsed = true;
289
+ } else {
290
+ console.warn(ERROR_MESSAGES.SKIPPING_EMPTY_FIXED_FILTER, parsedFilter);
291
+ }
292
+ } catch (e) {
293
+ console.error(ERROR_MESSAGES.INVALID_JSON_WHERECLAUSE, renderedFilter);
294
+ parsedFilter = {}; // fallback or throw error as needed
295
+ }
296
+
297
+ }
298
+
299
+ let autocompleteQs = qs.stringify(queryData, {
300
+ encodeValuesOnly: true,
301
+ });
302
+ // if (whereClause) {
303
+ // autocompleteQs = `${autocompleteQs}&${whereClause}`;
304
+ // }
305
+
306
+
307
+ if (fixedFilterToBeApplied && !fixedFilterParsed) {
308
+ showToast("error", ERROR_MESSAGES.SELECT_RELEVANT_FIELD, ERROR_MESSAGES.FIELD_NOT_SELECT);
309
+
310
+ } else {
311
+ try {
312
+ setLoading(true);
313
+ // TODO: do error handling here, possible errors like modelname is incorrect etc...
314
+ const autocompleteResponse = await triggerGetSolidEntities(autocompleteQs);
315
+
316
+ // TODO: if no data found then can we show no matching "entities", where entities can be replaced with the model plural name,
317
+ const autocompleteData = autocompleteResponse.data;
318
+
319
+ if (autocompleteData) {
320
+ const autoCompleteItems = autocompleteData.records.map((item: any) => {
321
+ return {
322
+ solidManyToOneLabel: item[fieldMetadata?.relationModel?.userKeyField?.name],
323
+ solidManyToOneValue: item['id'],
324
+ ...item,
325
+ }
326
+ });
327
+ setAutoCompleteItems(autoCompleteItems);
328
+ setOffset(autocompleteData.records.length);
329
+ setHasMore(autocompleteData.records.length === LIMIT);
330
+ }
331
+ }
332
+ finally {
333
+ setLoading(false);
334
+ }
335
+ }
336
+
337
+
338
+ }
339
+
340
+ const onLazyLoad = async (event: { first: number; last: number }) => {
341
+ if (!hasMore || loading) return;
342
+ if (event.last < autoCompleteItems.length - 1) return; // Only load if user reaches bottom
343
+
344
+ const queryData = {
345
+ offset: offset,
346
+ limit: LIMIT,
347
+ filters: {
348
+ $and: [
349
+ {
350
+ [fieldMetadata?.relationModel?.userKeyField?.name]: {
351
+ [fieldLayoutInfo?.attrs?.autocompleteMatchMode || '$containsi']: currentQuery
352
+ }
353
+ }
354
+ ]
355
+ }
356
+ };
357
+
358
+ let fixedFilterToBeApplied = false;
359
+ let fixedFilterParsed = false;
360
+ if (solidFormViewMetaData?.data?.solidView?.model?.singularName === "listOfValues" && fieldContext.fieldMetadata.relationCoModelSingularName !== "moduleMetadata") {
361
+ fixedFilterToBeApplied = true;
362
+ }
363
+ if (fieldMetadata?.relationFieldFixedFilter || fieldLayoutInfo?.attrs?.whereClause) {
364
+ const convertedFixedFilter = fieldLayoutInfo?.attrs?.whereClause ? fieldLayoutInfo?.attrs?.whereClause : fieldMetadata?.relationFieldFixedFilter;
365
+ fixedFilterToBeApplied = true;
366
+ const fixedFilterTemplate = Handlebars.compile(convertedFixedFilter);
367
+ const renderedFilter = fixedFilterTemplate(formik.values);
368
+
369
+ // Parse the result into a JS object
370
+ let parsedFilter;
371
+ try {
372
+ parsedFilter = JSON.parse(renderedFilter);
373
+ const isValid = (obj: any): boolean => {
374
+ if (!obj || typeof obj !== 'object') return false;
375
+
376
+ // Recursively check all nested values
377
+ const hasValidValue = (val: any): boolean => {
378
+ if (val === null || val === undefined || val === '') return false;
379
+ if (typeof val === 'object') {
380
+ return Object.values(val).some(hasValidValue);
381
+ }
382
+ return true;
383
+ };
384
+
385
+ return hasValidValue(obj);
386
+ };
387
+
388
+ if (isValid(parsedFilter)) {
389
+ queryData.filters.$and.push(parsedFilter);
390
+ fixedFilterParsed = true;
391
+ } else {
392
+ console.warn(ERROR_MESSAGES.SKIPPING_EMPTY_FIXED_FILTER, parsedFilter);
393
+ }
394
+ } catch (e) {
395
+ console.error(ERROR_MESSAGES.INVALID_JSON_WHERECLAUSE, renderedFilter);
396
+ parsedFilter = {}; // fallback or throw error as needed
397
+ }
398
+
399
+ }
400
+
401
+ const autocompleteQs = qs.stringify(queryData, { encodeValuesOnly: true });
402
+ if (fixedFilterToBeApplied && !fixedFilterParsed) {
403
+ showToast("error", ERROR_MESSAGES.SELECT_RELEVANT_FIELD, ERROR_MESSAGES.FIELD_NOT_SELECT);
404
+
405
+ } else {
406
+ try {
407
+ setLoading(true);
408
+ const response = await triggerGetSolidEntities(autocompleteQs);
409
+ const records = response.data?.records || [];
410
+ if (records.length < LIMIT) setHasMore(false);
411
+ setAutoCompleteItems(prev => [...prev, ...records.map((item: any) => ({
412
+ solidManyToOneLabel: item[fieldMetadata?.relationModel?.userKeyField?.name],
413
+ solidManyToOneValue: item.id,
414
+ ...item
415
+ }))]);
416
+ setOffset(prev => prev + records.length);
417
+ } finally {
418
+ setLoading(false);
419
+ }
420
+ }
421
+ };
422
+
423
+ const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
424
+
425
+ const customCreateHandler = (values: any) => {
426
+ const currentRelationData = formik.values[fieldLayoutInfo.attrs.name] || [];
427
+ const jsonValues = Object.fromEntries(values.entries());
428
+ const updatedRelationData = [
429
+ ...currentRelationData,
430
+ {
431
+ solidManyToOneLabel: jsonValues[fieldMetadata?.relationModel?.userKeyField?.name],
432
+ solidManyToOneValue: "new",
433
+ original: jsonValues,
434
+ },
435
+ ];
436
+
437
+ formik.setFieldValue(fieldLayoutInfo.attrs.name, updatedRelationData);
438
+
439
+ }
440
+ return (
441
+ <div className="relative">
442
+ <Toast ref={toast} />
443
+ <div className="flex flex-column gap-2 mt-1 sm:mt-2 md:mt-3 lg:mt-4">
444
+ {showFieldLabel != false &&
445
+ <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">
446
+ {fieldLabel}
447
+ {fieldMetadata.required && <span className="text-red-500"> *</span>}
448
+ <SolidFieldTooltip fieldContext={fieldContext} />
449
+ </label>
450
+ }
451
+ <div className="flex align-items-center gap-3">
452
+ <AutoComplete
453
+ readOnly={formReadonly || fieldReadonly || readOnlyPermission}
454
+ disabled={formDisabled || fieldDisabled || readOnlyPermission}
455
+ {...formik.getFieldProps(fieldLayoutInfo.attrs.name)}
456
+ id={fieldLayoutInfo.attrs.name}
457
+ field="solidManyToOneLabel"
458
+ value={formik.values[fieldLayoutInfo.attrs.name] || ''}
459
+ dropdown={!readOnlyPermission}
460
+ suggestions={autoCompleteItems}
461
+ completeMethod={autoCompleteSearch}
462
+ onChange={(e) => fieldContext.onChange(e, 'onFieldChange')}
463
+ onFocus={(e) => e.target.select()}
464
+ className="w-full solid-standard-autocomplete"
465
+ // virtualScrollerOptions={{
466
+ // itemSize: 38,
467
+ // lazy: true,
468
+ // onLazyLoad
469
+ // }}
470
+ virtualScrollerOptions={getVirtualScrollerOptions({
471
+ itemsLength: autoCompleteItems.length,
472
+ lazy: true,
473
+ onLazyLoad,
474
+ })}
475
+ />
476
+ {fieldLayoutInfo.attrs.inlineCreate === "true" && readOnlyPermission === false && formViewParams &&
477
+ <RenderSolidFormEmbededView formik={formik} fieldContext={fieldContext} customCreateHandler={customCreateHandler} visibleCreateRelationEntity={visibleCreateRelationEntity} setvisibleCreateRelationEntity={setvisibleCreateRelationEntity} formViewParams={formViewParams}></RenderSolidFormEmbededView>
478
+ }
479
+ </div>
480
+ </div>
481
+ {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
482
+ <div className="absolute mt-1">
483
+ <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
484
+ </div>
485
+ )}
486
+ </div>
487
+ );
488
+ }
489
+
490
+ export const RenderSolidFormEmbededView = ({ formik, fieldContext, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity, formViewParams }: any) => {
491
+ const fieldMetadata = fieldContext.fieldMetadata;
492
+ const fieldLayoutInfo = fieldContext.field;
493
+ const className = fieldLayoutInfo.attrs?.className || 'field col-6 flex flex-column gap-2 mt-1 sm:mt-2 md:mt-3 lg:mt-4';
494
+ const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
495
+ const parentModelName = fieldLayoutInfo?.attrs?.parentModelName;
496
+ const childModelName = fieldLayoutInfo?.attrs?.childModelName;
497
+ const parentFieldName = fieldLayoutInfo?.attrs?.parentFieldName;
498
+ const childFieldName = fieldLayoutInfo?.attrs?.childFieldName;
499
+ const parentModuleName = fieldLayoutInfo?.attrs?.parentModuleName;
500
+
501
+
502
+ const params = {
503
+ moduleName: formViewParams.moduleName,
504
+ modelName: camelCase(formViewParams.modelName),
505
+ id: formViewParams.id,
506
+ embeded: formViewParams.embeded,
507
+ inlineCreateAutoSave: formViewParams.inlineCreateAutoSave,
508
+ layout: formViewParams.layout,
509
+ customCreateHandler: ((values: any) => {
510
+ setvisibleCreateRelationEntity(false);
511
+ customCreateHandler(values)
512
+ }),
513
+ handlePopupClose: (() => {
514
+ setvisibleCreateRelationEntity(false);
515
+ }),
516
+ }
517
+ return (
518
+ <div>
519
+ <div>
520
+ <Button
521
+ icon="pi pi-plus"
522
+ rounded
523
+ outlined
524
+ aria-label="Filter"
525
+ type="button"
526
+ size="small"
527
+ onClick={() => setvisibleCreateRelationEntity(true)}
528
+ className="custom-add-button"
529
+ />
530
+ </div>
531
+ <Dialog
532
+ header=""
533
+ showHeader={false}
534
+ visible={visibleCreateRelationEntity}
535
+ style={{
536
+ width: fieldLayoutInfo?.attrs?.inlineCreateLayout?.attrs?.width ?? "60vw",
537
+ height: fieldLayoutInfo?.attrs?.inlineCreateLayout?.attrs?.height ?? "auto"
538
+ }}
539
+ onHide={() => {
540
+ if (!visibleCreateRelationEntity) return;
541
+ setvisibleCreateRelationEntity(false);
542
+ }}
543
+ className="solid-dialog"
544
+ breakpoints={{ '1199px': '35rem', "767px": '85vw', "550px": '90vw' }}
545
+
546
+ >
547
+ <SolidFormView {...params} />
548
+
549
+ </Dialog>
550
+ </div>
551
+ )
552
+ }
553
+
554
+
555
+ export const DefaultRelationManyToOneFormViewWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
556
+
557
+ const fieldMetadata = fieldContext.fieldMetadata;
558
+ const fieldLayoutInfo = fieldContext.field;
559
+ const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
560
+ const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
561
+ const value = formik.values[fieldLayoutInfo.attrs.name];
562
+ const userKeyField = fieldLayoutInfo?.attrs?.coModelFieldToDisplay ? fieldLayoutInfo?.attrs?.coModelFieldToDisplay : fieldMetadata?.relationModel?.userKeyField?.name;
563
+ const displayValue = value?.[userKeyField];
564
+ return (
565
+ <div className="mt-2 flex-column gap-2">
566
+ {showFieldLabel !== false && (
567
+ <p className="m-0 form-field-label font-medium">{fieldLabel}</p>
568
+ )}
569
+ <p className="m-0">{displayValue}</p>
570
+ </div>
571
+ );
572
+ }
573
+
574
+
575
+
576
+
577
+
578
+ export const PseudoRelationManyToOneFormWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
579
+ const toast = useRef<Toast>(null);
580
+
581
+ const fieldMetadata = fieldContext.fieldMetadata;
582
+ const fieldLayoutInfo = fieldContext.field;
583
+ const className = fieldLayoutInfo.attrs?.className || 'field col-12';
584
+ const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
585
+ const solidFormViewMetaData = fieldContext.solidFormViewMetaData;
586
+ const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
587
+ const readOnlyPermission = fieldContext.readOnly ? fieldContext.readOnly : false;
588
+
589
+ const parentModelName = fieldLayoutInfo?.attrs?.parentModelName;
590
+ const childModelName = fieldLayoutInfo?.attrs?.childModelName;
591
+ const parentFieldName = fieldLayoutInfo?.attrs?.parentFieldName;
592
+ const childFieldName = fieldLayoutInfo?.attrs?.childFieldName;
593
+ const parentModuleName = fieldLayoutInfo?.attrs?.parentModuleName;
594
+ const parentFieldLabels = fieldLayoutInfo?.attrs?.parentFieldLabels;
595
+ const parentSearchFields = fieldLayoutInfo?.attrs?.parentSearchFields;
596
+
597
+ const [formViewParams, setformViewParams] = useState<FormViewParams>()
598
+
599
+ const viewMode: string = fieldContext.viewMode;
600
+
601
+ useEffect(() => {
602
+ const formviewparams: FormViewParams = {
603
+ moduleName: parentModuleName,
604
+ modelName: camelCase(parentModelName),
605
+ id: "new",
606
+ embeded: true,
607
+ inlineCreateAutoSave: fieldLayoutInfo?.attrs?.inlineCreateAutoSave,
608
+ layout: fieldLayoutInfo?.attrs?.inlineCreateLayout
609
+ }
610
+ setformViewParams(formviewparams);
611
+ }, [])
612
+
613
+
614
+ const [visibleCreateRelationEntity, setvisibleCreateRelationEntity] = useState(false);
615
+
616
+ const showToast = (severity: "success" | "error", summary: string, detail: string) => {
617
+ toast.current?.show({
618
+ severity,
619
+ summary,
620
+ detail,
621
+ ...(severity === "error"
622
+ ? { sticky: true } // stays until user closes
623
+ : { life: 3000 }),
624
+ });
625
+ };
626
+ // auto complete specific code.
627
+ const entityApi = createSolidEntityApi(parentModelName || "userViewMetadata");
628
+ const { useLazyGetSolidEntitiesQuery } = entityApi;
629
+ const [triggerGetSolidEntities] = useLazyGetSolidEntitiesQuery();
630
+
631
+ const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
632
+ const fieldReadonly = fieldLayoutInfo.attrs?.readonly;
633
+
634
+ const formDisabled = solidFormViewMetaData.data.solidView?.layout?.attrs?.disabled;
635
+ const formReadonly = solidFormViewMetaData.data.solidView?.layout?.attrs?.readonly;
636
+ const whereClause = fieldLayoutInfo.attrs.whereClause;
637
+
638
+ const [autoCompleteItems, setAutoCompleteItems] = useState<any[]>([]);
639
+ const [offset, setOffset] = useState(0);
640
+ const [hasMore, setHasMore] = useState(true);
641
+ const [currentQuery, setCurrentQuery] = useState("");
642
+ const LIMIT = 50;
643
+ const [loading, setLoading] = useState(false);
644
+ const [viewDisplayValue, setViewDisplayValue] = useState<any>(null);
645
+
646
+
647
+ useEffect(() => {
648
+ const fn = async () => {
649
+ if (fieldContext.data[fieldLayoutInfo.attrs.name]) {
650
+ const queryData = {
651
+ offset: 0,
652
+ limit: LIMIT,
653
+ filters: {
654
+ $and: [
655
+ {
656
+ [parentFieldName]: {
657
+ [fieldLayoutInfo?.attrs?.autocompleteMatchMode || '$eqi']: fieldContext.data[fieldLayoutInfo.attrs.name] ?? formik.values[fieldLayoutInfo.attrs.name]
658
+ }
659
+ }
660
+ ]
661
+ }
662
+ };
663
+ let autocompleteQs = qs.stringify(queryData, {
664
+ encodeValuesOnly: true,
665
+ });
666
+ const autocompleteResponse = await triggerGetSolidEntities(autocompleteQs);
667
+ // TODO: if no data found then can we show no matching "entities", where entities can be replaced with the model plural name,
668
+ const autocompleteData = autocompleteResponse.data;
669
+ if (autocompleteData) {
670
+ const formattedRecords = autocompleteData.records.map((item: any) => {
671
+ const label = parentFieldLabels && parentFieldLabels.length > 0 ? parentFieldLabels.map((label: any) => item[label]).join(" - ") : item[parentFieldName];
672
+ return {
673
+ solidManyToOneLabel: label,
674
+ solidManyToOneValue: item[parentFieldName],
675
+ ...item,
676
+ }
677
+ });
678
+ if (formattedRecords.length > 0) {
679
+ formik.setFieldValue(fieldLayoutInfo.attrs.name, formattedRecords[0]);
680
+ }
681
+ }
682
+ }
683
+ }
684
+ fn()
685
+ }, [])
686
+
687
+ // Add this NEW useEffect - only for view mode refresh
688
+ useEffect(() => {
689
+ const fn = async () => {
690
+ if (viewMode !== "view") {
691
+ setViewDisplayValue(null);
692
+ return;
693
+ }
694
+
695
+ const rawValue =
696
+ fieldContext.data[fieldLayoutInfo.attrs.name] ??
697
+ formik.values[fieldLayoutInfo.attrs.name];
698
+
699
+ if (!rawValue) return;
700
+
701
+ const searchValue =
702
+ typeof rawValue === "object"
703
+ ? rawValue[parentFieldName]
704
+ : rawValue;
705
+
706
+ const queryData = {
707
+ offset: 0,
708
+ limit: 1,
709
+ filters: {
710
+ $and: [
711
+ {
712
+ [parentFieldName]: {
713
+ [fieldLayoutInfo?.attrs?.autocompleteMatchMode || "$eqi"]:
714
+ searchValue,
715
+ },
716
+ },
717
+ ],
718
+ },
719
+ };
720
+
721
+ const qsStr = qs.stringify(queryData, { encodeValuesOnly: true });
722
+ const res = await triggerGetSolidEntities(qsStr);
723
+ const record = res.data?.records?.[0];
724
+ if (!record) return;
725
+
726
+ const label =
727
+ parentFieldLabels?.length > 0
728
+ ? parentFieldLabels.map((l: string) => record[l]).join(" - ")
729
+ : record[parentFieldName];
730
+ console.log("Final View Label",label, record[parentFieldName])
731
+ setViewDisplayValue({
732
+ solidManyToOneLabel: label,
733
+ solidManyToOneValue: record[parentFieldName],
734
+ ...record,
735
+ });
736
+ };
737
+
738
+ fn();
739
+ }, [viewMode, formik.values[fieldLayoutInfo.attrs.name]]);
740
+
741
+
742
+ const resolvedValue = viewMode === "view" ? viewDisplayValue : formik.values[fieldLayoutInfo.attrs.name];
743
+
744
+ const autoCompleteSearch = async (event: AutoCompleteCompleteEvent) => {
745
+ setOffset(0);
746
+ setCurrentQuery(event.query || "");
747
+ setHasMore(true);
748
+ // Get the list view layout & metadata first.
749
+ const queryData = {
750
+ offset: 0,
751
+ limit: LIMIT,
752
+ filters: {
753
+ $and: [
754
+ ...(parentSearchFields?.length > 0
755
+ ? [
756
+ {
757
+ $or: parentSearchFields.map((field:any) => ({
758
+ [field]: {
759
+ [fieldLayoutInfo?.attrs?.autocompleteMatchMode || '$containsi']:
760
+ event.query
761
+ }
762
+ }))
763
+ }
764
+ ]
765
+ : [
766
+ {
767
+ [parentFieldName]: {
768
+ [fieldLayoutInfo?.attrs?.autocompleteMatchMode || '$containsi']:
769
+ event.query
770
+ }
771
+ }
772
+ ])
773
+
774
+ ]
775
+ }
776
+ };
777
+ let fixedFilterToBeApplied = false;
778
+ let fixedFilterParsed = false;
779
+ if (solidFormViewMetaData?.data?.solidView?.model?.singularName === "listOfValues" && fieldContext.fieldMetadata.relationCoModelSingularName !== "moduleMetadata") {
780
+ fixedFilterToBeApplied = true;
781
+ }
782
+ if (fieldMetadata?.relationFieldFixedFilter || fieldLayoutInfo?.attrs?.whereClause) {
783
+ const convertedFixedFilter = fieldLayoutInfo?.attrs?.whereClause ? fieldLayoutInfo?.attrs?.whereClause : fieldMetadata?.relationFieldFixedFilter;
784
+ fixedFilterToBeApplied = true;
785
+ const fixedFilterTemplate = Handlebars.compile(convertedFixedFilter);
786
+ const renderedFilter = fixedFilterTemplate(formik.values);
787
+
788
+ // Parse the result into a JS object
789
+ let parsedFilter;
790
+ try {
791
+ parsedFilter = JSON.parse(renderedFilter);
792
+ const isValid = (obj: any): boolean => {
793
+ if (!obj || typeof obj !== 'object') return false;
794
+
795
+ // Recursively check all nested values
796
+ const hasValidValue = (val: any): boolean => {
797
+ if (val === null || val === undefined || val === '') return false;
798
+ if (typeof val === 'object') {
799
+ return Object.values(val).some(hasValidValue);
800
+ }
801
+ return true;
802
+ };
803
+
804
+ return hasValidValue(obj);
805
+ };
806
+
807
+ if (isValid(parsedFilter)) {
808
+ queryData.filters.$and.push(parsedFilter);
809
+ fixedFilterParsed = true;
810
+ } else {
811
+ console.warn(ERROR_MESSAGES.SKIPPING_EMPTY_FIXED_FILTER, parsedFilter);
812
+ }
813
+ } catch (e) {
814
+ console.error(ERROR_MESSAGES.INVALID_JSON_WHERECLAUSE, renderedFilter);
815
+ parsedFilter = {}; // fallback or throw error as needed
816
+ }
817
+
818
+ }
819
+
820
+ let autocompleteQs = qs.stringify(queryData, {
821
+ encodeValuesOnly: true,
822
+ });
823
+ // if (whereClause) {
824
+ // autocompleteQs = `${autocompleteQs}&${whereClause}`;
825
+ // }
826
+
827
+
828
+ if (fixedFilterToBeApplied && !fixedFilterParsed) {
829
+ showToast("error", ERROR_MESSAGES.SELECT_RELEVANT_FIELD, ERROR_MESSAGES.FIELD_NOT_SELECT);
830
+
831
+ } else {
832
+ try {
833
+ setLoading(true);
834
+ // TODO: do error handling here, possible errors like modelname is incorrect etc...
835
+ const autocompleteResponse = await triggerGetSolidEntities(autocompleteQs);
836
+
837
+ // TODO: if no data found then can we show no matching "entities", where entities can be replaced with the model plural name,
838
+ const autocompleteData = autocompleteResponse.data;
839
+
840
+ if (autocompleteData) {
841
+ const autoCompleteItems = autocompleteData.records.map((item: any) => {
842
+ const label = parentFieldLabels && parentFieldLabels.length > 0 ? parentFieldLabels.map((label: any) => item[label]).join(" - ") : item[parentFieldName];
843
+ return {
844
+ solidManyToOneLabel: label,
845
+ solidManyToOneValue: item[parentFieldName],
846
+ ...item,
847
+ }
848
+ });
849
+ // const autoCompleteItems = autocompleteData.records.map((item: any) => {label: item[parentFieldName],value});
850
+
851
+ setAutoCompleteItems(autoCompleteItems);
852
+ setOffset(autocompleteData.records.length);
853
+ setHasMore(autocompleteData.records.length === LIMIT);
854
+ }
855
+ }
856
+ finally {
857
+ setLoading(false);
858
+ }
859
+ }
860
+ }
861
+
862
+ const onLazyLoad = async (event: { first: number; last: number }) => {
863
+ if (!hasMore || loading) return;
864
+ if (event.last < autoCompleteItems.length - 1) return; // Only load if user reaches bottom
865
+
866
+ const queryData = {
867
+ offset: offset,
868
+ limit: LIMIT,
869
+ filters: {
870
+ $and: [
871
+ ...(parentSearchFields?.length > 0
872
+ ? [
873
+ {
874
+ $or: parentSearchFields.map((field:any) => ({
875
+ [field]: {
876
+ [fieldLayoutInfo?.attrs?.autocompleteMatchMode || '$containsi']:
877
+ currentQuery }
878
+ }))
879
+ }
880
+ ]
881
+ : [
882
+ {
883
+ [parentFieldName]: {
884
+ [fieldLayoutInfo?.attrs?.autocompleteMatchMode || '$containsi']:
885
+ currentQuery
886
+ }
887
+ }
888
+ ])
889
+
890
+ ]
891
+ }
892
+ };
893
+
894
+ let fixedFilterToBeApplied = false;
895
+ let fixedFilterParsed = false;
896
+ if (solidFormViewMetaData?.data?.solidView?.model?.singularName === "listOfValues" && fieldContext.fieldMetadata.relationCoModelSingularName !== "moduleMetadata") {
897
+ fixedFilterToBeApplied = true;
898
+ }
899
+ if (fieldMetadata?.relationFieldFixedFilter || fieldLayoutInfo?.attrs?.whereClause) {
900
+ const convertedFixedFilter = fieldLayoutInfo?.attrs?.whereClause ? fieldLayoutInfo?.attrs?.whereClause : fieldMetadata?.relationFieldFixedFilter;
901
+ fixedFilterToBeApplied = true;
902
+ const fixedFilterTemplate = Handlebars.compile(convertedFixedFilter);
903
+ const renderedFilter = fixedFilterTemplate(formik.values);
904
+
905
+ // Parse the result into a JS object
906
+ let parsedFilter;
907
+ try {
908
+ parsedFilter = JSON.parse(renderedFilter);
909
+ const isValid = (obj: any): boolean => {
910
+ if (!obj || typeof obj !== 'object') return false;
911
+
912
+ // Recursively check all nested values
913
+ const hasValidValue = (val: any): boolean => {
914
+ if (val === null || val === undefined || val === '') return false;
915
+ if (typeof val === 'object') {
916
+ return Object.values(val).some(hasValidValue);
917
+ }
918
+ return true;
919
+ };
920
+
921
+ return hasValidValue(obj);
922
+ };
923
+
924
+ if (isValid(parsedFilter)) {
925
+ queryData.filters.$and.push(parsedFilter);
926
+ fixedFilterParsed = true;
927
+ } else {
928
+ console.warn(ERROR_MESSAGES.SKIPPING_EMPTY_FIXED_FILTER, parsedFilter);
929
+ }
930
+ } catch (e) {
931
+ console.error(ERROR_MESSAGES.INVALID_JSON_WHERECLAUSE, renderedFilter);
932
+ parsedFilter = {}; // fallback or throw error as needed
933
+ }
934
+
935
+ }
936
+
937
+ const autocompleteQs = qs.stringify(queryData, { encodeValuesOnly: true });
938
+ if (fixedFilterToBeApplied && !fixedFilterParsed) {
939
+ showToast("error", ERROR_MESSAGES.SELECT_RELEVANT_FIELD, ERROR_MESSAGES.FIELD_NOT_SELECT);
940
+
941
+ } else {
942
+ try {
943
+ setLoading(true);
944
+ const response = await triggerGetSolidEntities(autocompleteQs);
945
+ const records = response.data?.records || [];
946
+ if (records.length < LIMIT) setHasMore(false);
947
+ setAutoCompleteItems((prev: any) => [...prev, ...records.map((item: any) => {
948
+ const label = parentFieldLabels && parentFieldLabels.length > 0 ? parentFieldLabels.map((label: any) => item[label]).join(" - ") : item[parentFieldName];
949
+ return {
950
+ solidManyToOneLabel: label,
951
+ solidManyToOneValue: item[parentFieldName],
952
+ ...item
953
+ }
954
+ }
955
+ )]);
956
+ setOffset((prev: any) => prev + records.length);
957
+ } finally {
958
+ setLoading(false);
959
+ }
960
+ }
961
+ };
962
+
963
+ const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
964
+
965
+ const customCreateHandler = (values: any) => {
966
+ const currentRelationData = formik.values[fieldLayoutInfo.attrs.name] || [];
967
+ const jsonValues = Object.fromEntries(values.entries());
968
+ console.log("jsonValues", jsonValues);
969
+ const label = parentFieldLabels && parentFieldLabels.length > 0 ? parentFieldLabels.map((label: any) => jsonValues[label]).join(" - ") : jsonValues[parentFieldName];
970
+
971
+ const updatedRelationData = [
972
+ ...currentRelationData,
973
+ // jsonValues[parentFieldName]
974
+ {
975
+ solidManyToOneLabel: label,
976
+ solidManyToOneValue: "new",
977
+ original: jsonValues,
978
+ },
979
+ ];
980
+
981
+ formik.setFieldValue(fieldLayoutInfo.attrs.name, updatedRelationData);
982
+
983
+ }
984
+ return (
985
+ <div className="relative" >
986
+ <Toast ref={toast} />
987
+ < div className="flex flex-column gap-2 mt-1 sm:mt-2 md:mt-3 lg:mt-4" >
988
+ {showFieldLabel != false &&
989
+ <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label" >
990
+ {fieldLabel}
991
+ {fieldMetadata.required && <span className="text-red-500" > * </span>}
992
+ <SolidFieldTooltip fieldContext={fieldContext} />
993
+ </label>
994
+ }
995
+ <div className="flex align-items-center gap-3" >
996
+ <AutoComplete
997
+ readOnly={formReadonly || fieldReadonly || readOnlyPermission}
998
+ disabled={formDisabled || fieldDisabled || readOnlyPermission || viewMode === "view"}
999
+ field="solidManyToOneLabel"
1000
+ {...formik.getFieldProps(fieldLayoutInfo.attrs.name)}
1001
+ id={fieldLayoutInfo.attrs.name}
1002
+ value={resolvedValue || null}
1003
+ dropdown={!readOnlyPermission}
1004
+ suggestions={autoCompleteItems}
1005
+ completeMethod={autoCompleteSearch}
1006
+ onChange={(e) => fieldContext.onChange(e, 'onFieldChange')}
1007
+ onFocus={(e) => e.target.select()}
1008
+ className="w-full solid-standard-autocomplete"
1009
+ // virtualScrollerOptions={{
1010
+ // itemSize: 38,
1011
+ // lazy: true,
1012
+ // onLazyLoad
1013
+ // }}
1014
+ virtualScrollerOptions={getVirtualScrollerOptions({
1015
+ itemsLength: autoCompleteItems.length,
1016
+ lazy: true,
1017
+ onLazyLoad,
1018
+ })}
1019
+ />
1020
+ {
1021
+ fieldLayoutInfo.attrs.inlineCreate === "true" && readOnlyPermission === false && formViewParams && viewMode !== "view" &&
1022
+ <RenderSolidFormEmbededView formik={formik} fieldContext={fieldContext} customCreateHandler={customCreateHandler} visibleCreateRelationEntity={visibleCreateRelationEntity} setvisibleCreateRelationEntity={setvisibleCreateRelationEntity} formViewParams={formViewParams} > </RenderSolidFormEmbededView>
1023
+ }
1024
+ </div>
1025
+ </div>
1026
+ {
1027
+ isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
1028
+ <div className="absolute mt-1" >
1029
+ <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
1030
+ </div>
1031
+ )
1032
+ }
1033
+ </div>
1034
+ );
1035
+ }
1036
+