@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,390 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { InputText } from "primereact/inputtext";
|
|
3
|
+
import { Message } from "primereact/message";
|
|
4
|
+
import * as Yup from 'yup';
|
|
5
|
+
import { FormikObject, ISolidField, SolidFieldProps } from "./ISolidField";
|
|
6
|
+
import { Password } from "primereact/password";
|
|
7
|
+
import { getExtensionComponent } from "../../../../helpers/registry";
|
|
8
|
+
import { SolidFormFieldWidgetProps } from "../../../../types/solid-core";
|
|
9
|
+
import { useState } from "react";
|
|
10
|
+
import { SolidFieldTooltip } from "../../../../components/common/SolidFieldTooltip";
|
|
11
|
+
import { Formik, useFormik } from "formik";
|
|
12
|
+
import { Dialog } from "primereact/dialog";
|
|
13
|
+
import { Button } from "primereact/button";
|
|
14
|
+
import { usePathname, useSearchParams } from "next/navigation";
|
|
15
|
+
import { updatePasswordField } from "../../../../helpers/updatePasswordField";
|
|
16
|
+
import { ERROR_MESSAGES } from "../../../../constants/error-messages";
|
|
17
|
+
|
|
18
|
+
export class SolidPasswordField implements ISolidField {
|
|
19
|
+
|
|
20
|
+
private fieldContext: SolidFieldProps;
|
|
21
|
+
|
|
22
|
+
constructor(fieldContext: SolidFieldProps) {
|
|
23
|
+
this.fieldContext = fieldContext;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
updateFormData(value: any, formData: FormData): void {
|
|
27
|
+
const fieldName = this.fieldContext?.field?.attrs?.name;
|
|
28
|
+
if (value !== undefined && value !== null && value !== '') {
|
|
29
|
+
formData.append(fieldName, value);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
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
|
+
// return existingValue !== undefined && existingValue !== null ? existingValue : fieldDefaultValue || '';
|
|
40
|
+
return existingValue !== undefined && existingValue !== null ? undefined : fieldDefaultValue || '';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
validationSchema(): Yup.Schema {
|
|
44
|
+
let schema: Yup.StringSchema<string | null | undefined> = Yup.string();
|
|
45
|
+
|
|
46
|
+
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
47
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
48
|
+
const fieldName = fieldLayoutInfo.attrs.name;
|
|
49
|
+
const confirmFieldName = `${fieldName}Confirm`;
|
|
50
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
51
|
+
|
|
52
|
+
// 1. required
|
|
53
|
+
// 1. required
|
|
54
|
+
if (fieldMetadata.required) {
|
|
55
|
+
schema = schema.required(ERROR_MESSAGES.FIELD_REUQIRED(fieldLabel));
|
|
56
|
+
} else {
|
|
57
|
+
schema = schema.nullable(); // Allow null when not required
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// 2. length (min/max)
|
|
61
|
+
if (fieldMetadata.min && fieldMetadata.min > 0) {
|
|
62
|
+
schema = schema.min(fieldMetadata.min, ERROR_MESSAGES.FIELD_MINIMUM_CHARACTER(fieldLabel, fieldMetadata.min));
|
|
63
|
+
}
|
|
64
|
+
if (fieldMetadata.max && fieldMetadata.max > 0) {
|
|
65
|
+
schema = schema.max(fieldMetadata.max, ERROR_MESSAGES.FIELD_MAXIMUM_CHARACTER(fieldLabel, fieldMetadata.max));
|
|
66
|
+
}
|
|
67
|
+
// 3. regular expression
|
|
68
|
+
if (fieldMetadata.regexPattern) {
|
|
69
|
+
const regexPatternNotMatchingErrorMsg = fieldMetadata.regexPatternNotMatchingErrorMsg ?? ERROR_MESSAGES.FIELD_INVALID_DATA(fieldLabel)
|
|
70
|
+
schema = schema.matches(fieldMetadata.regexPattern, regexPatternNotMatchingErrorMsg);
|
|
71
|
+
}
|
|
72
|
+
//check password and confirm password match if password have value
|
|
73
|
+
schema = schema.test('passwords-match', ERROR_MESSAGES.FIELD_MUST_MATCH(fieldLabel), function (value) {
|
|
74
|
+
const { path, parent } = this;
|
|
75
|
+
const confirmValue = parent[confirmFieldName];
|
|
76
|
+
|
|
77
|
+
// Edit mode / untouched → SKIP
|
|
78
|
+
if (!value && !confirmValue) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
// Only one filled → ERROR
|
|
82
|
+
if (value || confirmValue) {
|
|
83
|
+
return value === confirmValue;
|
|
84
|
+
}
|
|
85
|
+
return true; // If password is empty, don't validate match
|
|
86
|
+
});
|
|
87
|
+
return schema;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
render(formik: FormikObject) {
|
|
91
|
+
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
92
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
93
|
+
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
94
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
95
|
+
let viewWidget = fieldLayoutInfo.attrs.viewWidget;
|
|
96
|
+
let editWidget = fieldLayoutInfo.attrs.editWidget;
|
|
97
|
+
let createWidget = fieldLayoutInfo?.attrs?.createWidget;
|
|
98
|
+
const pathname = usePathname();
|
|
99
|
+
const isCreateForm = pathname.endsWith('/new');
|
|
100
|
+
const data = this.fieldContext.data || {};
|
|
101
|
+
const isFieldDataEmpty = Object.keys(data).length === 0;
|
|
102
|
+
if (!createWidget) {
|
|
103
|
+
createWidget = 'DefaultPasswordFormCreateWidget';
|
|
104
|
+
}
|
|
105
|
+
if (!editWidget) {
|
|
106
|
+
editWidget = 'DefaultPasswordFormEditWidget';
|
|
107
|
+
}
|
|
108
|
+
if (!viewWidget) {
|
|
109
|
+
viewWidget = 'DefaultPasswordFormViewWidget'; // add of this need to createWidget
|
|
110
|
+
}
|
|
111
|
+
const viewMode: string = this.fieldContext.viewMode;
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<>
|
|
115
|
+
<div className={className}>
|
|
116
|
+
{viewMode === "view" &&
|
|
117
|
+
<></>
|
|
118
|
+
// this.renderExtensionRenderMode(viewWidget, formik)
|
|
119
|
+
}
|
|
120
|
+
{viewMode === "edit" && (!isCreateForm && !isFieldDataEmpty) &&
|
|
121
|
+
<>
|
|
122
|
+
{editWidget &&
|
|
123
|
+
this.renderExtensionRenderMode(editWidget, formik)
|
|
124
|
+
}
|
|
125
|
+
</>
|
|
126
|
+
}
|
|
127
|
+
{viewMode === "edit" && (isCreateForm || isFieldDataEmpty) &&
|
|
128
|
+
<>
|
|
129
|
+
{createWidget &&
|
|
130
|
+
this.renderExtensionRenderMode(createWidget, formik)
|
|
131
|
+
}
|
|
132
|
+
</>
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
</div>
|
|
136
|
+
</>
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
renderExtensionRenderMode(widget: string, formik: FormikObject) {
|
|
141
|
+
let DynamicWidget = getExtensionComponent(widget);
|
|
142
|
+
const widgetProps: SolidFormFieldWidgetProps = {
|
|
143
|
+
formik: formik,
|
|
144
|
+
fieldContext: this.fieldContext,
|
|
145
|
+
}
|
|
146
|
+
return (
|
|
147
|
+
<>
|
|
148
|
+
{DynamicWidget && <DynamicWidget {...widgetProps} />}
|
|
149
|
+
</>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export const DefaultPasswordFormViewWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
|
|
155
|
+
const fieldMetadata = fieldContext.fieldMetadata;
|
|
156
|
+
const fieldLayoutInfo = fieldContext.field;
|
|
157
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
158
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
159
|
+
const [isText, setIsText] = useState(false)
|
|
160
|
+
return (
|
|
161
|
+
<div className="mt-2 flex-column gap-2">
|
|
162
|
+
{showFieldLabel !== false && (
|
|
163
|
+
<p className="m-0 form-field-label font-medium">{fieldLabel}</p>
|
|
164
|
+
)}
|
|
165
|
+
<div className="flex align-items-center gap-4">
|
|
166
|
+
<p className="m-0">
|
|
167
|
+
{isText ? formik.values[fieldLayoutInfo.attrs.name] : "••••••••"}
|
|
168
|
+
</p>
|
|
169
|
+
<i
|
|
170
|
+
className={`pi ${isText ? 'pi-eye' : 'pi-eye-slash'}`}
|
|
171
|
+
onClick={() => setIsText(!isText)}
|
|
172
|
+
style={{ cursor: 'pointer' }}
|
|
173
|
+
/>
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
</div>
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
// Adding formCreateWidget
|
|
183
|
+
export const DefaultPasswordFormCreateWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
|
|
184
|
+
const fieldMetadata = fieldContext.fieldMetadata;
|
|
185
|
+
const fieldLayoutInfo = fieldContext.field;
|
|
186
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
187
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
188
|
+
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
189
|
+
const solidFormViewMetaData = fieldContext.solidFormViewMetaData;
|
|
190
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
191
|
+
const readOnlyPermission = fieldContext.readOnly;
|
|
192
|
+
|
|
193
|
+
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
194
|
+
|
|
195
|
+
const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
|
|
196
|
+
const fieldReadonly = fieldLayoutInfo.attrs?.readonly;
|
|
197
|
+
|
|
198
|
+
const formDisabled = solidFormViewMetaData.data.solidView?.layout?.attrs?.disabled;
|
|
199
|
+
const formReadonly = solidFormViewMetaData.data.solidView?.layout?.attrs?.readonly;
|
|
200
|
+
return (
|
|
201
|
+
<div className="relative ">
|
|
202
|
+
<div className="password-field-component">
|
|
203
|
+
<div className="flex flex-column gap-2 mt-1 sm:mt-2 md:mt-3 lg:mt-4">
|
|
204
|
+
{showFieldLabel != false &&
|
|
205
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">
|
|
206
|
+
{fieldLabel}
|
|
207
|
+
{fieldMetadata.required && <span className="text-red-500"> *</span>}
|
|
208
|
+
<SolidFieldTooltip fieldContext={fieldContext} />
|
|
209
|
+
</label>
|
|
210
|
+
}
|
|
211
|
+
<Password
|
|
212
|
+
id={fieldLayoutInfo.attrs.name}
|
|
213
|
+
name={fieldMetadata.name}
|
|
214
|
+
value={formik.values[fieldLayoutInfo.attrs.name] || ''}
|
|
215
|
+
onChange={(e) => fieldContext.onChange(e, 'onFieldChange')}
|
|
216
|
+
onBlur={(e) => fieldContext.onBlur(e, 'onFieldBlur')}
|
|
217
|
+
readOnly={formReadonly || fieldReadonly || readOnlyPermission}
|
|
218
|
+
disabled={formDisabled || fieldDisabled}
|
|
219
|
+
toggleMask
|
|
220
|
+
autoComplete="new-password"
|
|
221
|
+
/>
|
|
222
|
+
</div>
|
|
223
|
+
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
224
|
+
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
225
|
+
)}
|
|
226
|
+
|
|
227
|
+
<div className="flex flex-column gap-2 mt-1 sm:mt-2 md:mt-3 lg:mt-4">
|
|
228
|
+
<label htmlFor={`${fieldLayoutInfo.attrs.name}Confirm`} className="form-field-label">
|
|
229
|
+
Confirm {fieldLabel}
|
|
230
|
+
{fieldMetadata.required && <span className="text-red-500"> *</span>}
|
|
231
|
+
</label>
|
|
232
|
+
<Password
|
|
233
|
+
id={`${fieldLayoutInfo.attrs.name}Confirm`}
|
|
234
|
+
name={`${fieldLayoutInfo.attrs.name}Confirm`}
|
|
235
|
+
value={formik.values[`${fieldLayoutInfo.attrs.name}Confirm`] || ''}
|
|
236
|
+
onChange={(e) => {
|
|
237
|
+
formik.setFieldValue(`${fieldLayoutInfo.attrs.name}Confirm`, e.target.value);
|
|
238
|
+
}}
|
|
239
|
+
onBlur={(e) => {
|
|
240
|
+
formik.setFieldTouched(`${fieldLayoutInfo.attrs.name}Confirm`, true);
|
|
241
|
+
}}
|
|
242
|
+
readOnly={formReadonly || fieldReadonly || readOnlyPermission}
|
|
243
|
+
disabled={formDisabled || fieldDisabled}
|
|
244
|
+
toggleMask
|
|
245
|
+
autoComplete="new-password"
|
|
246
|
+
/>
|
|
247
|
+
{isFormFieldValid(formik, `${fieldLayoutInfo.attrs.name}Confirm`) && (
|
|
248
|
+
<Message severity="error" text={formik?.errors[`${fieldLayoutInfo.attrs.name}Confirm`]?.toString()} />
|
|
249
|
+
)}
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
// Adding formEditWidget custom
|
|
258
|
+
|
|
259
|
+
export const DefaultPasswordFormEditWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
|
|
260
|
+
const fieldMetadata = fieldContext.fieldMetadata;
|
|
261
|
+
const fieldLayoutInfo = fieldContext.field;
|
|
262
|
+
|
|
263
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
264
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
265
|
+
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
266
|
+
const solidFormViewMetaData = fieldContext.solidFormViewMetaData;
|
|
267
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
268
|
+
const readOnlyPermission = fieldContext.readOnly;
|
|
269
|
+
|
|
270
|
+
const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
|
|
271
|
+
const fieldReadonly = fieldLayoutInfo.attrs?.readonly;
|
|
272
|
+
const formDisabled = solidFormViewMetaData.data.solidView?.layout?.attrs?.disabled;
|
|
273
|
+
const formReadonly = solidFormViewMetaData.data.solidView?.layout?.attrs?.readonly;
|
|
274
|
+
const url = fieldContext?.modelName
|
|
275
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
|
276
|
+
.replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')
|
|
277
|
+
.toLowerCase();
|
|
278
|
+
const id = fieldContext?.data?.id;
|
|
279
|
+
|
|
280
|
+
const isFormFieldValid = (formik: any, fieldName: string) =>
|
|
281
|
+
formik.touched[fieldName] && formik.errors[fieldName];
|
|
282
|
+
|
|
283
|
+
const [visible, setVisible] = useState(false);
|
|
284
|
+
|
|
285
|
+
const fieldName = fieldLayoutInfo.attrs.name;
|
|
286
|
+
const confirmFieldName = `${fieldName}Confirm`;
|
|
287
|
+
|
|
288
|
+
const modalFormik = useFormik({
|
|
289
|
+
initialValues: {
|
|
290
|
+
[fieldName]: '',
|
|
291
|
+
[confirmFieldName]: '',
|
|
292
|
+
},
|
|
293
|
+
validationSchema: Yup.object({
|
|
294
|
+
[fieldName]: Yup.string().required(ERROR_MESSAGES.FIELD_REUQIRED(fieldLabel)),
|
|
295
|
+
[confirmFieldName]: Yup.string()
|
|
296
|
+
.required(`Confirm ${ERROR_MESSAGES.FIELD_REUQIRED(fieldLabel)}`)
|
|
297
|
+
.oneOf([Yup.ref(fieldName)], ERROR_MESSAGES.FIELD_MUST_MATCH(fieldLabel)),
|
|
298
|
+
}),
|
|
299
|
+
onSubmit: async (values: { [x: string]: any; }, { resetForm }: any) => {
|
|
300
|
+
try {
|
|
301
|
+
await updatePasswordField({
|
|
302
|
+
url,
|
|
303
|
+
id,
|
|
304
|
+
fieldName,
|
|
305
|
+
fieldValue: values[fieldName],
|
|
306
|
+
confirmFieldName,
|
|
307
|
+
confirmFieldValue: values[confirmFieldName],
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
// formik.setFieldValue(fieldName, values[fieldName]);
|
|
311
|
+
resetForm();
|
|
312
|
+
setVisible(false);
|
|
313
|
+
} catch (err) {
|
|
314
|
+
console.error(err);
|
|
315
|
+
// TODO: show user-friendly error
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
return (
|
|
321
|
+
<div className={className}>
|
|
322
|
+
{showFieldLabel !== false && (
|
|
323
|
+
<label htmlFor={fieldName} className="form-field-label">
|
|
324
|
+
{fieldLabel}
|
|
325
|
+
{fieldMetadata.required && <span className="text-red-500"> *</span>}
|
|
326
|
+
<SolidFieldTooltip fieldContext={fieldContext} />
|
|
327
|
+
</label>
|
|
328
|
+
)}
|
|
329
|
+
|
|
330
|
+
<Button
|
|
331
|
+
type="button"
|
|
332
|
+
label="Change Password"
|
|
333
|
+
icon="pi pi-lock"
|
|
334
|
+
onClick={() => setVisible(true)}
|
|
335
|
+
className="mt-2"
|
|
336
|
+
disabled={formDisabled || fieldDisabled || readOnlyPermission || fieldReadonly}
|
|
337
|
+
/>
|
|
338
|
+
|
|
339
|
+
<Dialog
|
|
340
|
+
header={`Change ${fieldLabel}`}
|
|
341
|
+
visible={visible}
|
|
342
|
+
onHide={() => setVisible(false)}
|
|
343
|
+
style={{ width: '30vw' }}
|
|
344
|
+
className="solid-confirm-dialog"
|
|
345
|
+
>
|
|
346
|
+
<form onSubmit={modalFormik.handleSubmit} className="p-fluid">
|
|
347
|
+
<div className="field">
|
|
348
|
+
<label htmlFor={fieldName}>New {fieldLabel}</label>
|
|
349
|
+
<Password
|
|
350
|
+
id={fieldName}
|
|
351
|
+
name={fieldName}
|
|
352
|
+
value={modalFormik.values[fieldName]}
|
|
353
|
+
onChange={modalFormik.handleChange}
|
|
354
|
+
onBlur={modalFormik.handleBlur}
|
|
355
|
+
toggleMask
|
|
356
|
+
feedback={false}
|
|
357
|
+
autoComplete="new-password"
|
|
358
|
+
/>
|
|
359
|
+
{isFormFieldValid(modalFormik, fieldName) && (
|
|
360
|
+
<Message severity="error" text={modalFormik.errors[fieldName]?.toString()} />
|
|
361
|
+
)}
|
|
362
|
+
</div>
|
|
363
|
+
|
|
364
|
+
<div className="field mt-4">
|
|
365
|
+
<label htmlFor={confirmFieldName}>Confirm {fieldLabel}</label>
|
|
366
|
+
<Password
|
|
367
|
+
id={confirmFieldName}
|
|
368
|
+
name={confirmFieldName}
|
|
369
|
+
value={modalFormik.values[confirmFieldName]}
|
|
370
|
+
onChange={modalFormik.handleChange}
|
|
371
|
+
onBlur={modalFormik.handleBlur}
|
|
372
|
+
toggleMask
|
|
373
|
+
feedback={false}
|
|
374
|
+
autoComplete="new-password"
|
|
375
|
+
/>
|
|
376
|
+
{isFormFieldValid(modalFormik, confirmFieldName) && (
|
|
377
|
+
<Message severity="error" text={modalFormik.errors[confirmFieldName]?.toString()} />
|
|
378
|
+
)}
|
|
379
|
+
</div>
|
|
380
|
+
|
|
381
|
+
<div className="mt-5">
|
|
382
|
+
<Button label="Update Password" icon="pi pi-check" type="submit" className="w-full" />
|
|
383
|
+
</div>
|
|
384
|
+
</form>
|
|
385
|
+
</Dialog>
|
|
386
|
+
</div>
|
|
387
|
+
);
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Schema } from "yup";
|
|
3
|
+
import { FormikObject, ISolidField, SolidFieldProps } from "./ISolidField";
|
|
4
|
+
import { SolidRelationManyToManyField } from "./relations/SolidRelationManyToManyField";
|
|
5
|
+
import { SolidRelationManyToOneField } from "./relations/SolidRelationManyToOneField";
|
|
6
|
+
import { SolidRelationOneToManyField } from "./relations/SolidRelationOneToManyField";
|
|
7
|
+
import { ERROR_MESSAGES } from "../../../../constants/error-messages";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export class SolidRelationField implements ISolidField {
|
|
11
|
+
|
|
12
|
+
private fieldContext: SolidFieldProps;
|
|
13
|
+
|
|
14
|
+
constructor(fieldContext: SolidFieldProps) {
|
|
15
|
+
this.fieldContext = fieldContext;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
relationField(): ISolidField {
|
|
19
|
+
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
20
|
+
let relationField = null;
|
|
21
|
+
|
|
22
|
+
if (fieldMetadata.relationType === 'many-to-one') {
|
|
23
|
+
relationField = new SolidRelationManyToOneField(this.fieldContext);
|
|
24
|
+
}
|
|
25
|
+
if (fieldMetadata.relationType === 'many-to-many') {
|
|
26
|
+
relationField = new SolidRelationManyToManyField(this.fieldContext);
|
|
27
|
+
}
|
|
28
|
+
if (fieldMetadata.relationType === 'one-to-many') {
|
|
29
|
+
relationField = new SolidRelationOneToManyField(this.fieldContext);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (!relationField) {
|
|
33
|
+
throw new Error(ERROR_MESSAGES.INVALID_RELATION_TYPE(fieldMetadata.relationType , this.fieldContext.field.attrs.name))
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return relationField;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
initialValue(): any {
|
|
41
|
+
return this.relationField()?.initialValue();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
updateFormData(value: any, formData: FormData): any {
|
|
45
|
+
return this.relationField().updateFormData(value, formData);
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
validationSchema(): Schema {
|
|
50
|
+
return this.relationField().validationSchema();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
render(formik: FormikObject) {
|
|
54
|
+
return this.relationField().render(formik);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Editor } from "primereact/editor";
|
|
3
|
+
import { Message } from "primereact/message";
|
|
4
|
+
import { 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 } from "../../../../types/solid-core";
|
|
9
|
+
import { SolidFieldTooltip } from "../../../../components/common/SolidFieldTooltip";
|
|
10
|
+
import { ERROR_MESSAGES } from "../../../../constants/error-messages";
|
|
11
|
+
|
|
12
|
+
export class SolidRichTextField implements ISolidField {
|
|
13
|
+
|
|
14
|
+
private fieldContext: SolidFieldProps;
|
|
15
|
+
|
|
16
|
+
constructor(fieldContext: SolidFieldProps) {
|
|
17
|
+
this.fieldContext = fieldContext;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
updateFormData(value: any, formData: FormData): any {
|
|
21
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
22
|
+
if (value !== undefined && value !== null) {
|
|
23
|
+
formData.append(fieldLayoutInfo.attrs.name, value);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
initialValue(): any {
|
|
28
|
+
return this.fieldContext.data[this.fieldContext.field.attrs.name];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
validationSchema(): Yup.Schema {
|
|
32
|
+
let schema: Yup.StringSchema<string | null | undefined> = Yup.string();
|
|
33
|
+
|
|
34
|
+
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
35
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
36
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
37
|
+
|
|
38
|
+
// 1. required
|
|
39
|
+
if (fieldMetadata.required) {
|
|
40
|
+
schema = schema.required(ERROR_MESSAGES.FIELD_REUQIRED(fieldLabel));
|
|
41
|
+
} else {
|
|
42
|
+
schema = schema.nullable(); // Allow null when not required
|
|
43
|
+
}
|
|
44
|
+
// 2. length (min/max)
|
|
45
|
+
if (fieldMetadata.min && fieldMetadata.min > 0) {
|
|
46
|
+
schema = schema.min(fieldMetadata.min, ERROR_MESSAGES.FIELD_MINIMUM_CHARACTER(fieldLabel,fieldMetadata.min));
|
|
47
|
+
}
|
|
48
|
+
if (fieldMetadata.max && fieldMetadata.max > 0) {
|
|
49
|
+
schema = schema.max(fieldMetadata.max, ERROR_MESSAGES.FIELD_MAXIMUM_CHARACTER(fieldLabel,fieldMetadata.max));
|
|
50
|
+
}
|
|
51
|
+
// 3. regular expression
|
|
52
|
+
if (fieldMetadata.regexPattern) {
|
|
53
|
+
const regexPatternNotMatchingErrorMsg = fieldMetadata.regexPatternNotMatchingErrorMsg ?? `${fieldLabel} has invalid data.`
|
|
54
|
+
schema = schema.matches(fieldMetadata.regexPattern, regexPatternNotMatchingErrorMsg);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return schema;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
render(formik: FormikObject) {
|
|
61
|
+
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
62
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
63
|
+
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
64
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
let viewWidget = fieldLayoutInfo.attrs.viewWidget;
|
|
68
|
+
let editWidget = fieldLayoutInfo.attrs.editWidget;
|
|
69
|
+
if (!editWidget) {
|
|
70
|
+
editWidget = 'DefaultRichTextFormEditWidget';
|
|
71
|
+
}
|
|
72
|
+
if (!viewWidget) {
|
|
73
|
+
viewWidget = 'DefaultRichTextFormViewWidget';
|
|
74
|
+
}
|
|
75
|
+
const viewMode: string = this.fieldContext.viewMode;
|
|
76
|
+
|
|
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
|
+
</div>
|
|
92
|
+
</>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
renderExtensionRenderMode(widget: string, formik: FormikObject) {
|
|
97
|
+
let DynamicWidget = getExtensionComponent(widget);
|
|
98
|
+
const widgetProps: SolidFormFieldWidgetProps = {
|
|
99
|
+
formik: formik,
|
|
100
|
+
fieldContext: this.fieldContext,
|
|
101
|
+
}
|
|
102
|
+
return (
|
|
103
|
+
<>
|
|
104
|
+
{DynamicWidget && <DynamicWidget {...widgetProps} />}
|
|
105
|
+
</>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
export const DefaultRichTextFormEditWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
|
|
113
|
+
const fieldMetadata = fieldContext.fieldMetadata;
|
|
114
|
+
const fieldLayoutInfo = fieldContext.field;
|
|
115
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
116
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
117
|
+
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
118
|
+
const solidFormViewMetaData = fieldContext.solidFormViewMetaData;
|
|
119
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
120
|
+
const readOnlyPermission = fieldContext.readOnly;
|
|
121
|
+
|
|
122
|
+
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
123
|
+
|
|
124
|
+
const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
|
|
125
|
+
const fieldReadonly = fieldLayoutInfo.attrs?.readonly;
|
|
126
|
+
|
|
127
|
+
const formDisabled = solidFormViewMetaData.data.solidView?.layout?.attrs?.disabled;
|
|
128
|
+
const formReadonly = solidFormViewMetaData.data.solidView?.layout?.attrs?.readonly;
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<div className="relative">
|
|
133
|
+
<div className="flex flex-column gap-2 mt-1 sm:mt-2 md:mt-3 lg:mt-4">
|
|
134
|
+
{showFieldLabel != false &&
|
|
135
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
136
|
+
{fieldMetadata.required && <span className="text-red-500"> *</span>}
|
|
137
|
+
<SolidFieldTooltip fieldContext={fieldContext} />
|
|
138
|
+
{/* {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>} */}
|
|
139
|
+
</label>
|
|
140
|
+
}
|
|
141
|
+
<Editor
|
|
142
|
+
readOnly={formReadonly || fieldReadonly || readOnlyPermission}
|
|
143
|
+
disabled={formDisabled || fieldDisabled}
|
|
144
|
+
key={fieldLayoutInfo.attrs.name} // React will re-render the component whenever this value changes
|
|
145
|
+
id={fieldLayoutInfo.attrs.name}
|
|
146
|
+
value={formik.values[fieldLayoutInfo.attrs.name]}
|
|
147
|
+
onTextChange={e => formik.setFieldValue(fieldLayoutInfo.attrs.name, e.htmlValue)}
|
|
148
|
+
style={{ height: "320px" }}
|
|
149
|
+
className="solid-custom-editor"
|
|
150
|
+
/>
|
|
151
|
+
</div>
|
|
152
|
+
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
153
|
+
<div className="absolute mt-1">
|
|
154
|
+
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
155
|
+
</div>
|
|
156
|
+
)}
|
|
157
|
+
</div>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export const DefaultRichTextFormViewWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
|
|
162
|
+
const fieldMetadata = fieldContext.fieldMetadata;
|
|
163
|
+
const fieldLayoutInfo = fieldContext.field;
|
|
164
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
165
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
166
|
+
const [isText, setIsText] = useState(false)
|
|
167
|
+
return (
|
|
168
|
+
<div className="relative">
|
|
169
|
+
<div className="flex flex-column gap-2 mt-1 sm:mt-2 md:mt-3 lg:mt-4">
|
|
170
|
+
{showFieldLabel != false &&
|
|
171
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
172
|
+
{fieldMetadata.required && <span className="text-red-500"> *</span>}
|
|
173
|
+
<SolidFieldTooltip fieldContext={fieldContext} />
|
|
174
|
+
{/* {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>} */}
|
|
175
|
+
</label>
|
|
176
|
+
}
|
|
177
|
+
<Editor
|
|
178
|
+
readOnly={true}
|
|
179
|
+
key={fieldLabel} // React will re-render the component whenever this value changes
|
|
180
|
+
id={fieldLabel}
|
|
181
|
+
value={formik.values[fieldLayoutInfo.attrs.name]}
|
|
182
|
+
style={{ height: "320px" }}
|
|
183
|
+
className="solid-custom-editor"
|
|
184
|
+
/>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
);
|
|
188
|
+
}
|