@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.
- package/dist/components/Svg/DevDocs.tsx +9 -0
- package/dist/components/Svg/DocsSvg.tsx +9 -0
- package/dist/components/Svg/ExcelSvg.tsx +15 -0
- package/dist/components/Svg/FieldSvg.tsx +9 -0
- package/dist/components/Svg/FileSvg.tsx +18 -0
- package/dist/components/Svg/HomePageModuleSvg.tsx +179 -0
- package/dist/components/Svg/ModelSvg.tsx +9 -0
- package/dist/components/Svg/ModuleSvg.tsx +9 -0
- package/dist/components/Svg/PDFSvg.tsx +15 -0
- package/dist/components/Svg/RightArrowSvg.tsx +9 -0
- package/dist/components/Svg/SettingsSvg.tsx +9 -0
- package/dist/components/auth/AuthLayout.tsx +223 -0
- package/dist/components/auth/ForgotPasswordThankYou.tsx +33 -0
- package/dist/components/auth/GoogleAuthChecking.tsx +63 -0
- package/dist/components/auth/SolidChangeForcePassword.tsx +222 -0
- package/dist/components/auth/SolidForgotPassword.tsx +127 -0
- package/dist/components/auth/SolidInitialLoginOtp.tsx +271 -0
- package/dist/components/auth/SolidInitiateRegisterOtp.tsx +218 -0
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +14 -8
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidLogin.tsx +428 -0
- package/dist/components/auth/SolidOTPVerify.tsx +133 -0
- package/dist/components/auth/SolidRegister.tsx +454 -0
- package/dist/components/auth/SolidResetPassword.tsx +194 -0
- package/dist/components/common/AuthBanner.tsx +41 -0
- package/dist/components/common/AutoCompleteField.tsx +79 -0
- package/dist/components/common/BackButton.tsx +72 -0
- package/dist/components/common/CancelButton.tsx +61 -0
- package/dist/components/common/CodeEditor.tsx +38 -0
- package/dist/components/common/CreateButton.tsx +17 -0
- package/dist/components/common/DownloadProgressToast.tsx +55 -0
- package/dist/components/common/DropzonePlaceholder.tsx +31 -0
- package/dist/components/common/DropzoneUpload.tsx +11 -0
- package/dist/components/common/FileReaderExt.tsx +20 -0
- package/dist/components/common/GeneralSettings.tsx +1225 -0
- package/dist/components/common/HeaderDynamicTitles.tsx +13 -0
- package/dist/components/common/MarkdownViewer.tsx +84 -0
- package/dist/components/common/MultipleSelectAutoCompleteField.tsx +64 -0
- package/dist/components/common/NotFound.tsx +22 -0
- package/dist/components/common/SingleSelectAutoCompleteField.tsx +73 -0
- package/dist/components/common/SocialMediaLogin.tsx +53 -0
- package/dist/components/common/SolidAdmin.tsx +6 -0
- package/dist/components/common/SolidBreadcrumb.tsx +129 -0
- package/dist/components/common/SolidExport.tsx +563 -0
- package/dist/components/common/SolidExportStepper.tsx +135 -0
- package/dist/components/common/SolidFieldTooltip.tsx +23 -0
- package/dist/components/common/SolidFormHeader.tsx +25 -0
- package/dist/components/common/SolidFormStepper.tsx +350 -0
- package/dist/components/common/SolidModuleHome.tsx +128 -0
- package/dist/components/common/SolidPopupContainer.tsx +37 -0
- package/dist/components/common/SolidSettings/LlmSettings/AnthropicProviderComponent.tsx +45 -0
- package/dist/components/common/SolidSettings/LlmSettings/OpenAiProviderComponent.tsx +45 -0
- package/dist/components/common/SolidSettings/SettingDropzoneActivePlaceholder.tsx +20 -0
- package/dist/components/common/SolidSettings/SettingsImageRemoveButton.tsx +15 -0
- package/dist/components/common/SolidSettings/SolidUploadedImage.tsx +16 -0
- package/dist/components/common/SolidThemeLink.tsx +6 -0
- package/dist/components/common/SolidThemeProvider.tsx +44 -0
- package/dist/components/common/StepperArrows/ActiveArrowStep.tsx +18 -0
- package/dist/components/common/StepperArrows/ActiveBeforeStepArrow.tsx +18 -0
- package/dist/components/common/StepperArrows/InactiveStepArrow.tsx +19 -0
- package/dist/components/common/error.tsx +30 -0
- package/dist/components/common/useHandleFormCustomButtonClick.ts +40 -0
- package/dist/components/common/useHandleListCustomButtonClick.ts +42 -0
- package/dist/components/core/chatter/SolidChatter.tsx +248 -0
- package/dist/components/core/chatter/SolidChatterAuditMessage.tsx +35 -0
- package/dist/components/core/chatter/SolidChatterCustomMessage.tsx +46 -0
- package/dist/components/core/chatter/SolidChatterDateDivider.tsx +16 -0
- package/dist/components/core/chatter/SolidChatterHeader.tsx +218 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.tsx +163 -0
- package/dist/components/core/chatter/SolidMessageComposer.tsx +146 -0
- package/dist/components/core/common/AvatarWidget.tsx +55 -0
- package/dist/components/core/common/DateFieldViewComponent.tsx +36 -0
- package/dist/components/core/common/FilterComponent.tsx +458 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.tsx +70 -0
- package/dist/components/core/common/PDFViewer.tsx +117 -0
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.tsx +89 -0
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.tsx +188 -0
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.tsx +139 -0
- package/dist/components/core/common/SolidAccountSettings/SolidPersonalInfo.tsx +311 -0
- package/dist/components/core/common/SolidCreateButton.tsx +48 -0
- package/dist/components/core/common/SolidGenericImport/DocumentSvg.tsx +15 -0
- package/dist/components/core/common/SolidGenericImport/SolidGenericImport.tsx +64 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportDropzone.tsx +125 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportInstructions.tsx +122 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportStepper.tsx +217 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.tsx +205 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportTransactionStatus.tsx +158 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.tsx +29 -0
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +1470 -0
- package/dist/components/core/common/SolidLayoutViews.tsx +87 -0
- package/dist/components/core/common/SolidListViewOptions.tsx +31 -0
- package/dist/components/core/common/SolidLoaders/SolidCircularLoader.tsx +7 -0
- package/dist/components/core/common/SolidPasswordHelperText.tsx +34 -0
- package/dist/components/core/common/SolidSaveCustomFilterForm.tsx +75 -0
- package/dist/components/core/common/SolidSearchBox.tsx +17 -0
- package/dist/components/core/common/SolidViewLayoutManager.ts +421 -0
- package/dist/components/core/common/SolidXAiIframe.tsx +77 -0
- package/dist/components/core/dashboard/SolidDashboard.tsx +332 -0
- package/dist/components/core/dashboard/SolidDashboardBody.tsx +117 -0
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.tsx +28 -0
- package/dist/components/core/dashboard/SolidDashboardHeader.tsx +10 -0
- package/dist/components/core/dashboard/SolidDashboardLoading.tsx +55 -0
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.tsx +32 -0
- package/dist/components/core/dashboard/SolidDashboardRenderError.tsx +29 -0
- package/dist/components/core/dashboard/SolidDashboardVariable.tsx +256 -0
- package/dist/components/core/dashboard/SolidQuestionRenderer.tsx +78 -0
- package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.tsx +18 -0
- package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.tsx +54 -0
- package/dist/components/core/dashboard/chart-renderers/init-chartjs.ts +25 -0
- package/dist/components/core/dashboard/dashboard-utils.ts +39 -0
- package/dist/components/core/extension/solid-core/CustomIcon/StatusIcon.tsx +17 -0
- package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.tsx +36 -0
- package/dist/components/core/extension/solid-core/emailTemplate/emailFormTypeChangeHandler.ts +18 -0
- package/dist/components/core/extension/solid-core/emailTemplate/emailFormTypeLoad.ts +18 -0
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx +114 -0
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx +213 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/DeleteModuleRowAction.tsx +138 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.tsx +209 -0
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx +131 -0
- package/dist/components/core/field/FieldListViewData.tsx +313 -0
- package/dist/components/core/filter/SolidBooleanFilterElement.tsx +30 -0
- package/dist/components/core/filter/SolidFilterFields.tsx +131 -0
- package/dist/components/core/filter/SolidManyToManyFilterElement.tsx +64 -0
- package/dist/components/core/filter/SolidManyToOneFilterElement.tsx +61 -0
- package/dist/components/core/filter/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/filter/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/filter/SolidVarInputsFilterElement.tsx +209 -0
- package/dist/components/core/filter/fields/SolidBigintField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidBooleanField.tsx +68 -0
- package/dist/components/core/filter/fields/SolidComputedField.tsx +23 -0
- package/dist/components/core/filter/fields/SolidDateField.tsx +63 -0
- package/dist/components/core/filter/fields/SolidDatetimeField.tsx +54 -0
- package/dist/components/core/filter/fields/SolidDecimalField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidExternalIdField.tsx +52 -0
- package/dist/components/core/filter/fields/SolidFloatField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidIdField.tsx +46 -0
- package/dist/components/core/filter/fields/SolidIntField.tsx +61 -0
- package/dist/components/core/filter/fields/SolidLongTextField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidMediaMultipleField.tsx +60 -0
- package/dist/components/core/filter/fields/SolidMediaSingleField.tsx +62 -0
- package/dist/components/core/filter/fields/SolidRelationField.tsx +17 -0
- package/dist/components/core/filter/fields/SolidRichTextField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidSelectionDynamicField.tsx +52 -0
- package/dist/components/core/filter/fields/SolidSelectionStaticField.tsx +54 -0
- package/dist/components/core/filter/fields/SolidShortTextField.tsx +60 -0
- package/dist/components/core/filter/fields/SolidTimeField.tsx +48 -0
- package/dist/components/core/filter/fields/SolidUuidField.tsx +51 -0
- package/dist/components/core/filter/fields/relations/SolidRelationManyToManyField.tsx +62 -0
- package/dist/components/core/filter/fields/relations/SolidRelationManyToOneField.tsx +84 -0
- package/dist/components/core/form/SolidFormActionHeader.tsx +497 -0
- package/dist/components/core/form/SolidFormFieldRender.tsx +53 -0
- package/dist/components/core/form/SolidFormFieldRenderExtension.tsx +26 -0
- package/dist/components/core/form/SolidFormFooter.tsx +162 -0
- package/dist/components/core/form/SolidFormLayouts.tsx +104 -0
- package/dist/components/core/form/SolidFormUserViewLayout.tsx +84 -0
- package/dist/components/core/form/SolidFormView.tsx +1856 -0
- package/dist/components/core/form/SolidFormViewContextMenuHeaderButton.tsx +52 -0
- package/dist/components/core/form/SolidFormViewNormalHeaderButton.tsx +52 -0
- package/dist/components/core/form/SolidFormViewShimmerLoading.tsx +109 -0
- package/dist/components/core/form/fields/ISolidField.tsx +71 -0
- package/dist/components/core/form/fields/SolidBooleanField.tsx +434 -0
- package/dist/components/core/form/fields/SolidDateField.tsx +247 -0
- package/dist/components/core/form/fields/SolidDateTimeField.tsx +229 -0
- package/dist/components/core/form/fields/SolidDecimalField.tsx +171 -0
- package/dist/components/core/form/fields/SolidEmailField.tsx +176 -0
- package/dist/components/core/form/fields/SolidIntegerField.tsx +282 -0
- package/dist/components/core/form/fields/SolidJsonField.tsx +185 -0
- package/dist/components/core/form/fields/SolidLongTextField.tsx +618 -0
- package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +663 -0
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +547 -0
- package/dist/components/core/form/fields/SolidPasswordField.tsx +390 -0
- package/dist/components/core/form/fields/SolidRelationField.tsx +56 -0
- package/dist/components/core/form/fields/SolidRichTextField.tsx +188 -0
- package/dist/components/core/form/fields/SolidSelectionDynamicField.tsx +340 -0
- package/dist/components/core/form/fields/SolidSelectionStaticField.tsx +462 -0
- package/dist/components/core/form/fields/SolidShortTextField.tsx +399 -0
- package/dist/components/core/form/fields/SolidTimeField.tsx +245 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +453 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +1036 -0
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +627 -0
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.tsx +38 -0
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.ts +64 -0
- package/dist/components/core/form/fields/widgets/SolidAiInteractionMessageFieldFormWidget.tsx +135 -0
- package/dist/components/core/form/fields/widgets/SolidAiInteractionMetadataFieldFormWidget.tsx +144 -0
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.tsx +265 -0
- package/dist/components/core/form/fields/widgets/SolidIconViewWidget.tsx +32 -0
- package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.tsx +50 -0
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.tsx +222 -0
- package/dist/components/core/form/fields/widgets/SolidShortTextFieldAvatarWidget.tsx +70 -0
- package/dist/components/core/form/widgets/CustomHtml.tsx +20 -0
- package/dist/components/core/kanban/KanbanBoard.tsx +150 -0
- package/dist/components/core/kanban/KanbanCard.tsx +279 -0
- package/dist/components/core/kanban/KanbanColumn.tsx +139 -0
- package/dist/components/core/kanban/KanbanUserViewLayout.tsx +84 -0
- package/dist/components/core/kanban/SolidKanbanView.tsx +894 -0
- package/dist/components/core/kanban/SolidKanbanViewConfigure.tsx +154 -0
- package/dist/components/core/kanban/SolidKanbanViewFields.tsx +164 -0
- package/dist/components/core/kanban/SolidManyToOneFilterElement.tsx +59 -0
- package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/kanban/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/kanban/SolidVarInputsFilterElement.tsx +184 -0
- package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.tsx +16 -0
- package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.tsx +23 -0
- package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.tsx +12 -0
- package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.tsx +20 -0
- package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx +140 -0
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +164 -0
- package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +121 -0
- package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.tsx +12 -0
- package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx +16 -0
- package/dist/components/core/list/ListViewRowActionPopup.tsx +41 -0
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.tsx +242 -0
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.tsx +111 -0
- package/dist/components/core/list/SolidListView.tsx +2007 -0
- package/dist/components/core/list/SolidListViewColumn.tsx +165 -0
- package/dist/components/core/list/SolidListViewConfigure.tsx +339 -0
- package/dist/components/core/list/SolidListViewHeaderButton.tsx +31 -0
- package/dist/components/core/list/SolidListViewHeaderContextMenuButton.tsx +30 -0
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.tsx +41 -0
- package/dist/components/core/list/SolidListViewShimmerLoading.tsx +78 -0
- package/dist/components/core/list/SolidListingHeader.tsx +42 -0
- package/dist/components/core/list/SolidManyToOneFilterElement.tsx +60 -0
- package/dist/components/core/list/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/list/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/list/SolidTableRowCell.tsx +35 -0
- package/dist/components/core/list/SolidVarInputsFilterElement.tsx +184 -0
- package/dist/components/core/list/columns/SolidBigintColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidBooleanColumn.tsx +90 -0
- package/dist/components/core/list/columns/SolidComputedColumn.tsx +27 -0
- package/dist/components/core/list/columns/SolidDateColumn.tsx +90 -0
- package/dist/components/core/list/columns/SolidDatetimeColumn.tsx +79 -0
- package/dist/components/core/list/columns/SolidDecimalColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidExternalIdColumn.tsx +80 -0
- package/dist/components/core/list/columns/SolidFloatColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidIdColumn.tsx +79 -0
- package/dist/components/core/list/columns/SolidIntColumn.tsx +87 -0
- package/dist/components/core/list/columns/SolidLongTextColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +301 -0
- package/dist/components/core/list/columns/SolidMediaSingleColumn.tsx +170 -0
- package/dist/components/core/list/columns/SolidRelationColumn.tsx +21 -0
- package/dist/components/core/list/columns/SolidRichTextColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.tsx +80 -0
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.tsx +81 -0
- package/dist/components/core/list/columns/SolidShortTextColumn.tsx +160 -0
- package/dist/components/core/list/columns/SolidTimeColumn.tsx +78 -0
- package/dist/components/core/list/columns/SolidUuidColumn.tsx +79 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.tsx +106 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +117 -0
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.tsx +110 -0
- package/dist/components/core/list/widgets/SolidManyToManyRelationAvatarListWidget.tsx +30 -0
- package/dist/components/core/list/widgets/SolidManyToOneRelationAvatarListWidget.tsx +30 -0
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.tsx +70 -0
- package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.tsx +21 -0
- package/dist/components/core/locales/SolidChatterLocaleTabView.tsx +91 -0
- package/dist/components/core/locales/SolidLocale.tsx +127 -0
- package/dist/components/core/model/CreateModel.tsx +495 -0
- package/dist/components/core/model/FieldMetaData.tsx +263 -0
- package/dist/components/core/model/FieldMetaDataForm.tsx +3509 -0
- package/dist/components/core/model/FieldSelector.tsx +62 -0
- package/dist/components/core/model/ModelListViewData.tsx +384 -0
- package/dist/components/core/model/ModelMetaData.tsx +921 -0
- package/dist/components/core/module/CreateModule.tsx +617 -0
- package/dist/components/core/module/ModuleListViewData.tsx +431 -0
- package/dist/components/core/solid-ai/SolidAiMainWrapper.tsx +8 -0
- package/dist/components/core/solid-ai/SolidXAIIcon.tsx +37 -0
- package/dist/components/core/users/CreateUser.tsx +467 -0
- package/dist/components/core/users/CreateUserRole.tsx +212 -0
- package/dist/components/core/users/UserListView.tsx +376 -0
- package/dist/components/layout/AdminLayout.tsx +57 -0
- package/dist/components/layout/AdminSidebar.tsx +65 -0
- package/dist/components/layout/AppConfig.tsx +104 -0
- package/dist/components/layout/AppSidebar.tsx +232 -0
- package/dist/components/layout/ButtonLoader.tsx +7 -0
- package/dist/components/layout/CustomPagination.tsx +55 -0
- package/dist/components/layout/DashboardHeader.tsx +89 -0
- package/dist/components/layout/FilterMenu.tsx +122 -0
- package/dist/components/layout/Footer.tsx +13 -0
- package/dist/components/layout/GlobalSearch.tsx +37 -0
- package/dist/components/layout/Header.tsx +8 -0
- package/dist/components/layout/Layout.tsx +205 -0
- package/dist/components/layout/ListingHeader.tsx +204 -0
- package/dist/components/layout/Loader.tsx +16 -0
- package/dist/components/layout/UserSidebar.tsx +53 -0
- package/dist/components/layout/context/layoutcontext.tsx +52 -0
- package/dist/components/layout/navbar-one.tsx +258 -0
- package/dist/components/layout/navbar-two-menu.tsx +72 -0
- package/dist/components/layout/navbar-two.tsx +37 -0
- package/dist/components/layout/user-profile-menu.tsx +213 -0
- package/dist/components/layout/user-profile.tsx +7 -0
- package/dist/components/modelsComponents/filterIcon.tsx +9 -0
- package/dist/constants/error-messages.ts +238 -0
- package/dist/declarations.d.ts +22 -0
- package/dist/helpers/AppTitle.tsx +12 -0
- package/dist/helpers/ToastContainer.tsx +94 -0
- package/dist/helpers/autoCompleteVirtualScroll.ts +41 -0
- package/dist/helpers/countries.tsx +260 -0
- package/dist/helpers/downloadFileWithProgress.ts +91 -0
- package/dist/helpers/downloadMediaFile.tsx +21 -0
- package/dist/helpers/getAcceptedFileTypes.tsx +22 -0
- package/dist/helpers/getRandomColors.tsx +68 -0
- package/dist/helpers/helpers.ts +61 -0
- package/dist/helpers/hydrateRelationRules.ts +120 -0
- package/dist/helpers/permissions.ts +7 -0
- package/dist/helpers/registry.ts +337 -0
- package/dist/helpers/resendOtpHelper.tsx +5 -0
- package/dist/helpers/revalidate.ts +7 -0
- package/dist/helpers/rolesHelper.ts +17 -0
- package/dist/helpers/solidIcons.tsx +1831 -0
- package/dist/helpers/updatePasswordField.ts +41 -0
- package/dist/index.ts +421 -0
- package/dist/nextAuth/authProviders.d.ts.map +1 -1
- package/dist/nextAuth/authProviders.js +6 -5
- package/dist/nextAuth/authProviders.js.map +1 -1
- package/dist/nextAuth/authProviders.tsx +232 -0
- package/dist/nextAuth/handleLogout.tsx +39 -0
- package/dist/nextAuth/refreshAccessToken.tsx +28 -0
- package/dist/redux/api/aiInteractionApi.ts +59 -0
- package/dist/redux/api/authApi.ts +131 -0
- package/dist/redux/api/dashboardApi.ts +56 -0
- package/dist/redux/api/dashboardQuestionApi.ts +17 -0
- package/dist/redux/api/exportTemplateApi.tsx +59 -0
- package/dist/redux/api/fetchBaseQuery.tsx +118 -0
- package/dist/redux/api/fieldApi.ts +86 -0
- package/dist/redux/api/importTransactionApi.tsx +69 -0
- package/dist/redux/api/mediaApi.ts +55 -0
- package/dist/redux/api/mediaStorageProviderApi.ts +55 -0
- package/dist/redux/api/modelApi.ts +80 -0
- package/dist/redux/api/moduleApi.ts +72 -0
- package/dist/redux/api/permissionApi.ts +32 -0
- package/dist/redux/api/pincodeApi.tsx +56 -0
- package/dist/redux/api/roleApi.ts +58 -0
- package/dist/redux/api/solidActionApi.ts +66 -0
- package/dist/redux/api/solidChatterMessageApi.ts +25 -0
- package/dist/redux/api/solidEntityApi.tsx +164 -0
- package/dist/redux/api/solidMenuApi.ts +71 -0
- package/dist/redux/api/solidServiceApi.ts +31 -0
- package/dist/redux/api/solidSettingsApi.tsx +83 -0
- package/dist/redux/api/solidViewApi.ts +73 -0
- package/dist/redux/api/stateApi.tsx +56 -0
- package/dist/redux/api/testApi.ts +21 -0
- package/dist/redux/api/userApi.ts +135 -0
- package/dist/redux/features/authSlice.ts +19 -0
- package/dist/redux/features/dataViewSlice.ts +26 -0
- package/dist/redux/features/navbarSlice.ts +21 -0
- package/dist/redux/features/popupSlice.ts +37 -0
- package/dist/redux/features/settingsSlice.ts +60 -0
- package/dist/redux/features/themeSlice.ts +17 -0
- package/dist/redux/features/userSlice.ts +28 -0
- package/dist/redux/hooks/useSolidPopup.ts +20 -0
- package/dist/redux/store/defaultStoreConfig.ts +62 -0
- package/dist/styles.ts +4 -0
- package/dist/types/handlebars.d.ts +4 -0
- package/dist/types/index.d.ts +76 -0
- package/dist/types/layout.d.ts +94 -0
- package/dist/types/next-auth.d.ts +0 -0
- package/dist/types/next.d.ts +46 -0
- package/dist/types/solid-core.d.ts +320 -0
- package/package.json +1 -1
- package/src/components/auth/SolidLogin.tsx +26 -13
- package/src/nextAuth/authProviders.tsx +9 -5
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { getExtensionComponent } from "../../../../helpers/registry";
|
|
3
|
+
import { SolidFormFieldWidgetProps } from "../../../../types/solid-core";
|
|
4
|
+
import { Message } from "primereact/message";
|
|
5
|
+
import { SelectButton } from "primereact/selectbutton";
|
|
6
|
+
import { classNames } from "primereact/utils";
|
|
7
|
+
import { useEffect, useState } from "react";
|
|
8
|
+
import * as Yup from 'yup';
|
|
9
|
+
import { FormikObject, ISolidField, SolidFieldProps } from "./ISolidField";
|
|
10
|
+
import { Checkbox, CheckboxChangeEvent } from "primereact/checkbox";
|
|
11
|
+
import { SolidFieldTooltip } from "../../../../components/common/SolidFieldTooltip";
|
|
12
|
+
import { InputSwitch } from "primereact/inputswitch";
|
|
13
|
+
import { ERROR_MESSAGES } from "../../../../constants/error-messages";
|
|
14
|
+
|
|
15
|
+
type BooleanOption = {
|
|
16
|
+
label: string;
|
|
17
|
+
value: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
export class SolidBooleanField implements ISolidField {
|
|
22
|
+
|
|
23
|
+
private fieldContext: SolidFieldProps;
|
|
24
|
+
|
|
25
|
+
constructor(fieldContext: SolidFieldProps) {
|
|
26
|
+
this.fieldContext = fieldContext;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
updateFormData(value: any, formData: FormData): any {
|
|
30
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
31
|
+
formData.append(fieldLayoutInfo.attrs.name, value === "true" || value === true ? "true" : "");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
initialValue(): any {
|
|
35
|
+
const fieldName = this.fieldContext.field.attrs.name;
|
|
36
|
+
const fieldDefaultValue = this.fieldContext?.fieldMetadata?.defaultValue;
|
|
37
|
+
|
|
38
|
+
const existingValue = this.fieldContext.data[fieldName];
|
|
39
|
+
|
|
40
|
+
// return existingValue !== undefined && existingValue !== null ? existingValue : fieldDefaultValue || '';
|
|
41
|
+
|
|
42
|
+
// Ensure the value is always a string "true" or "false"
|
|
43
|
+
// const result = existingValue
|
|
44
|
+
// ? (existingValue === true || existingValue === "true" ? "true" : "false")
|
|
45
|
+
// : (fieldDefaultValue === true || fieldDefaultValue === "true" ? "true" : "false");
|
|
46
|
+
// return result;
|
|
47
|
+
|
|
48
|
+
if (existingValue !== undefined && existingValue !== null) {
|
|
49
|
+
return existingValue === true || existingValue === "true";
|
|
50
|
+
}
|
|
51
|
+
return fieldDefaultValue === true || fieldDefaultValue === "true";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
validationSchema(): Yup.Schema {
|
|
55
|
+
let schema: Yup.BooleanSchema<boolean | null | undefined> = Yup.boolean();
|
|
56
|
+
|
|
57
|
+
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
58
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
59
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
60
|
+
|
|
61
|
+
// 1. required
|
|
62
|
+
if (fieldMetadata.required) {
|
|
63
|
+
schema = schema.required(ERROR_MESSAGES.FIELD_REUQIRED(fieldLabel));
|
|
64
|
+
} else {
|
|
65
|
+
schema = schema.nullable(); // Allow null when not required
|
|
66
|
+
}
|
|
67
|
+
// // 2. length (min/max)
|
|
68
|
+
// if (fieldMetadata.min && fieldMetadata.min > 0) {
|
|
69
|
+
// schema = schema.min(fieldMetadata.min, `${fieldLabel} should be at-least ${fieldMetadata.min} characters long.`);
|
|
70
|
+
// }
|
|
71
|
+
// if (fieldMetadata.max && fieldMetadata.max > 0) {
|
|
72
|
+
// schema = schema.max(fieldMetadata.max, `${fieldLabel} should not be more than ${fieldMetadata.max} characters long.`);
|
|
73
|
+
// }
|
|
74
|
+
// 3. regular expression
|
|
75
|
+
//*********Regex doesnt make sense in boolean right? */
|
|
76
|
+
// if (fieldMetadata.regexPattern) {
|
|
77
|
+
// const regexPatternNotMatchingErrorMsg = fieldMetadata.regexPatternNotMatchingErrorMsg ?? `${fieldLabel} has invalid data.`
|
|
78
|
+
// schema = schema.matches(fieldMetadata.regexPattern, regexPatternNotMatchingErrorMsg);
|
|
79
|
+
// }
|
|
80
|
+
|
|
81
|
+
return schema;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
render(formik: FormikObject) {
|
|
85
|
+
|
|
86
|
+
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
87
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
88
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
89
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
90
|
+
useEffect(() => { formik.setFieldValue(fieldLayoutInfo.attrs.name, "false") }, [])
|
|
91
|
+
|
|
92
|
+
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
93
|
+
|
|
94
|
+
let viewWidget = fieldLayoutInfo.attrs.viewWidget;
|
|
95
|
+
let editWidget = fieldLayoutInfo.attrs.editWidget;
|
|
96
|
+
if (!editWidget) {
|
|
97
|
+
editWidget = 'booleanCheckbox';
|
|
98
|
+
}
|
|
99
|
+
if (!viewWidget) {
|
|
100
|
+
viewWidget = 'DefaultBooleanFormViewWidget';
|
|
101
|
+
}
|
|
102
|
+
const viewMode: string = this.fieldContext.viewMode;
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<>
|
|
106
|
+
<div className={className}>
|
|
107
|
+
{viewMode === "view" &&
|
|
108
|
+
this.renderExtensionRenderMode(viewWidget, formik)
|
|
109
|
+
}
|
|
110
|
+
{viewMode === "edit" &&
|
|
111
|
+
(
|
|
112
|
+
<>
|
|
113
|
+
{
|
|
114
|
+
this.renderExtensionRenderMode(editWidget, formik)
|
|
115
|
+
}
|
|
116
|
+
</>
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
</div>
|
|
120
|
+
</>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
renderExtensionRenderMode(widget: string, formik: FormikObject) {
|
|
126
|
+
let DynamicWidget = getExtensionComponent(widget);
|
|
127
|
+
const widgetProps: SolidFormFieldWidgetProps = {
|
|
128
|
+
formik: formik,
|
|
129
|
+
fieldContext: this.fieldContext,
|
|
130
|
+
}
|
|
131
|
+
return (
|
|
132
|
+
<>
|
|
133
|
+
{DynamicWidget && <DynamicWidget {...widgetProps} />}
|
|
134
|
+
</>
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
export const DefaultBooleanFormEditWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
|
|
144
|
+
const fieldMetadata = fieldContext.fieldMetadata;
|
|
145
|
+
const fieldLayoutInfo = fieldContext.field;
|
|
146
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
147
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
148
|
+
const solidFormViewMetaData = fieldContext.solidFormViewMetaData;
|
|
149
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
150
|
+
const trueLabel = fieldLayoutInfo?.attrs?.trueLabel;
|
|
151
|
+
const falseLabel = fieldLayoutInfo?.attrs?.falseLabel;
|
|
152
|
+
const readOnlyPermission = fieldContext.readOnly;
|
|
153
|
+
// const [booleanOptions, setBooleanOptions] = useState<string[]>(["false", "true"]);
|
|
154
|
+
const [booleanOptions, setBooleanOptions] = useState<BooleanOption[]>([
|
|
155
|
+
{ label: "False", value: "false" },
|
|
156
|
+
{ label: "True", value: "true" },
|
|
157
|
+
]);
|
|
158
|
+
|
|
159
|
+
// let booleanOptions = ["false", "true"];
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
if (trueLabel || falseLabel) {
|
|
162
|
+
setBooleanOptions([
|
|
163
|
+
{
|
|
164
|
+
label: falseLabel ?? "False",
|
|
165
|
+
value: "false",
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
label: trueLabel ?? "True",
|
|
169
|
+
value: "true",
|
|
170
|
+
},
|
|
171
|
+
]);
|
|
172
|
+
}
|
|
173
|
+
}, [trueLabel, falseLabel]);
|
|
174
|
+
|
|
175
|
+
// useEffect(() => { formik.setFieldValue(fieldLayoutInfo.attrs.name, "false") }, [])
|
|
176
|
+
useEffect(() => {
|
|
177
|
+
const name = fieldLayoutInfo.attrs.name;
|
|
178
|
+
if (formik.values[name] === undefined || formik.values[name] === null) {
|
|
179
|
+
formik.setFieldValue(name, "false");
|
|
180
|
+
}
|
|
181
|
+
}, []);
|
|
182
|
+
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
183
|
+
|
|
184
|
+
const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
|
|
185
|
+
const fieldReadonly = fieldLayoutInfo.attrs?.readonly;
|
|
186
|
+
|
|
187
|
+
const formDisabled = solidFormViewMetaData.data.solidView?.layout?.attrs?.disabled;
|
|
188
|
+
const formReadonly = solidFormViewMetaData.data.solidView?.layout?.attrs?.readonly;
|
|
189
|
+
|
|
190
|
+
return (
|
|
191
|
+
<div className="relative">
|
|
192
|
+
<div className="flex flex-column gap-2 mt-1 sm:mt-2 md:mt-3 lg:mt-4">
|
|
193
|
+
{showFieldLabel != false &&
|
|
194
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label font-medium">{fieldLabel}
|
|
195
|
+
{fieldMetadata.required && <span className="text-red-500"> *</span>}
|
|
196
|
+
<SolidFieldTooltip fieldContext={fieldContext} />
|
|
197
|
+
{/* {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>} */}
|
|
198
|
+
</label>
|
|
199
|
+
}
|
|
200
|
+
{/* <InputText
|
|
201
|
+
id={fieldLayoutInfo.attrs.name}
|
|
202
|
+
className="small-input"
|
|
203
|
+
aria-describedby={`${fieldLayoutInfo.attrs.name}-help`}
|
|
204
|
+
onChange={formik.handleChange}
|
|
205
|
+
value={formik.values[fieldLayoutInfo.attrs.name] || ''}
|
|
206
|
+
/> */}
|
|
207
|
+
<SelectButton
|
|
208
|
+
readOnly={formReadonly || fieldReadonly || readOnlyPermission}
|
|
209
|
+
disabled={formDisabled || fieldDisabled}
|
|
210
|
+
optionLabel="label"
|
|
211
|
+
optionValue="value"
|
|
212
|
+
id={fieldLayoutInfo.attrs.name}
|
|
213
|
+
aria-describedby={`${fieldLayoutInfo.attrs.name}-help`}
|
|
214
|
+
onChange={(e) => { formik.setFieldValue(fieldLayoutInfo.attrs.name, e.value); console.log("value is", e.value) }} // Custom handling for boolean input
|
|
215
|
+
value={formik.values[fieldLayoutInfo.attrs.name] ? formik.values[fieldLayoutInfo.attrs.name].toString() : "false"}
|
|
216
|
+
options={booleanOptions}
|
|
217
|
+
className={classNames("", {
|
|
218
|
+
"p-invalid": isFormFieldValid(formik, "defaultValue"),
|
|
219
|
+
})}
|
|
220
|
+
|
|
221
|
+
/>
|
|
222
|
+
</div>
|
|
223
|
+
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
224
|
+
<div className="absolute mt-1">
|
|
225
|
+
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
226
|
+
</div>
|
|
227
|
+
)}
|
|
228
|
+
</div>
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export const SolidBooleanCheckboxStyleFormEditWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
|
|
233
|
+
const fieldMetadata = fieldContext.fieldMetadata;
|
|
234
|
+
const fieldLayoutInfo = fieldContext.field;
|
|
235
|
+
const className = fieldLayoutInfo.attrs?.className || "field col-12";
|
|
236
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
237
|
+
const solidFormViewMetaData = fieldContext.solidFormViewMetaData;
|
|
238
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
239
|
+
const checkboxLabel = fieldLayoutInfo?.attrs?.checkboxLabel;
|
|
240
|
+
const readOnlyPermission = fieldContext.readOnly;
|
|
241
|
+
|
|
242
|
+
// Set default value to false on mount
|
|
243
|
+
useEffect(() => {
|
|
244
|
+
if (formik.values[fieldLayoutInfo.attrs.name] === undefined) {
|
|
245
|
+
console.log("Setting default value:", false);
|
|
246
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, false);
|
|
247
|
+
}
|
|
248
|
+
}, []);
|
|
249
|
+
|
|
250
|
+
const handleChange = (e: CheckboxChangeEvent) => {
|
|
251
|
+
const newValue = e.checked; // This returns `true` or `false`
|
|
252
|
+
console.log(`${fieldLayoutInfo.attrs.name}, new value:`, newValue);
|
|
253
|
+
|
|
254
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, newValue === true ? 'true' : 'false');
|
|
255
|
+
formik.setTouched({ ...formik.touched, [fieldLayoutInfo.attrs.name]: true }); // Ensure Formik registers the change
|
|
256
|
+
// ✅ Check if Formik updated the value correctly
|
|
257
|
+
setTimeout(() => {
|
|
258
|
+
console.log("Formik values after update:", formik.values);
|
|
259
|
+
}, 0);
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
const isFormFieldValid = (formik: any, fieldName: any) =>
|
|
263
|
+
formik.touched[fieldName] && formik.errors[fieldName];
|
|
264
|
+
|
|
265
|
+
const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
|
|
266
|
+
const fieldReadonly = fieldLayoutInfo.attrs?.readonly;
|
|
267
|
+
const formDisabled = solidFormViewMetaData.data.solidView?.layout?.attrs?.disabled;
|
|
268
|
+
const formReadonly = solidFormViewMetaData.data.solidView?.layout?.attrs?.readonly;
|
|
269
|
+
|
|
270
|
+
return (
|
|
271
|
+
<div className={className}>
|
|
272
|
+
<div className="relative">
|
|
273
|
+
<div className="flex flex-column gap-2 mt-1 sm:mt-2 md:mt-3 lg:mt-4">
|
|
274
|
+
{showFieldLabel !== false && (
|
|
275
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label font-medium">
|
|
276
|
+
{fieldLabel}
|
|
277
|
+
{fieldMetadata.required && <span className="text-red-500"> *</span>}
|
|
278
|
+
<SolidFieldTooltip fieldContext={fieldContext} />
|
|
279
|
+
</label>
|
|
280
|
+
)}
|
|
281
|
+
|
|
282
|
+
<div className="flex align-items-center">
|
|
283
|
+
<Checkbox
|
|
284
|
+
id={fieldLayoutInfo.attrs.name}
|
|
285
|
+
checked={formik.values[fieldLayoutInfo.attrs.name] === true}
|
|
286
|
+
// onChange={handleChange}
|
|
287
|
+
onChange={(e) => fieldContext.onChange(e, 'onFieldChange')}
|
|
288
|
+
disabled={formDisabled || fieldDisabled}
|
|
289
|
+
readOnly={formReadonly || fieldReadonly || readOnlyPermission}
|
|
290
|
+
className={classNames("", {
|
|
291
|
+
"p-invalid": isFormFieldValid(formik, fieldLayoutInfo.attrs.name),
|
|
292
|
+
})}
|
|
293
|
+
/>
|
|
294
|
+
{checkboxLabel &&
|
|
295
|
+
<span className="ml-2">{checkboxLabel || "Yes"}</span>
|
|
296
|
+
}
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
301
|
+
<div className="absolute mt-1">
|
|
302
|
+
<Message severity="error" text={formik.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
303
|
+
</div>
|
|
304
|
+
)}
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export const SolidBooleanSwitchStyleFormEditWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
|
|
311
|
+
const fieldMetadata = fieldContext.fieldMetadata;
|
|
312
|
+
const fieldLayoutInfo = fieldContext.field;
|
|
313
|
+
const className = fieldLayoutInfo.attrs?.className || "field col-12";
|
|
314
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
315
|
+
const solidFormViewMetaData = fieldContext.solidFormViewMetaData;
|
|
316
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
317
|
+
const readOnlyPermission = fieldContext.readOnly;
|
|
318
|
+
|
|
319
|
+
// Set default value to false on mount
|
|
320
|
+
useEffect(() => {
|
|
321
|
+
if (formik.values[fieldLayoutInfo.attrs.name] === undefined) {
|
|
322
|
+
console.log("Setting default value:", false);
|
|
323
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, false);
|
|
324
|
+
}
|
|
325
|
+
}, []);
|
|
326
|
+
|
|
327
|
+
const handleChange = (e: any) => {
|
|
328
|
+
const newValue = e.value;
|
|
329
|
+
console.log(`${fieldLayoutInfo.attrs.name} switch clicked, new value:`, newValue);
|
|
330
|
+
|
|
331
|
+
// formik.setFieldValue(fieldLayoutInfo.attrs.name, newValue === true ? true : false);
|
|
332
|
+
// formik.setTouched({ ...formik.touched, [fieldLayoutInfo.attrs.name]: true }); // Ensure Formik registers the change
|
|
333
|
+
// // ✅ Check if Formik updated the value correctly
|
|
334
|
+
// setTimeout(() => {
|
|
335
|
+
// console.log("Formik values after update:", formik.values);
|
|
336
|
+
// }, 0);
|
|
337
|
+
|
|
338
|
+
// 1: BYPASS Formik's validation by directly mutating the values object
|
|
339
|
+
// This is necessary because the validation schema was rejecting boolean values
|
|
340
|
+
// Direct assignment skips all validation logic that was causing the issue
|
|
341
|
+
formik.values[fieldLayoutInfo.attrs.name] = newValue;
|
|
342
|
+
|
|
343
|
+
// 2: Force Formik to recognize the change and trigger re-renders
|
|
344
|
+
// setValues() with the second parameter as 'false' means:
|
|
345
|
+
// - false = skip validation (avoid the schema conflict)
|
|
346
|
+
// - This triggers Formik's internal change detection and component re-renders
|
|
347
|
+
formik.setValues({ ...formik.values }, false);
|
|
348
|
+
|
|
349
|
+
// 3: Mark the field as "touched" to indicate user interaction
|
|
350
|
+
// This is important for validation state and form submission logic
|
|
351
|
+
// The 'false' parameter means don't validate immediately
|
|
352
|
+
formik.setTouched({ ...formik.touched, [fieldLayoutInfo.attrs.name]: true }, false);
|
|
353
|
+
fieldContext.onChange(e, 'onFieldChange');
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
const isFormFieldValid = (formik: any, fieldName: any) =>
|
|
357
|
+
formik.touched[fieldName] && formik.errors[fieldName];
|
|
358
|
+
|
|
359
|
+
const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
|
|
360
|
+
const fieldReadonly = fieldLayoutInfo.attrs?.readonly;
|
|
361
|
+
const formDisabled = solidFormViewMetaData.data.solidView?.layout?.attrs?.disabled;
|
|
362
|
+
const formReadonly = solidFormViewMetaData.data.solidView?.layout?.attrs?.readonly;
|
|
363
|
+
|
|
364
|
+
return (
|
|
365
|
+
<div className={className}>
|
|
366
|
+
<div className="relative">
|
|
367
|
+
<div className="flex flex-column gap-2 mt-1 sm:mt-2 md:mt-3 lg:mt-4">
|
|
368
|
+
{showFieldLabel !== false && (
|
|
369
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label font-medium">
|
|
370
|
+
{fieldLabel}
|
|
371
|
+
{fieldMetadata.required && <span className="text-red-500"> *</span>}
|
|
372
|
+
<SolidFieldTooltip fieldContext={fieldContext} />
|
|
373
|
+
</label>
|
|
374
|
+
)}
|
|
375
|
+
|
|
376
|
+
<div className="flex align-items-center">
|
|
377
|
+
<InputSwitch
|
|
378
|
+
id={fieldLayoutInfo.attrs.name}
|
|
379
|
+
name={fieldLayoutInfo.attrs.name}
|
|
380
|
+
checked={formik.values[fieldLayoutInfo.attrs.name] === true || formik.values[fieldLayoutInfo.attrs.name] === "true"}
|
|
381
|
+
onChange={handleChange}
|
|
382
|
+
// onChange={(e) => {fieldContext.onChange(e, 'onFieldChange')}
|
|
383
|
+
disabled={formDisabled || fieldDisabled}
|
|
384
|
+
readOnly={formReadonly || fieldReadonly || readOnlyPermission}
|
|
385
|
+
className={classNames("", {
|
|
386
|
+
"p-invalid": isFormFieldValid(formik, fieldLayoutInfo.attrs.name),
|
|
387
|
+
})}
|
|
388
|
+
/>
|
|
389
|
+
<span className="ml-2">{fieldLabel || "Yes"}</span>
|
|
390
|
+
</div>
|
|
391
|
+
</div>
|
|
392
|
+
|
|
393
|
+
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
394
|
+
<div className="absolute mt-1">
|
|
395
|
+
<Message severity="error" text={formik.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
396
|
+
</div>
|
|
397
|
+
)}
|
|
398
|
+
</div>
|
|
399
|
+
</div>
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export const DefaultBooleanFormViewWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
|
|
404
|
+
|
|
405
|
+
const fieldMetadata = fieldContext.fieldMetadata;
|
|
406
|
+
const fieldLayoutInfo = fieldContext.field;
|
|
407
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
408
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
409
|
+
|
|
410
|
+
// const trueLabel = fieldLayoutInfo?.attrs?.trueLabel;
|
|
411
|
+
// const falseLabel = fieldLayoutInfo?.attrs?.falseLabel;
|
|
412
|
+
|
|
413
|
+
const [trueLabel, setTrueLabel] = useState<string>("true");
|
|
414
|
+
const [falseLabel, setFalseLabel] = useState<string>("false");
|
|
415
|
+
|
|
416
|
+
useEffect(() => {
|
|
417
|
+
if (fieldLayoutInfo?.attrs?.trueLabel) {
|
|
418
|
+
setTrueLabel(fieldLayoutInfo?.attrs?.trueLabel)
|
|
419
|
+
}
|
|
420
|
+
if (fieldLayoutInfo?.attrs?.falseLabel) {
|
|
421
|
+
setFalseLabel(fieldLayoutInfo?.attrs?.falseLabel)
|
|
422
|
+
}
|
|
423
|
+
}, [fieldLayoutInfo?.attrs?.falseLabel, fieldLayoutInfo?.attrs?.trueLabel])
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
return (
|
|
427
|
+
<div className="mt-2 flex-column gap-2">
|
|
428
|
+
{showFieldLabel !== false && (
|
|
429
|
+
<p className="m-0 form-field-label font-medium">{fieldLabel}</p>
|
|
430
|
+
)}
|
|
431
|
+
<p className="m-0">{formik.values[fieldLayoutInfo.attrs.name] === true || formik.values[fieldLayoutInfo.attrs.name] === "true" ? trueLabel : falseLabel}</p>
|
|
432
|
+
</div>
|
|
433
|
+
);
|
|
434
|
+
}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Calendar } from "primereact/calendar";
|
|
3
|
+
import { Message } from "primereact/message";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import * as Yup from 'yup';
|
|
6
|
+
import { FormikObject, ISolidField, SolidFieldProps } from "./ISolidField";
|
|
7
|
+
import { getExtensionComponent } from "../../../../helpers/registry";
|
|
8
|
+
import { SolidFormFieldWidgetProps, SolidListFieldWidgetProps } from "../../../../types/solid-core";
|
|
9
|
+
import { SolidFieldTooltip } from "../../../../components/common/SolidFieldTooltip";
|
|
10
|
+
import { ERROR_MESSAGES } from "../../../../constants/error-messages";
|
|
11
|
+
import { Tag } from "primereact/tag";
|
|
12
|
+
import { StatusIcon } from '../../../../components/core/extension/solid-core/CustomIcon/StatusIcon';
|
|
13
|
+
import { DateFieldViewComponent } from '../../../../components/core/common/DateFieldViewComponent';
|
|
14
|
+
|
|
15
|
+
export class SolidDateField implements ISolidField {
|
|
16
|
+
|
|
17
|
+
private fieldContext: SolidFieldProps;
|
|
18
|
+
|
|
19
|
+
constructor(fieldContext: SolidFieldProps) {
|
|
20
|
+
this.fieldContext = fieldContext;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
updateFormData(value: any, formData: FormData): any {
|
|
24
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
25
|
+
|
|
26
|
+
if (value instanceof Date && !isNaN(value.getTime())) {
|
|
27
|
+
const localDate = new Date(value);
|
|
28
|
+
const utcDate = new Date(Date.UTC(localDate.getFullYear(), localDate.getMonth(), localDate.getDate()));
|
|
29
|
+
// "2025-06-10T00:00:00.000Z"
|
|
30
|
+
const isoString = utcDate.toISOString();
|
|
31
|
+
formData.append(fieldLayoutInfo.attrs.name, isoString.split('T')[0]);
|
|
32
|
+
} else if (value) {
|
|
33
|
+
formData.append(fieldLayoutInfo.attrs.name, value);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
initialValue(): any {
|
|
38
|
+
const fieldName = this.fieldContext.field.attrs.name;
|
|
39
|
+
const fieldDefaultValue = this.fieldContext?.fieldMetadata?.defaultValue;
|
|
40
|
+
|
|
41
|
+
const existingValue = this.fieldContext.data[fieldName];
|
|
42
|
+
|
|
43
|
+
return existingValue !== undefined && existingValue !== null ? existingValue : fieldDefaultValue || '';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
validationSchema(): Yup.Schema {
|
|
47
|
+
let schema: Yup.DateSchema<Date | null | undefined> = Yup.date();
|
|
48
|
+
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
49
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
50
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
51
|
+
|
|
52
|
+
// 1. required
|
|
53
|
+
if (fieldMetadata.required) {
|
|
54
|
+
schema = schema.required(ERROR_MESSAGES.FIELD_REUQIRED(fieldLabel));
|
|
55
|
+
} else {
|
|
56
|
+
schema = schema.nullable();
|
|
57
|
+
}
|
|
58
|
+
return schema;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
render(formik: FormikObject) {
|
|
62
|
+
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
63
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
64
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
65
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
66
|
+
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
67
|
+
|
|
68
|
+
let viewWidget = fieldLayoutInfo.attrs.viewWidget;
|
|
69
|
+
let editWidget = fieldLayoutInfo.attrs.editWidget;
|
|
70
|
+
if (!editWidget) {
|
|
71
|
+
editWidget = 'DefaultDateFormEditWidget';
|
|
72
|
+
}
|
|
73
|
+
if (!viewWidget) {
|
|
74
|
+
viewWidget = 'DefaultDateFormViewWidget';
|
|
75
|
+
}
|
|
76
|
+
const viewMode: string = this.fieldContext.viewMode;
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<>
|
|
80
|
+
<div className={className}>
|
|
81
|
+
{viewMode === "view" &&
|
|
82
|
+
this.renderExtensionRenderMode(viewWidget, formik)
|
|
83
|
+
}
|
|
84
|
+
{viewMode === "edit" && (
|
|
85
|
+
<>
|
|
86
|
+
{editWidget &&
|
|
87
|
+
this.renderExtensionRenderMode(editWidget, formik)
|
|
88
|
+
}
|
|
89
|
+
</>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
</div>
|
|
93
|
+
</>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
renderExtensionRenderMode(widget: string, formik: FormikObject) {
|
|
98
|
+
let DynamicWidget = getExtensionComponent(widget);
|
|
99
|
+
const widgetProps: SolidFormFieldWidgetProps = {
|
|
100
|
+
formik: formik,
|
|
101
|
+
fieldContext: this.fieldContext,
|
|
102
|
+
}
|
|
103
|
+
return (
|
|
104
|
+
<>
|
|
105
|
+
{DynamicWidget && <DynamicWidget {...widgetProps} />}
|
|
106
|
+
</>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
export const DefaultDateFormEditWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
|
|
114
|
+
|
|
115
|
+
const [overlayVisible, setOverlayVisible] = useState(false);
|
|
116
|
+
const fieldMetadata = fieldContext.fieldMetadata;
|
|
117
|
+
const fieldLayoutInfo = fieldContext.field;
|
|
118
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
119
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
120
|
+
const calendarRef = useRef<any>(null); // Reference for the Calendar component
|
|
121
|
+
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
122
|
+
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
123
|
+
const solidFormViewMetaData = fieldContext.solidFormViewMetaData;
|
|
124
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
125
|
+
const readOnlyPermission = fieldContext.readOnly;
|
|
126
|
+
|
|
127
|
+
const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
|
|
128
|
+
// const fieldReadonly = fieldLayoutInfo.attrs?.readonly;
|
|
129
|
+
|
|
130
|
+
const formDisabled = solidFormViewMetaData.data.solidView?.layout?.attrs?.disabled;
|
|
131
|
+
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
const handleDocumentClick = (event: MouseEvent) => {
|
|
134
|
+
const inputElement = calendarRef.current?.getInput();
|
|
135
|
+
const overlayElement = calendarRef.current?.getOverlay();
|
|
136
|
+
|
|
137
|
+
if (overlayVisible && inputElement && !inputElement.contains(event.target as Node) && overlayElement && !overlayElement.contains(event.target as Node)) {
|
|
138
|
+
setOverlayVisible(false);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
document.addEventListener('mousedown', handleDocumentClick);
|
|
143
|
+
return () => {
|
|
144
|
+
document.removeEventListener('mousedown', handleDocumentClick);
|
|
145
|
+
};
|
|
146
|
+
}, [overlayVisible]);
|
|
147
|
+
|
|
148
|
+
const handleInputClick = () => {
|
|
149
|
+
setOverlayVisible(true);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
return (
|
|
154
|
+
<div className="relative">
|
|
155
|
+
<div className="flex flex-column gap-2 mt-1 sm:mt-2 md:mt-3 lg:mt-4">
|
|
156
|
+
{showFieldLabel != false &&
|
|
157
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
158
|
+
{fieldMetadata.required && <span className="text-red-500"> *</span>}
|
|
159
|
+
<SolidFieldTooltip fieldContext={fieldContext} />
|
|
160
|
+
{/* {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>} */}
|
|
161
|
+
</label>
|
|
162
|
+
}
|
|
163
|
+
<div onClick={handleInputClick} id={fieldLayoutInfo.attrs.name}>
|
|
164
|
+
<Calendar
|
|
165
|
+
disabled={formDisabled || fieldDisabled || readOnlyPermission}
|
|
166
|
+
ref={calendarRef} // Attach ref to Calendar
|
|
167
|
+
aria-describedby={`${fieldLayoutInfo.attrs.name}-help`}
|
|
168
|
+
name={fieldMetadata.name}
|
|
169
|
+
// onChange={formik.handleChange}
|
|
170
|
+
onChange={(e) => fieldContext.onChange(e, 'onFieldChange')}
|
|
171
|
+
//@ts-ignore
|
|
172
|
+
value={formik.values[fieldLayoutInfo.attrs.name] ? new Date(formik.values[fieldLayoutInfo.attrs.name]) : Date()}
|
|
173
|
+
// dateFormat="mm/dd/yy"
|
|
174
|
+
// placeholder="mm/dd/yyyy hh:mm"
|
|
175
|
+
mask="99/99/9999"
|
|
176
|
+
hideOnDateTimeSelect
|
|
177
|
+
appendTo="self"
|
|
178
|
+
className=""
|
|
179
|
+
onFocus={() => setOverlayVisible(true)}
|
|
180
|
+
visible={overlayVisible}
|
|
181
|
+
onVisibleChange={(e) => {
|
|
182
|
+
console.log("Overlay visibility changed:", e.visible);
|
|
183
|
+
setOverlayVisible(e.visible);
|
|
184
|
+
}}
|
|
185
|
+
onBlur={(e: React.FocusEvent) => {
|
|
186
|
+
if (calendarRef.current?.getOverlay()?.contains(e.relatedTarget as Node)) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
setOverlayVisible(false);
|
|
190
|
+
}}
|
|
191
|
+
onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
192
|
+
if (e.key === "Tab") {
|
|
193
|
+
setOverlayVisible(false);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
201
|
+
<div className="absolute mt-1">
|
|
202
|
+
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
203
|
+
</div>
|
|
204
|
+
)}
|
|
205
|
+
</div>
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
export const DefaultDateFormViewWidget = ({ formik, fieldContext, }: SolidFormFieldWidgetProps) => {
|
|
209
|
+
const fieldMetadata = fieldContext.fieldMetadata;
|
|
210
|
+
const fieldLayoutInfo = fieldContext.field;
|
|
211
|
+
|
|
212
|
+
const fieldName = fieldLayoutInfo.attrs.name;
|
|
213
|
+
const fieldLabel =
|
|
214
|
+
fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
215
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
216
|
+
|
|
217
|
+
const rawValue = formik.values[fieldName];
|
|
218
|
+
const format = fieldLayoutInfo.attrs?.format as string | undefined;
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
return (
|
|
222
|
+
<div className="mt-2 flex flex-column gap-2">
|
|
223
|
+
{showFieldLabel !== false && (
|
|
224
|
+
<p className="m-0 form-field-label font-medium">
|
|
225
|
+
{fieldLabel}
|
|
226
|
+
</p>
|
|
227
|
+
)}
|
|
228
|
+
|
|
229
|
+
<p className="m-0">
|
|
230
|
+
{/* {displayValue ?? "-"} */}
|
|
231
|
+
<DateFieldViewComponent value={rawValue} format={format} fallback="-"></DateFieldViewComponent>
|
|
232
|
+
</p>
|
|
233
|
+
</div>
|
|
234
|
+
);
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
export const PublishedStatusListViewWidget = ({ rowData, solidListViewMetaData, fieldMetadata, column }: SolidListFieldWidgetProps) => {
|
|
239
|
+
|
|
240
|
+
const colVal = rowData[column.attrs.name]; // publishedAt value
|
|
241
|
+
|
|
242
|
+
const isPublished = !!colVal;
|
|
243
|
+
|
|
244
|
+
return (
|
|
245
|
+
<StatusIcon isPublished={isPublished} />
|
|
246
|
+
);
|
|
247
|
+
};
|