@solidxai/core-ui 0.1.8-beta.2 → 0.1.8-beta.21
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/adapters/auth/getSession.d.ts.map +1 -1
- package/dist/adapters/auth/getSession.js +1 -1
- package/dist/adapters/auth/getSession.js.map +1 -1
- package/dist/adapters/auth/getSession.ts +1 -0
- package/dist/adapters/auth/helper.d.ts.map +1 -1
- package/dist/adapters/auth/helper.js +1 -0
- package/dist/adapters/auth/helper.js.map +1 -1
- package/dist/adapters/auth/helper.ts +3 -1
- package/dist/adapters/auth/signIn.d.ts.map +1 -1
- package/dist/adapters/auth/signIn.js +1 -0
- package/dist/adapters/auth/signIn.js.map +1 -1
- package/dist/adapters/auth/signIn.ts +3 -1
- package/dist/adapters/auth/signInWithOAuthAccessCode.d.ts +1 -0
- package/dist/adapters/auth/signInWithOAuthAccessCode.d.ts.map +1 -1
- package/dist/adapters/auth/signInWithOAuthAccessCode.js +10 -9
- package/dist/adapters/auth/signInWithOAuthAccessCode.js.map +1 -1
- package/dist/adapters/auth/signInWithOAuthAccessCode.ts +6 -3
- package/dist/adapters/auth/signOut.d.ts.map +1 -1
- package/dist/adapters/auth/signOut.js +7 -1
- package/dist/adapters/auth/signOut.js.map +1 -1
- package/dist/adapters/auth/signOut.ts +7 -1
- package/dist/adapters/auth/types.d.ts +1 -0
- package/dist/adapters/auth/types.d.ts.map +1 -1
- package/dist/adapters/auth/types.js.map +1 -1
- package/dist/adapters/auth/types.ts +1 -0
- package/dist/components/auth/AuthLayout.d.ts.map +1 -1
- package/dist/components/auth/AuthLayout.js +95 -38
- package/dist/components/auth/AuthLayout.js.map +1 -1
- package/dist/components/auth/AuthLayout.tsx +50 -39
- package/dist/components/auth/AuthSettingsContext.d.ts +10 -0
- package/dist/components/auth/AuthSettingsContext.d.ts.map +1 -0
- package/dist/components/auth/AuthSettingsContext.js +49 -0
- package/dist/components/auth/AuthSettingsContext.js.map +1 -0
- package/dist/components/auth/AuthSettingsContext.tsx +19 -0
- package/dist/components/auth/AuthTabs.d.ts.map +1 -1
- package/dist/components/auth/AuthTabs.js +9 -9
- package/dist/components/auth/AuthTabs.js.map +1 -1
- package/dist/components/auth/AuthTabs.tsx +14 -15
- package/dist/components/auth/FacebookAuthChecking.d.ts +2 -0
- package/dist/components/auth/FacebookAuthChecking.d.ts.map +1 -0
- package/dist/components/auth/FacebookAuthChecking.js +103 -0
- package/dist/components/auth/FacebookAuthChecking.js.map +1 -0
- package/dist/components/auth/FacebookAuthChecking.tsx +64 -0
- package/dist/components/auth/ForgotPasswordThankYou.d.ts.map +1 -1
- package/dist/components/auth/ForgotPasswordThankYou.js +2 -6
- package/dist/components/auth/ForgotPasswordThankYou.js.map +1 -1
- package/dist/components/auth/ForgotPasswordThankYou.tsx +2 -7
- package/dist/components/auth/GoogleAuthChecking.js +0 -1
- package/dist/components/auth/GoogleAuthChecking.js.map +1 -1
- package/dist/components/auth/GoogleAuthChecking.tsx +1 -1
- package/dist/components/auth/MicrosoftAuthChecking.d.ts +2 -0
- package/dist/components/auth/MicrosoftAuthChecking.d.ts.map +1 -0
- package/dist/components/auth/MicrosoftAuthChecking.js +103 -0
- package/dist/components/auth/MicrosoftAuthChecking.js.map +1 -0
- package/dist/components/auth/MicrosoftAuthChecking.tsx +64 -0
- package/dist/components/auth/SolidForgotPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidForgotPassword.js +3 -7
- package/dist/components/auth/SolidForgotPassword.js.map +1 -1
- package/dist/components/auth/SolidForgotPassword.tsx +3 -7
- package/dist/components/auth/SolidInitialLoginOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.js +4 -8
- package/dist/components/auth/SolidInitialLoginOtp.js.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.tsx +3 -6
- package/dist/components/auth/SolidInitiateRegisterOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.js +27 -14
- package/dist/components/auth/SolidInitiateRegisterOtp.js.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.tsx +27 -15
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +11 -11
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidLogin.tsx +20 -9
- package/dist/components/auth/SolidRegister.d.ts.map +1 -1
- package/dist/components/auth/SolidRegister.js +53 -25
- package/dist/components/auth/SolidRegister.js.map +1 -1
- package/dist/components/auth/SolidRegister.tsx +107 -40
- package/dist/components/auth/SolidResetPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidResetPassword.js +2 -6
- package/dist/components/auth/SolidResetPassword.js.map +1 -1
- package/dist/components/auth/SolidResetPassword.tsx +2 -6
- package/dist/components/common/GeneralSettings.d.ts.map +1 -1
- package/dist/components/common/GeneralSettings.js +235 -156
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/common/GeneralSettings.tsx +1109 -795
- package/dist/components/common/SettingsComponent.d.ts +2 -0
- package/dist/components/common/SettingsComponent.d.ts.map +1 -0
- package/dist/components/common/SettingsComponent.js +351 -0
- package/dist/components/common/SettingsComponent.js.map +1 -0
- package/dist/components/common/SettingsComponent.module.css +421 -0
- package/dist/components/common/SettingsComponent.tsx +582 -0
- package/dist/components/common/SocialMediaLogin.d.ts +8 -1
- package/dist/components/common/SocialMediaLogin.d.ts.map +1 -1
- package/dist/components/common/SocialMediaLogin.js +6 -13
- package/dist/components/common/SocialMediaLogin.js.map +1 -1
- package/dist/components/common/SocialMediaLogin.tsx +120 -58
- package/dist/components/common/SolidAdmin.js +1 -1
- package/dist/components/common/SolidAdmin.js.map +1 -1
- package/dist/components/common/SolidAdmin.tsx +1 -1
- package/dist/components/common/SolidExport.d.ts.map +1 -1
- package/dist/components/common/SolidExport.js +1 -1
- package/dist/components/common/SolidExport.js.map +1 -1
- package/dist/components/common/SolidExport.tsx +2 -1
- package/dist/components/common/SolidFormStepper.d.ts.map +1 -1
- package/dist/components/common/SolidFormStepper.js +2 -1
- package/dist/components/common/SolidFormStepper.js.map +1 -1
- package/dist/components/common/SolidFormStepper.tsx +2 -1
- package/dist/components/common/SolidThemeProvider.d.ts.map +1 -1
- package/dist/components/common/SolidThemeProvider.js +5 -21
- package/dist/components/common/SolidThemeProvider.js.map +1 -1
- package/dist/components/common/SolidThemeProvider.tsx +6 -24
- package/dist/components/common/solid-export.css +26 -0
- package/dist/components/common/solidModuleHome.module.css +1 -2
- package/dist/components/core/card/SolidCardView.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardView.js +24 -25
- package/dist/components/core/card/SolidCardView.js.map +1 -1
- package/dist/components/core/card/SolidCardView.tsx +23 -28
- package/dist/components/core/card/SolidCardViewConfigure.js +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.js.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.tsx +1 -1
- package/dist/components/core/chatter/SolidChatter.d.ts.map +1 -1
- package/dist/components/core/chatter/SolidChatter.js +39 -9
- package/dist/components/core/chatter/SolidChatter.js.map +1 -1
- package/dist/components/core/chatter/SolidChatter.tsx +42 -7
- package/dist/components/core/chatter/SolidChatterAuditMessage.d.ts.map +1 -1
- package/dist/components/core/chatter/SolidChatterAuditMessage.js +19 -1
- package/dist/components/core/chatter/SolidChatterAuditMessage.js.map +1 -1
- package/dist/components/core/chatter/SolidChatterAuditMessage.tsx +22 -1
- package/dist/components/core/chatter/SolidChatterMessageBox.d.ts +3 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.d.ts.map +1 -1
- package/dist/components/core/chatter/SolidChatterMessageBox.js +68 -4
- package/dist/components/core/chatter/SolidChatterMessageBox.js.map +1 -1
- package/dist/components/core/chatter/SolidChatterMessageBox.tsx +45 -3
- package/dist/components/core/chatter/chatter.module.css +3 -6
- package/dist/components/core/common/PDFViewer.js +1 -1
- package/dist/components/core/common/PDFViewer.js.map +1 -1
- package/dist/components/core/common/PDFViewer.tsx +2 -2
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.d.ts.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.js +3 -1
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.js.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.module.css +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.tsx +3 -1
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.d.ts.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.js +9 -8
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.js.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.tsx +4 -2
- package/dist/components/core/common/SolidGenericImport/SolidImport.module.css +3 -4
- package/dist/components/core/common/dndCompat.d.ts +8 -0
- package/dist/components/core/common/dndCompat.d.ts.map +1 -0
- package/dist/components/core/common/dndCompat.js +5 -0
- package/dist/components/core/common/dndCompat.js.map +1 -0
- package/dist/components/core/common/dndCompat.ts +9 -0
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.js +2 -2
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.js.map +1 -1
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.tsx +2 -2
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.js +2 -2
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.js.map +1 -1
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.tsx +2 -2
- package/dist/components/core/extension/solid-core/chatterMessage/form/SolidChatterMessageCoModelEntityIdFormViewWidget.js +1 -1
- package/dist/components/core/extension/solid-core/chatterMessage/form/SolidChatterMessageCoModelEntityIdFormViewWidget.js.map +1 -1
- package/dist/components/core/extension/solid-core/chatterMessage/form/SolidChatterMessageCoModelEntityIdFormViewWidget.tsx +1 -1
- package/dist/components/core/extension/solid-core/chatterMessage/list/SolidChatterMessageCoModelEntityIdListViewWidget.js +1 -1
- package/dist/components/core/extension/solid-core/chatterMessage/list/SolidChatterMessageCoModelEntityIdListViewWidget.js.map +1 -1
- package/dist/components/core/extension/solid-core/chatterMessage/list/SolidChatterMessageCoModelEntityIdListViewWidget.tsx +1 -1
- package/dist/components/core/extension/solid-core/mqMessage/list/SolidMqMessagesSummarizeListHeaderAction.js +1 -1
- package/dist/components/core/extension/solid-core/mqMessage/list/SolidMqMessagesSummarizeListHeaderAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/mqMessage/list/SolidMqMessagesSummarizeListHeaderAction.tsx +1 -1
- package/dist/components/core/extension/solid-core/mqMessage/ui/MqMessageStageBadge.js +1 -1
- package/dist/components/core/extension/solid-core/mqMessage/ui/MqMessageStageBadge.js.map +1 -1
- package/dist/components/core/extension/solid-core/mqMessage/ui/MqMessageStageBadge.tsx +1 -1
- package/dist/components/core/extension/solid-core/scheduled-job/scheduleFrequencyOnFieldChangeHandler.d.ts +7 -0
- package/dist/components/core/extension/solid-core/scheduled-job/scheduleFrequencyOnFieldChangeHandler.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/scheduled-job/scheduleFrequencyOnFieldChangeHandler.js +75 -0
- package/dist/components/core/extension/solid-core/scheduled-job/scheduleFrequencyOnFieldChangeHandler.js.map +1 -0
- package/dist/components/core/extension/solid-core/scheduled-job/scheduleFrequencyOnFieldChangeHandler.ts +45 -0
- package/dist/components/core/extension/solid-core/settings/solidXGenAiCodeBuilderConfigWidget.d.ts +3 -0
- package/dist/components/core/extension/solid-core/settings/solidXGenAiCodeBuilderConfigWidget.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/settings/solidXGenAiCodeBuilderConfigWidget.js +81 -0
- package/dist/components/core/extension/solid-core/settings/solidXGenAiCodeBuilderConfigWidget.js.map +1 -0
- package/dist/components/core/extension/solid-core/settings/solidXGenAiCodeBuilderConfigWidget.tsx +114 -0
- package/dist/components/core/form/SolidFormActionHeader.d.ts +1 -1
- package/dist/components/core/form/SolidFormActionHeader.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.js +5 -3
- package/dist/components/core/form/SolidFormActionHeader.js.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.tsx +27 -1
- package/dist/components/core/form/SolidFormLayouts.js +1 -1
- package/dist/components/core/form/SolidFormLayouts.js.map +1 -1
- package/dist/components/core/form/SolidFormLayouts.tsx +1 -1
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +141 -50
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +123 -25
- package/dist/components/core/form/fields/SolidComputedField.d.ts +25 -0
- package/dist/components/core/form/fields/SolidComputedField.d.ts.map +1 -0
- package/dist/components/core/form/fields/SolidComputedField.js +128 -0
- package/dist/components/core/form/fields/SolidComputedField.js.map +1 -0
- package/dist/components/core/form/fields/SolidComputedField.tsx +134 -0
- package/dist/components/core/form/fields/SolidDateTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.js +8 -2
- package/dist/components/core/form/fields/SolidDateTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.tsx +8 -2
- package/dist/components/core/form/fields/SolidEmailField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidEmailField.js +5 -4
- package/dist/components/core/form/fields/SolidEmailField.js.map +1 -1
- package/dist/components/core/form/fields/SolidEmailField.tsx +17 -15
- package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.js +5 -4
- package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.tsx +3 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js +35 -24
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.tsx +30 -14
- package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.js +29 -28
- package/dist/components/core/form/fields/SolidSelectionStaticField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.tsx +17 -12
- package/dist/components/core/form/fields/SolidShortTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidShortTextField.js +8 -6
- package/dist/components/core/form/fields/SolidShortTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidShortTextField.tsx +7 -1
- package/dist/components/core/form/fields/SolidTimeField.js +1 -1
- package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.tsx +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.js +3 -3
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.js.map +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.tsx +0 -5
- package/dist/components/core/form/fields/solidFields.module.css +0 -3
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.d.ts +1 -1
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.js +1 -1
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.js.map +1 -1
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.tsx +1 -1
- package/dist/components/core/kanban/KanbanBoard.js +1 -1
- package/dist/components/core/kanban/KanbanBoard.js.map +1 -1
- package/dist/components/core/kanban/KanbanBoard.tsx +1 -1
- package/dist/components/core/kanban/KanbanCard.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanCard.js +2 -2
- package/dist/components/core/kanban/KanbanCard.js.map +1 -1
- package/dist/components/core/kanban/KanbanCard.tsx +4 -3
- package/dist/components/core/kanban/KanbanColumn.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanColumn.js +3 -3
- package/dist/components/core/kanban/KanbanColumn.js.map +1 -1
- package/dist/components/core/kanban/KanbanColumn.tsx +5 -4
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +220 -109
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +219 -96
- package/dist/components/core/kanban/SolidKanbanViewConfigure.js +1 -1
- package/dist/components/core/kanban/SolidKanbanViewConfigure.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanViewConfigure.tsx +1 -1
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.d.ts.map +1 -1
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.js +4 -3
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.js.map +1 -1
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.tsx +13 -12
- package/dist/components/core/list/SolidDataTable.d.ts.map +1 -1
- package/dist/components/core/list/SolidDataTable.js +6 -5
- package/dist/components/core/list/SolidDataTable.js.map +1 -1
- package/dist/components/core/list/SolidDataTable.tsx +6 -5
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.d.ts.map +1 -1
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.js +3 -3
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.js.map +1 -1
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.tsx +7 -4
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +64 -74
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +72 -97
- package/dist/components/core/list/SolidListViewConfigure.js +1 -1
- package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.tsx +1 -1
- package/dist/components/core/list/SolidListViewRowActionsMenu.js +2 -2
- package/dist/components/core/list/SolidListViewRowActionsMenu.js.map +1 -1
- package/dist/components/core/list/SolidListViewRowActionsMenu.tsx +2 -2
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +1 -1
- package/dist/components/core/solid-ai/SolidAiChat.module.css +3 -3
- package/dist/components/core/tree/SolidTreeView.js +1 -1
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +1 -1
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.css +283 -9
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.d.ts.map +1 -1
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.js +35 -28
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.js.map +1 -1
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.tsx +64 -62
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.d.ts +2 -1
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.d.ts.map +1 -1
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.js +4 -4
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.js.map +1 -1
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.tsx +17 -10
- package/dist/components/core/users/ApiKeysTab/RevealApiKeyModal.d.ts.map +1 -1
- package/dist/components/core/users/ApiKeysTab/RevealApiKeyModal.js +2 -19
- package/dist/components/core/users/ApiKeysTab/RevealApiKeyModal.js.map +1 -1
- package/dist/components/core/users/ApiKeysTab/RevealApiKeyModal.tsx +24 -43
- package/dist/components/core/users/CreateUser.css +114 -0
- package/dist/components/core/users/CreateUser.d.ts +1 -0
- package/dist/components/core/users/CreateUser.d.ts.map +1 -1
- package/dist/components/core/users/CreateUser.js +4 -3
- package/dist/components/core/users/CreateUser.js.map +1 -1
- package/dist/components/core/users/CreateUser.tsx +32 -26
- package/dist/components/layout/AdminTopHeader.d.ts.map +1 -1
- package/dist/components/layout/AdminTopHeader.js +25 -1
- package/dist/components/layout/AdminTopHeader.js.map +1 -1
- package/dist/components/layout/AdminTopHeader.tsx +38 -1
- package/dist/components/layout/context/layoutcontext.js +2 -2
- package/dist/components/layout/context/layoutcontext.js.map +1 -1
- package/dist/components/layout/context/layoutcontext.tsx +2 -2
- package/dist/components/layout/user-profile-menu.d.ts.map +1 -1
- package/dist/components/layout/user-profile-menu.js +15 -14
- package/dist/components/layout/user-profile-menu.js.map +1 -1
- package/dist/components/layout/user-profile-menu.tsx +8 -6
- package/dist/components/shad-cn-ui/SolidAutocomplete.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidAutocomplete.js +9 -1
- package/dist/components/shad-cn-ui/SolidAutocomplete.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidAutocomplete.tsx +10 -1
- package/dist/components/shad-cn-ui/SolidConfirmDialog.d.ts +6 -1
- package/dist/components/shad-cn-ui/SolidConfirmDialog.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidConfirmDialog.js +3 -3
- package/dist/components/shad-cn-ui/SolidConfirmDialog.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidConfirmDialog.tsx +15 -3
- package/dist/components/shad-cn-ui/SolidDatePicker.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidDatePicker.js +12 -2
- package/dist/components/shad-cn-ui/SolidDatePicker.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidDatePicker.tsx +13 -2
- package/dist/components/shad-cn-ui/SolidDialog.d.ts +1 -1
- package/dist/components/shad-cn-ui/SolidDialog.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidDialog.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidDialog.tsx +1 -1
- package/dist/components/shad-cn-ui/SolidIcon.d.ts +2 -2
- package/dist/components/shad-cn-ui/SolidIcon.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidIcon.js +3 -4
- package/dist/components/shad-cn-ui/SolidIcon.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidIcon.tsx +12 -15
- package/dist/components/shad-cn-ui/SolidRichTextEditor.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidRichTextEditor.js +9 -1
- package/dist/components/shad-cn-ui/SolidRichTextEditor.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidRichTextEditor.tsx +8 -1
- package/dist/components/shad-cn-ui/SolidTabs.d.ts +2 -1
- package/dist/components/shad-cn-ui/SolidTabs.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidTabs.js +6 -3
- package/dist/components/shad-cn-ui/SolidTabs.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidTabs.tsx +63 -26
- package/dist/helpers/hydrateRelationRules.js +1 -1
- package/dist/helpers/hydrateRelationRules.js.map +1 -1
- package/dist/helpers/hydrateRelationRules.ts +1 -1
- package/dist/helpers/permissions.js +2 -2
- package/dist/helpers/permissions.js.map +1 -1
- package/dist/helpers/permissions.ts +2 -2
- package/dist/helpers/registry.d.ts +2 -2
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +6 -0
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +9 -2
- package/dist/helpers/settingsPayload.d.ts +32 -0
- package/dist/helpers/settingsPayload.d.ts.map +1 -0
- package/dist/helpers/settingsPayload.js +72 -0
- package/dist/helpers/settingsPayload.js.map +1 -0
- package/dist/helpers/settingsPayload.ts +125 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +4 -0
- package/dist/redux/api/solidChatterMessageApi.d.ts +2 -1
- package/dist/redux/api/solidChatterMessageApi.d.ts.map +1 -1
- package/dist/redux/api/solidChatterMessageApi.js +11 -1
- package/dist/redux/api/solidChatterMessageApi.js.map +1 -1
- package/dist/redux/api/solidChatterMessageApi.ts +10 -1
- package/dist/redux/api/solidEntityApi.js +1 -1
- package/dist/redux/api/solidEntityApi.js.map +1 -1
- package/dist/redux/api/solidEntityApi.tsx +1 -1
- package/dist/redux/store/defaultStoreConfig.d.ts +1 -0
- package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
- package/dist/resources/globals.css +114 -90
- package/dist/resources/images/Background.svg +3 -5
- package/dist/resources/images/Navigation/SolidSettinsIcon.svg +3 -5
- package/dist/resources/images/errors/error.svg +12 -14
- package/dist/resources/shadcn-base.css +356 -429
- package/dist/resources/solid-responsive.css +22 -4
- package/dist/resources/themes/solid-dark-purple/theme.css +23 -33
- package/dist/resources/themes/solid-light-purple/theme.css +31 -31
- package/dist/routes/AppEventListener.js +1 -1
- package/dist/routes/AppEventListener.js.map +1 -1
- package/dist/routes/AppEventListener.tsx +1 -1
- package/dist/routes/SolidLayoutRegistry.d.ts.map +1 -1
- package/dist/routes/SolidLayoutRegistry.js +3 -1
- package/dist/routes/SolidLayoutRegistry.js.map +1 -1
- package/dist/routes/SolidLayoutRegistry.tsx +3 -1
- package/dist/routes/guards/AuthGuard.d.ts.map +1 -1
- package/dist/routes/guards/AuthGuard.js +4 -1
- package/dist/routes/guards/AuthGuard.js.map +1 -1
- package/dist/routes/guards/AuthGuard.tsx +6 -1
- package/dist/routes/pages/admin/core/CardPage.js +1 -1
- package/dist/routes/pages/admin/core/CardPage.js.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.tsx +1 -1
- package/dist/routes/pages/admin/core/FormPage.js +1 -1
- package/dist/routes/pages/admin/core/FormPage.js.map +1 -1
- package/dist/routes/pages/admin/core/FormPage.tsx +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.js +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.js.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.tsx +1 -1
- package/dist/routes/pages/admin/core/ListPage.js +1 -1
- package/dist/routes/pages/admin/core/ListPage.js.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.tsx +1 -1
- package/dist/routes/pages/admin/core/SettingsPage.js +2 -2
- package/dist/routes/pages/admin/core/SettingsPage.js.map +1 -1
- package/dist/routes/pages/admin/core/SettingsPage.tsx +2 -2
- package/dist/routes/pages/admin/core/TreePage.js +1 -1
- package/dist/routes/pages/admin/core/TreePage.js.map +1 -1
- package/dist/routes/pages/admin/core/TreePage.tsx +1 -1
- package/dist/routes/pages/auth/InitiateFacebookOauthPage.d.ts +2 -0
- package/dist/routes/pages/auth/InitiateFacebookOauthPage.d.ts.map +1 -0
- package/dist/routes/pages/auth/InitiateFacebookOauthPage.js +6 -0
- package/dist/routes/pages/auth/InitiateFacebookOauthPage.js.map +1 -0
- package/dist/routes/pages/auth/InitiateFacebookOauthPage.tsx +5 -0
- package/dist/routes/pages/auth/InitiateMicrosoftOauthPage.d.ts +2 -0
- package/dist/routes/pages/auth/InitiateMicrosoftOauthPage.d.ts.map +1 -0
- package/dist/routes/pages/auth/InitiateMicrosoftOauthPage.js +6 -0
- package/dist/routes/pages/auth/InitiateMicrosoftOauthPage.js.map +1 -0
- package/dist/routes/pages/auth/InitiateMicrosoftOauthPage.tsx +5 -0
- package/dist/routes/solidRoutes.d.ts.map +1 -1
- package/dist/routes/solidRoutes.js +5 -1
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +5 -1
- package/dist/routes/types.d.ts +1 -1
- package/dist/routes/types.d.ts.map +1 -1
- package/dist/routes/types.js.map +1 -1
- package/dist/routes/types.ts +2 -0
- package/dist/types/extension-registry.d.ts +1 -0
- package/dist/types/extension-registry.d.ts.map +1 -1
- package/dist/types/extension-registry.js +1 -0
- package/dist/types/extension-registry.js.map +1 -1
- package/dist/types/extension-registry.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/solid-core.d.ts +11 -0
- package/package.json +1 -2
|
@@ -28,6 +28,7 @@ import { SolidSelectionDynamicField } from "./fields/SolidSelectionDynamicField"
|
|
|
28
28
|
import { SolidSelectionStaticField } from "./fields/SolidSelectionStaticField";
|
|
29
29
|
import { SolidShortTextField } from "./fields/SolidShortTextField";
|
|
30
30
|
import { SolidTimeField } from "./fields/SolidTimeField";
|
|
31
|
+
import { SolidComputedField } from "./fields/SolidComputedField";
|
|
31
32
|
import { SolidUiEvent } from "../../../types";
|
|
32
33
|
import { getExtensionComponent, getExtensionFunction } from "../../../helpers/registry";
|
|
33
34
|
import { SolidFormWidgetProps, SolidUiEventResponse } from "../../../types/solid-core";
|
|
@@ -41,6 +42,7 @@ import { hasAnyRole } from "../../../helpers/rolesHelper";
|
|
|
41
42
|
import SolidChatterLocaleTabView from "../locales/SolidChatterLocaleTabView";
|
|
42
43
|
import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
43
44
|
import { useLazyGetMcpUrlQuery, useLazyGetSolidSettingsQuery } from "../../../redux/api/solidSettingsApi";
|
|
45
|
+
import { getSettingsMap } from "../../../helpers/settingsPayload";
|
|
44
46
|
import { SolidFormFooter } from "./SolidFormFooter";
|
|
45
47
|
import { normalizeSolidFormActionPath } from "../../../helpers/routePaths";
|
|
46
48
|
import { showToast } from "../../../redux/features/toastSlice";
|
|
@@ -171,6 +173,9 @@ const fieldFactory = (type: string, fieldContext: SolidFieldProps, setLightboxUr
|
|
|
171
173
|
if (type === 'email') {
|
|
172
174
|
return new SolidEmailField(fieldContext);
|
|
173
175
|
}
|
|
176
|
+
if (type === 'computed') {
|
|
177
|
+
return new SolidComputedField(fieldContext);
|
|
178
|
+
}
|
|
174
179
|
return null;
|
|
175
180
|
}
|
|
176
181
|
|
|
@@ -276,7 +281,7 @@ const SolidSheet = ({ children }: any) => (
|
|
|
276
281
|
// Internal tab data carrier — SolidNotebook reads props from this
|
|
277
282
|
const SolidPageTab = ({ children }: any) => <>{children}</>;
|
|
278
283
|
|
|
279
|
-
const SolidNotebook = ({ children, activeTab, embeded }: any) => {
|
|
284
|
+
const SolidNotebook = ({ children, activeTab, embeded, requestedTab, requestedTabVersion }: any) => {
|
|
280
285
|
const childrenArray = React.Children.toArray(children).filter(child => !!child) as any[];
|
|
281
286
|
|
|
282
287
|
const router = useRouter();
|
|
@@ -286,6 +291,19 @@ const SolidNotebook = ({ children, activeTab, embeded }: any) => {
|
|
|
286
291
|
|
|
287
292
|
const effectiveTab = embeded ? localActiveTab : activeTab;
|
|
288
293
|
|
|
294
|
+
useEffect(() => {
|
|
295
|
+
if (!requestedTab) return;
|
|
296
|
+
const exists = childrenArray.some((child: any) => child.props?.tabKey === requestedTab);
|
|
297
|
+
if (!exists) return;
|
|
298
|
+
if (embeded) {
|
|
299
|
+
setLocalActiveTab(requestedTab);
|
|
300
|
+
} else {
|
|
301
|
+
const queryParams = new URLSearchParams(searchParams.toString());
|
|
302
|
+
queryParams.set('activeTab', requestedTab);
|
|
303
|
+
router.push(`${pathname}?${queryParams.toString()}`);
|
|
304
|
+
}
|
|
305
|
+
}, [requestedTabVersion]);
|
|
306
|
+
|
|
289
307
|
const activeIndex = useMemo(() => {
|
|
290
308
|
const idx = childrenArray.findIndex((child: any) => child.props?.tabKey === effectiveTab);
|
|
291
309
|
return idx >= 0 ? idx : 0;
|
|
@@ -350,6 +368,29 @@ const SolidDynamicWidget = ({ widgetName, formik, field, solidFormViewMetaData,
|
|
|
350
368
|
};
|
|
351
369
|
|
|
352
370
|
|
|
371
|
+
const FormikSubmitWatcher = ({ formik, tabFieldsRef, embeded, searchParams, setRequestedTab, setRequestedTabVersion }: any) => {
|
|
372
|
+
const lastHandledRef = useRef(0);
|
|
373
|
+
useEffect(() => {
|
|
374
|
+
if (formik.submitCount === lastHandledRef.current) return;
|
|
375
|
+
if (formik.isSubmitting) return;
|
|
376
|
+
lastHandledRef.current = formik.submitCount;
|
|
377
|
+
const erroredKeys = Object.keys(formik.errors || {});
|
|
378
|
+
if (erroredKeys.length === 0) return;
|
|
379
|
+
if (!tabFieldsRef.current || tabFieldsRef.current.length === 0) return;
|
|
380
|
+
const currentActive = embeded ? null : (searchParams.get("activeTab") || "");
|
|
381
|
+
const currentHasError = currentActive
|
|
382
|
+
? tabFieldsRef.current.find((t: any) => t.tabKey === currentActive)?.fields.some((f: string) => erroredKeys.includes(f))
|
|
383
|
+
: false;
|
|
384
|
+
if (currentHasError) return;
|
|
385
|
+
const firstErroredTab = tabFieldsRef.current.find((t: any) => t.fields.some((f: string) => erroredKeys.includes(f)));
|
|
386
|
+
if (firstErroredTab) {
|
|
387
|
+
setRequestedTab(firstErroredTab.tabKey);
|
|
388
|
+
setRequestedTabVersion((v: number) => v + 1);
|
|
389
|
+
}
|
|
390
|
+
}, [formik.submitCount, formik.isSubmitting]);
|
|
391
|
+
return null;
|
|
392
|
+
};
|
|
393
|
+
|
|
353
394
|
const SolidPage = ({ attrs, children, key, formik, fields }: any) => {
|
|
354
395
|
const fieldsName = fields.map((f: any) => f.attrs.name);
|
|
355
396
|
const errorCount = formik.submitCount > 0 ? fieldsName.filter((name: any) => !!formik.errors[name]).length : 0;
|
|
@@ -433,6 +474,12 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
433
474
|
const [chatterLocaleWidth, setChatterLocaleWidth] = useState(360);
|
|
434
475
|
const [isResizingChatterLocale, setIsResizingChatterLocale] = useState(false);
|
|
435
476
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
477
|
+
const [isMobileViewport, setIsMobileViewport] = useState(false);
|
|
478
|
+
const solidFormWrapperRef = useRef<HTMLDivElement | null>(null);
|
|
479
|
+
|
|
480
|
+
const tabFieldsRef = useRef<Array<{ tabKey: string; fields: string[] }>>([]);
|
|
481
|
+
const [requestedTab, setRequestedTab] = useState<string | null>(null);
|
|
482
|
+
const [requestedTabVersion, setRequestedTabVersion] = useState(0);
|
|
436
483
|
|
|
437
484
|
const [solidWorkflowFieldValue, setSolidWorkflowFieldValue] = useState<string>("");
|
|
438
485
|
const [defaultTabViewOptionIndex, setDefaultTabViewOptionIndex] = useState<number>(1);
|
|
@@ -450,15 +497,16 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
450
497
|
const actionContext = searchParams.get('actionContext');
|
|
451
498
|
|
|
452
499
|
const [trigger, { data: solidSettingsData }] = useLazyGetSolidSettingsQuery();
|
|
500
|
+
const solidSettingsMap = useMemo(() => getSettingsMap(solidSettingsData), [solidSettingsData]);
|
|
453
501
|
useEffect(() => {
|
|
454
502
|
trigger("") // Fetch settings on mount
|
|
455
503
|
}, [])
|
|
456
504
|
|
|
457
505
|
useEffect(() => {
|
|
458
|
-
if (
|
|
506
|
+
if (solidSettingsMap?.mcpEnabled && solidSettingsMap?.mcpServerUrl) {
|
|
459
507
|
enableSolidXAiPanel();
|
|
460
508
|
}
|
|
461
|
-
}, [
|
|
509
|
+
}, [solidSettingsMap]);
|
|
462
510
|
|
|
463
511
|
|
|
464
512
|
const enableSolidXAiPanel = async () => {
|
|
@@ -479,19 +527,34 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
479
527
|
}
|
|
480
528
|
|
|
481
529
|
const op = useRef(null);
|
|
530
|
+
const MIN_CHATTER_WIDTH = 320;
|
|
531
|
+
const MIN_FORM_SECTION_WIDTH = 420;
|
|
532
|
+
|
|
533
|
+
const getMaxChatterWidth = () => {
|
|
534
|
+
const wrapperWidth = solidFormWrapperRef.current?.getBoundingClientRect().width ?? window.innerWidth;
|
|
535
|
+
return Math.max(MIN_CHATTER_WIDTH, wrapperWidth - MIN_FORM_SECTION_WIDTH);
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
const clampChatterWidth = (width: number) => {
|
|
539
|
+
const maxWidth = getMaxChatterWidth();
|
|
540
|
+
return Math.max(MIN_CHATTER_WIDTH, Math.min(width, maxWidth));
|
|
541
|
+
};
|
|
542
|
+
|
|
482
543
|
useEffect(() => {
|
|
483
544
|
const stored = localStorage.getItem('chatter_locale_width');
|
|
484
545
|
if (stored) {
|
|
485
546
|
const parsed = parseInt(stored, 10);
|
|
486
|
-
const clampedWidth =
|
|
547
|
+
const clampedWidth = clampChatterWidth(parsed);
|
|
487
548
|
setChatterLocaleWidth(clampedWidth);
|
|
488
549
|
}
|
|
489
550
|
}, []);
|
|
490
551
|
useEffect(() => {
|
|
491
552
|
const handleMouseMove = (e: MouseEvent) => {
|
|
492
553
|
if (!isResizingChatterLocale) return;
|
|
493
|
-
const
|
|
494
|
-
const
|
|
554
|
+
const wrapperRect = solidFormWrapperRef.current?.getBoundingClientRect();
|
|
555
|
+
const rightEdge = wrapperRect?.right ?? window.innerWidth;
|
|
556
|
+
const newWidth = rightEdge - e.clientX;
|
|
557
|
+
const clampedWidth = clampChatterWidth(newWidth);
|
|
495
558
|
setChatterLocaleWidth(clampedWidth);
|
|
496
559
|
localStorage.setItem('chatter_locale_width', clampedWidth.toString());
|
|
497
560
|
};
|
|
@@ -511,6 +574,28 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
511
574
|
};
|
|
512
575
|
}, [isResizingChatterLocale]);
|
|
513
576
|
|
|
577
|
+
useEffect(() => {
|
|
578
|
+
const updateViewportFlag = () => setIsMobileViewport(window.innerWidth <= 1199);
|
|
579
|
+
updateViewportFlag();
|
|
580
|
+
window.addEventListener('resize', updateViewportFlag);
|
|
581
|
+
return () => window.removeEventListener('resize', updateViewportFlag);
|
|
582
|
+
}, []);
|
|
583
|
+
|
|
584
|
+
useEffect(() => {
|
|
585
|
+
const handleWindowResize = () => {
|
|
586
|
+
setChatterLocaleWidth((currentWidth) => {
|
|
587
|
+
const clamped = clampChatterWidth(currentWidth);
|
|
588
|
+
if (clamped !== currentWidth) {
|
|
589
|
+
localStorage.setItem('chatter_locale_width', clamped.toString());
|
|
590
|
+
}
|
|
591
|
+
return clamped;
|
|
592
|
+
});
|
|
593
|
+
};
|
|
594
|
+
|
|
595
|
+
window.addEventListener('resize', handleWindowResize);
|
|
596
|
+
return () => window.removeEventListener('resize', handleWindowResize);
|
|
597
|
+
}, []);
|
|
598
|
+
|
|
514
599
|
|
|
515
600
|
useEffect(() => {
|
|
516
601
|
const mode = searchParams.get('viewMode');
|
|
@@ -628,6 +713,8 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
628
713
|
data: solidFormViewMetaData,
|
|
629
714
|
isLoading: solidFormViewMetaDataIsLoading
|
|
630
715
|
} = useGetSolidViewLayoutQuery(formViewMetaDataQs);
|
|
716
|
+
const entityDisplayName =
|
|
717
|
+
solidFormViewMetaData?.data?.solidView?.model?.displayName || params.modelName;
|
|
631
718
|
const [refreshChatterMessage, setRefreshChatterMessage] = useState<boolean>(true);
|
|
632
719
|
useEffect(() => {
|
|
633
720
|
if (
|
|
@@ -1200,7 +1287,7 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
1200
1287
|
});
|
|
1201
1288
|
|
|
1202
1289
|
return (
|
|
1203
|
-
<div className="solid-form-wrapper">
|
|
1290
|
+
<div className="solid-form-wrapper" ref={solidFormWrapperRef}>
|
|
1204
1291
|
<div className="solid-form-section">
|
|
1205
1292
|
<div className="page-header solid-list-toolbar flex-column lg:flex-row">
|
|
1206
1293
|
<div className="flex justify-content-between w-full solid-form-toolbar-row">
|
|
@@ -1264,6 +1351,7 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
1264
1351
|
});
|
|
1265
1352
|
|
|
1266
1353
|
const formFieldOnXXX = async (event: ChangeEvent<HTMLInputElement>, eventType: string) => {
|
|
1354
|
+
// console.log("formFieldOnXXX", eventType, event);
|
|
1267
1355
|
|
|
1268
1356
|
// Invoke the formik change
|
|
1269
1357
|
if (eventType === 'onFieldChange') {
|
|
@@ -1441,12 +1529,14 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
1441
1529
|
|
|
1442
1530
|
case "notebook":
|
|
1443
1531
|
if (visible === true) {
|
|
1444
|
-
|
|
1532
|
+
tabFieldsRef.current = [];
|
|
1533
|
+
return <SolidNotebook key={key} activeTab={searchParams.get("activeTab") || ""} embeded={params.embeded} requestedTab={requestedTab} requestedTabVersion={requestedTabVersion}>{children.map((element: any, index: number) => renderFormElementDynamically(element, recursiveFVMD, `${path}.${index}`))}</SolidNotebook>;
|
|
1445
1534
|
}
|
|
1446
1535
|
break;
|
|
1447
1536
|
case "page":
|
|
1448
1537
|
if (visible === true) {
|
|
1449
1538
|
const fields = children.flatMap((child: any) => getLayoutFields(child));
|
|
1539
|
+
tabFieldsRef.current.push({ tabKey: key, fields: fields.map((f: any) => f.attrs.name) });
|
|
1450
1540
|
const pageChildren = children.map((element: any, index: number) => renderFormElementDynamically(element, recursiveFVMD, `${path}.${index}`));
|
|
1451
1541
|
return SolidPage({ children: pageChildren, attrs: attrs, key: key, formik: formik, fields });
|
|
1452
1542
|
}
|
|
@@ -1634,9 +1724,17 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
1634
1724
|
|
|
1635
1725
|
|
|
1636
1726
|
return (
|
|
1637
|
-
<div className="solid-form-wrapper">
|
|
1727
|
+
<div className="solid-form-wrapper" ref={solidFormWrapperRef}>
|
|
1638
1728
|
<div className="solid-form-section">
|
|
1639
1729
|
<form style={{ width: '100%' }} onSubmit={formik.handleSubmit}>
|
|
1730
|
+
<FormikSubmitWatcher
|
|
1731
|
+
formik={formik}
|
|
1732
|
+
tabFieldsRef={tabFieldsRef}
|
|
1733
|
+
embeded={params.embeded}
|
|
1734
|
+
searchParams={searchParams}
|
|
1735
|
+
setRequestedTab={setRequestedTab}
|
|
1736
|
+
setRequestedTabVersion={setRequestedTabVersion}
|
|
1737
|
+
/>
|
|
1640
1738
|
<SolidFormActionHeader
|
|
1641
1739
|
formik={formik}
|
|
1642
1740
|
formData={solidFormViewData?.data}
|
|
@@ -1660,6 +1758,8 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
1660
1758
|
onStepperUpdate={() => setRefreshChatterMessage(true)}
|
|
1661
1759
|
isSubmitting={isSubmitting}
|
|
1662
1760
|
headerRequestStatusLabel={isSubmitting ? "Saving..." : null}
|
|
1761
|
+
showMobileOpenChatter={isMobileViewport && !isShowChatter && params.embeded !== true}
|
|
1762
|
+
onMobileOpenChatter={() => setShowChatter(true)}
|
|
1663
1763
|
/>
|
|
1664
1764
|
<div className={`px-4 py-3 md:p-4 solid-form-content md:pt-1 ${createMode ? 'solid-create-mode-form-content' : ''} ${params.embeded === true ? 'h-auto' : ''}`} style={{ maxHeight: params.embeded === true ? '80vh' : '', overflowY: 'auto' }}>
|
|
1665
1765
|
{DynamicHeaderComponent && <DynamicHeaderComponent />}
|
|
@@ -1741,23 +1841,21 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
1741
1841
|
</div>
|
|
1742
1842
|
}
|
|
1743
1843
|
|
|
1744
|
-
<
|
|
1844
|
+
<SolidConfirmDialog
|
|
1745
1845
|
open={isDeleteDialogVisible}
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
</
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
</div>
|
|
1760
|
-
</SolidDialog>
|
|
1846
|
+
onCancel={onDeleteClose}
|
|
1847
|
+
onConfirm={() => handleDeleteEntity()}
|
|
1848
|
+
className="solid-shadcn-confirm-dialog solid-delete-confirm-dialog"
|
|
1849
|
+
headerClassName="solid-shadcn-dialog-head"
|
|
1850
|
+
bodyClassName="solid-shadcn-dialog-body"
|
|
1851
|
+
footerClassName="solid-shadcn-dialog-actions"
|
|
1852
|
+
separatorClassName="solid-shadcn-dialog-sep"
|
|
1853
|
+
showSeparator
|
|
1854
|
+
title={`Delete ${entityDisplayName}`}
|
|
1855
|
+
message={<p className="solid-shadcn-dialog-text">{`Are you sure you want to delete this ${entityDisplayName}?`}</p>}
|
|
1856
|
+
confirmLabel="Delete"
|
|
1857
|
+
cancelLabel="Cancel"
|
|
1858
|
+
/>
|
|
1761
1859
|
<SolidDialog
|
|
1762
1860
|
open={isLayoutDialogVisible}
|
|
1763
1861
|
onOpenChange={setLayoutDialogVisible}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as Yup from 'yup';
|
|
2
|
+
import { FormikObject, ISolidField, SolidFieldProps } from "./ISolidField";
|
|
3
|
+
import { SolidFormFieldWidgetProps } from "../../../../types/solid-core";
|
|
4
|
+
/**
|
|
5
|
+
* SolidComputedField
|
|
6
|
+
*
|
|
7
|
+
* Computed fields are server-generated values (e.g. auto-calculated totals, slugs, codes).
|
|
8
|
+
* They are always read-only in the UI and are only shown when a record already exists
|
|
9
|
+
* (i.e., the form is in view or edit mode for an existing record, NOT during creation).
|
|
10
|
+
*/
|
|
11
|
+
export declare class SolidComputedField implements ISolidField {
|
|
12
|
+
private fieldContext;
|
|
13
|
+
constructor(fieldContext: SolidFieldProps);
|
|
14
|
+
updateFormData(_value: any, _formData: FormData): any;
|
|
15
|
+
initialValue(): any;
|
|
16
|
+
validationSchema(): Yup.Schema;
|
|
17
|
+
render(formik: FormikObject): import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
renderExtensionRenderMode(widget: string, formik: FormikObject): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Default widget for computed fields — renders as a read-only input in edit mode.
|
|
22
|
+
* Uses the same layout as the short-text view widget for consistency.
|
|
23
|
+
*/
|
|
24
|
+
export declare const DefaultComputedFormWidget: ({ formik, fieldContext }: SolidFormFieldWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=SolidComputedField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidComputedField.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/form/fields/SolidComputedField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAIzE;;;;;;GAMG;AACH,qBAAa,kBAAmB,YAAW,WAAW;IAElD,OAAO,CAAC,YAAY,CAAkB;gBAE1B,YAAY,EAAE,eAAe;IAIzC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,GAAG,GAAG;IAIrD,YAAY,IAAI,GAAG;IAMnB,gBAAgB,IAAI,GAAG,CAAC,MAAM;IAK9B,MAAM,CAAC,MAAM,EAAE,YAAY;IAoC3B,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;CAYjE;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,6BAA8B,yBAAyB,4CAwC5F,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as Yup from 'yup';
|
|
14
|
+
import styles from './solidFields.module.css';
|
|
15
|
+
import { getExtensionComponent } from "../../../../helpers/registry";
|
|
16
|
+
import { SolidFieldTooltip } from "../../../../components/common/SolidFieldTooltip";
|
|
17
|
+
import { SolidInput } from "../../../shad-cn-ui";
|
|
18
|
+
/**
|
|
19
|
+
* SolidComputedField
|
|
20
|
+
*
|
|
21
|
+
* Computed fields are server-generated values (e.g. auto-calculated totals, slugs, codes).
|
|
22
|
+
* They are always read-only in the UI and are only shown when a record already exists
|
|
23
|
+
* (i.e., the form is in view or edit mode for an existing record, NOT during creation).
|
|
24
|
+
*/
|
|
25
|
+
var SolidComputedField = /** @class */ (function () {
|
|
26
|
+
function SolidComputedField(fieldContext) {
|
|
27
|
+
Object.defineProperty(this, "fieldContext", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: void 0
|
|
32
|
+
});
|
|
33
|
+
this.fieldContext = fieldContext;
|
|
34
|
+
}
|
|
35
|
+
Object.defineProperty(SolidComputedField.prototype, "updateFormData", {
|
|
36
|
+
enumerable: false,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value: function (_value, _formData) {
|
|
40
|
+
// Computed fields are never submitted — the server calculates them.
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(SolidComputedField.prototype, "initialValue", {
|
|
44
|
+
enumerable: false,
|
|
45
|
+
configurable: true,
|
|
46
|
+
writable: true,
|
|
47
|
+
value: function () {
|
|
48
|
+
var _a;
|
|
49
|
+
var fieldName = this.fieldContext.field.attrs.name;
|
|
50
|
+
var existingValue = (_a = this.fieldContext.data) === null || _a === void 0 ? void 0 : _a[fieldName];
|
|
51
|
+
return existingValue !== undefined && existingValue !== null ? existingValue : '';
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(SolidComputedField.prototype, "validationSchema", {
|
|
55
|
+
enumerable: false,
|
|
56
|
+
configurable: true,
|
|
57
|
+
writable: true,
|
|
58
|
+
value: function () {
|
|
59
|
+
// Computed fields are always optional; they are never set by the user.
|
|
60
|
+
return Yup.mixed().nullable();
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(SolidComputedField.prototype, "render", {
|
|
64
|
+
enumerable: false,
|
|
65
|
+
configurable: true,
|
|
66
|
+
writable: true,
|
|
67
|
+
value: function (formik) {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
var fieldLayoutInfo = this.fieldContext.field;
|
|
70
|
+
var className = ((_a = fieldLayoutInfo.attrs) === null || _a === void 0 ? void 0 : _a.className) || 'field col-12';
|
|
71
|
+
// Computed fields are only relevant for existing records.
|
|
72
|
+
// Check by whether the underlying data has an `id` (record exists).
|
|
73
|
+
var recordExists = !!((_b = this.fieldContext.data) === null || _b === void 0 ? void 0 : _b.id);
|
|
74
|
+
if (!recordExists) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
var viewWidget = fieldLayoutInfo.attrs.viewWidget;
|
|
78
|
+
var editWidget = fieldLayoutInfo.attrs.editWidget;
|
|
79
|
+
if (!editWidget) {
|
|
80
|
+
editWidget = 'DefaultComputedFormWidget';
|
|
81
|
+
}
|
|
82
|
+
if (!viewWidget) {
|
|
83
|
+
viewWidget = 'DefaultComputedFormWidget';
|
|
84
|
+
}
|
|
85
|
+
var viewMode = this.fieldContext.viewMode;
|
|
86
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: className, children: [viewMode === "view" &&
|
|
87
|
+
this.renderExtensionRenderMode(viewWidget, formik), viewMode === "edit" &&
|
|
88
|
+
this.renderExtensionRenderMode(editWidget, formik)] }) }));
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
Object.defineProperty(SolidComputedField.prototype, "renderExtensionRenderMode", {
|
|
92
|
+
enumerable: false,
|
|
93
|
+
configurable: true,
|
|
94
|
+
writable: true,
|
|
95
|
+
value: function (widget, formik) {
|
|
96
|
+
var DynamicWidget = getExtensionComponent(widget);
|
|
97
|
+
var widgetProps = {
|
|
98
|
+
formik: formik,
|
|
99
|
+
fieldContext: this.fieldContext,
|
|
100
|
+
};
|
|
101
|
+
return (_jsx(_Fragment, { children: DynamicWidget && _jsx(DynamicWidget, __assign({}, widgetProps)) }));
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return SolidComputedField;
|
|
105
|
+
}());
|
|
106
|
+
export { SolidComputedField };
|
|
107
|
+
/**
|
|
108
|
+
* Default widget for computed fields — renders as a read-only input in edit mode.
|
|
109
|
+
* Uses the same layout as the short-text view widget for consistency.
|
|
110
|
+
*/
|
|
111
|
+
export var DefaultComputedFormWidget = function (_a) {
|
|
112
|
+
var _b, _c;
|
|
113
|
+
var formik = _a.formik, fieldContext = _a.fieldContext;
|
|
114
|
+
var fieldMetadata = fieldContext.fieldMetadata;
|
|
115
|
+
var fieldLayoutInfo = fieldContext.field;
|
|
116
|
+
var fieldLabel = (_b = fieldLayoutInfo.attrs.label) !== null && _b !== void 0 ? _b : fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.displayName;
|
|
117
|
+
var showFieldLabel = (_c = fieldLayoutInfo === null || fieldLayoutInfo === void 0 ? void 0 : fieldLayoutInfo.attrs) === null || _c === void 0 ? void 0 : _c.showLabel;
|
|
118
|
+
var viewMode = fieldContext.viewMode;
|
|
119
|
+
var value = formik.values[fieldLayoutInfo.attrs.name];
|
|
120
|
+
if (viewMode === 'view') {
|
|
121
|
+
// View mode: display as plain text (same as DefaultShortTextFormViewWidget)
|
|
122
|
+
return (_jsxs("div", { className: styles.fieldViewWrapper, children: [showFieldLabel !== false && (_jsx("p", { className: "".concat(styles.fieldViewLabel, " form-field-label"), children: fieldLabel })), _jsx("p", { className: styles.fieldViewValue, children: value && typeof value === 'string' ? value : '' })] }));
|
|
123
|
+
}
|
|
124
|
+
// Edit mode: read-only input to make it clear this is a server-computed value
|
|
125
|
+
return (_jsxs("div", { className: styles.fieldWrapper, children: [showFieldLabel != false &&
|
|
126
|
+
_jsxs("label", { htmlFor: fieldLayoutInfo.attrs.name, className: "".concat(styles.fieldLabel, " form-field-label"), children: [fieldLabel, _jsx(SolidFieldTooltip, { fieldContext: fieldContext })] }), _jsx(SolidInput, { type: "text", id: fieldLayoutInfo.attrs.name, name: fieldLayoutInfo.attrs.name, value: value || '', readOnly: true, disabled: true, className: styles.fieldInput })] }));
|
|
127
|
+
};
|
|
128
|
+
//# sourceMappingURL=SolidComputedField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidComputedField.js","sourceRoot":"","sources":["../../../../../src/components/core/form/fields/SolidComputedField.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;;;;GAMG;AACH;IAII,4BAAY,YAA6B;QAFjC;;;;;WAA8B;QAGlC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC;;;;;eAED,UAAe,MAAW,EAAE,SAAmB;YAC3C,oEAAoE;QACxE,CAAC;;;;;;eAED;;YACI,IAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;YACrD,IAAM,aAAa,GAAG,MAAA,IAAI,CAAC,YAAY,CAAC,IAAI,0CAAG,SAAS,CAAC,CAAC;YAC1D,OAAO,aAAa,KAAK,SAAS,IAAI,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;QACtF,CAAC;;;;;;eAED;YACI,uEAAuE;YACvE,OAAO,GAAG,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC;QAClC,CAAC;;;;;;eAED,UAAO,MAAoB;;YACvB,IAAM,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;YAChD,IAAM,SAAS,GAAG,CAAA,MAAA,eAAe,CAAC,KAAK,0CAAE,SAAS,KAAI,cAAc,CAAC;YAErE,0DAA0D;YAC1D,oEAAoE;YACpE,IAAM,YAAY,GAAG,CAAC,CAAC,CAAA,MAAA,IAAI,CAAC,YAAY,CAAC,IAAI,0CAAE,EAAE,CAAA,CAAC;YAClD,IAAI,CAAC,YAAY,EAAE;gBACf,OAAO,IAAI,CAAC;aACf;YAED,IAAI,UAAU,GAAG,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC;YAClD,IAAI,UAAU,GAAG,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC;YAClD,IAAI,CAAC,UAAU,EAAE;gBACb,UAAU,GAAG,2BAA2B,CAAC;aAC5C;YACD,IAAI,CAAC,UAAU,EAAE;gBACb,UAAU,GAAG,2BAA2B,CAAC;aAC5C;YAED,IAAM,QAAQ,GAAW,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;YAEpD,OAAO,CACH,4BACI,eAAK,SAAS,EAAE,SAAS,aACpB,QAAQ,KAAK,MAAM;4BAChB,IAAI,CAAC,yBAAyB,CAAC,UAAU,EAAE,MAAM,CAAC,EAErD,QAAQ,KAAK,MAAM;4BAChB,IAAI,CAAC,yBAAyB,CAAC,UAAU,EAAE,MAAM,CAAC,IAEpD,GACP,CACN,CAAC;QACN,CAAC;;;;;;eAED,UAA0B,MAAc,EAAE,MAAoB;YAC1D,IAAI,aAAa,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;YAClD,IAAM,WAAW,GAA8B;gBAC3C,MAAM,EAAE,MAAM;gBACd,YAAY,EAAE,IAAI,CAAC,YAAY;aAClC,CAAA;YACD,OAAO,CACH,4BACK,aAAa,IAAI,KAAC,aAAa,eAAK,WAAW,EAAI,GACrD,CACN,CAAA;QACL,CAAC;;IACL,yBAAC;AAAD,CAAC,AAvED,IAuEC;;AAED;;;GAGG;AACH,MAAM,CAAC,IAAM,yBAAyB,GAAG,UAAC,EAAmD;;QAAjD,MAAM,YAAA,EAAE,YAAY,kBAAA;IAC5D,IAAM,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC;IACjD,IAAM,eAAe,GAAG,YAAY,CAAC,KAAK,CAAC;IAC3C,IAAM,UAAU,GAAG,MAAA,eAAe,CAAC,KAAK,CAAC,KAAK,mCAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,WAAW,CAAC;IAC7E,IAAM,cAAc,GAAG,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,KAAK,0CAAE,SAAS,CAAC;IACzD,IAAM,QAAQ,GAAW,YAAY,CAAC,QAAQ,CAAC;IAC/C,IAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAExD,IAAI,QAAQ,KAAK,MAAM,EAAE;QACrB,4EAA4E;QAC5E,OAAO,CACH,eAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,aAClC,cAAc,KAAK,KAAK,IAAI,CACzB,YAAG,SAAS,EAAE,UAAG,MAAM,CAAC,cAAc,sBAAmB,YAAG,UAAU,GAAK,CAC9E,EACD,YAAG,SAAS,EAAE,MAAM,CAAC,cAAc,YAAG,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAK,IACxF,CACT,CAAC;KACL;IAED,8EAA8E;IAC9E,OAAO,CACH,eAAK,SAAS,EAAE,MAAM,CAAC,YAAY,aAC9B,cAAc,IAAI,KAAK;gBACpB,iBAAO,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,UAAG,MAAM,CAAC,UAAU,sBAAmB,aACzF,UAAU,EACX,KAAC,iBAAiB,IAAC,YAAY,EAAE,YAAY,GAAI,IAC7C,EAEZ,KAAC,UAAU,IACP,IAAI,EAAC,MAAM,EACX,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAC9B,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAChC,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,QAAQ,QACR,QAAQ,QACR,SAAS,EAAE,MAAM,CAAC,UAAU,GAC9B,IACA,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["\nimport * as Yup from 'yup';\nimport styles from './solidFields.module.css';\nimport { FormikObject, ISolidField, SolidFieldProps } from \"./ISolidField\";\nimport { getExtensionComponent } from \"../../../../helpers/registry\";\nimport { SolidFormFieldWidgetProps } from \"../../../../types/solid-core\";\nimport { SolidFieldTooltip } from \"../../../../components/common/SolidFieldTooltip\";\nimport { SolidInput } from \"../../../shad-cn-ui\";\n\n/**\n * SolidComputedField\n *\n * Computed fields are server-generated values (e.g. auto-calculated totals, slugs, codes).\n * They are always read-only in the UI and are only shown when a record already exists\n * (i.e., the form is in view or edit mode for an existing record, NOT during creation).\n */\nexport class SolidComputedField implements ISolidField {\n\n private fieldContext: SolidFieldProps;\n\n constructor(fieldContext: SolidFieldProps) {\n this.fieldContext = fieldContext;\n }\n\n updateFormData(_value: any, _formData: FormData): any {\n // Computed fields are never submitted — the server calculates them.\n }\n\n initialValue(): any {\n const fieldName = this.fieldContext.field.attrs.name;\n const existingValue = this.fieldContext.data?.[fieldName];\n return existingValue !== undefined && existingValue !== null ? existingValue : '';\n }\n\n validationSchema(): Yup.Schema {\n // Computed fields are always optional; they are never set by the user.\n return Yup.mixed().nullable();\n }\n\n render(formik: FormikObject) {\n const fieldLayoutInfo = this.fieldContext.field;\n const className = fieldLayoutInfo.attrs?.className || 'field col-12';\n\n // Computed fields are only relevant for existing records.\n // Check by whether the underlying data has an `id` (record exists).\n const recordExists = !!this.fieldContext.data?.id;\n if (!recordExists) {\n return null;\n }\n\n let viewWidget = fieldLayoutInfo.attrs.viewWidget;\n let editWidget = fieldLayoutInfo.attrs.editWidget;\n if (!editWidget) {\n editWidget = 'DefaultComputedFormWidget';\n }\n if (!viewWidget) {\n viewWidget = 'DefaultComputedFormWidget';\n }\n\n const viewMode: string = this.fieldContext.viewMode;\n\n return (\n <>\n <div className={className}>\n {viewMode === \"view\" &&\n this.renderExtensionRenderMode(viewWidget, formik)\n }\n {viewMode === \"edit\" &&\n this.renderExtensionRenderMode(editWidget, formik)\n }\n </div>\n </>\n );\n }\n\n renderExtensionRenderMode(widget: string, formik: FormikObject) {\n let DynamicWidget = getExtensionComponent(widget);\n const widgetProps: SolidFormFieldWidgetProps = {\n formik: formik,\n fieldContext: this.fieldContext,\n }\n return (\n <>\n {DynamicWidget && <DynamicWidget {...widgetProps} />}\n </>\n )\n }\n}\n\n/**\n * Default widget for computed fields — renders as a read-only input in edit mode.\n * Uses the same layout as the short-text view widget for consistency.\n */\nexport const DefaultComputedFormWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {\n const fieldMetadata = fieldContext.fieldMetadata;\n const fieldLayoutInfo = fieldContext.field;\n const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata?.displayName;\n const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;\n const viewMode: string = fieldContext.viewMode;\n const value = formik.values[fieldLayoutInfo.attrs.name];\n\n if (viewMode === 'view') {\n // View mode: display as plain text (same as DefaultShortTextFormViewWidget)\n return (\n <div className={styles.fieldViewWrapper}>\n {showFieldLabel !== false && (\n <p className={`${styles.fieldViewLabel} form-field-label`}>{fieldLabel}</p>\n )}\n <p className={styles.fieldViewValue}>{value && typeof value === 'string' ? value : ''}</p>\n </div>\n );\n }\n\n // Edit mode: read-only input to make it clear this is a server-computed value\n return (\n <div className={styles.fieldWrapper}>\n {showFieldLabel != false &&\n <label htmlFor={fieldLayoutInfo.attrs.name} className={`${styles.fieldLabel} form-field-label`}>\n {fieldLabel}\n <SolidFieldTooltip fieldContext={fieldContext} />\n </label>\n }\n <SolidInput\n type=\"text\"\n id={fieldLayoutInfo.attrs.name}\n name={fieldLayoutInfo.attrs.name}\n value={value || ''}\n readOnly\n disabled\n className={styles.fieldInput}\n />\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
|
|
2
|
+
import * as Yup from 'yup';
|
|
3
|
+
import styles from './solidFields.module.css';
|
|
4
|
+
import { FormikObject, ISolidField, SolidFieldProps } from "./ISolidField";
|
|
5
|
+
import { getExtensionComponent } from "../../../../helpers/registry";
|
|
6
|
+
import { SolidFormFieldWidgetProps } from "../../../../types/solid-core";
|
|
7
|
+
import { SolidFieldTooltip } from "../../../../components/common/SolidFieldTooltip";
|
|
8
|
+
import { SolidInput } from "../../../shad-cn-ui";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* SolidComputedField
|
|
12
|
+
*
|
|
13
|
+
* Computed fields are server-generated values (e.g. auto-calculated totals, slugs, codes).
|
|
14
|
+
* They are always read-only in the UI and are only shown when a record already exists
|
|
15
|
+
* (i.e., the form is in view or edit mode for an existing record, NOT during creation).
|
|
16
|
+
*/
|
|
17
|
+
export class SolidComputedField implements ISolidField {
|
|
18
|
+
|
|
19
|
+
private fieldContext: SolidFieldProps;
|
|
20
|
+
|
|
21
|
+
constructor(fieldContext: SolidFieldProps) {
|
|
22
|
+
this.fieldContext = fieldContext;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
updateFormData(_value: any, _formData: FormData): any {
|
|
26
|
+
// Computed fields are never submitted — the server calculates them.
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
initialValue(): any {
|
|
30
|
+
const fieldName = this.fieldContext.field.attrs.name;
|
|
31
|
+
const existingValue = this.fieldContext.data?.[fieldName];
|
|
32
|
+
return existingValue !== undefined && existingValue !== null ? existingValue : '';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
validationSchema(): Yup.Schema {
|
|
36
|
+
// Computed fields are always optional; they are never set by the user.
|
|
37
|
+
return Yup.mixed().nullable();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
render(formik: FormikObject) {
|
|
41
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
42
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
43
|
+
|
|
44
|
+
// Computed fields are only relevant for existing records.
|
|
45
|
+
// Check by whether the underlying data has an `id` (record exists).
|
|
46
|
+
const recordExists = !!this.fieldContext.data?.id;
|
|
47
|
+
if (!recordExists) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
let viewWidget = fieldLayoutInfo.attrs.viewWidget;
|
|
52
|
+
let editWidget = fieldLayoutInfo.attrs.editWidget;
|
|
53
|
+
if (!editWidget) {
|
|
54
|
+
editWidget = 'DefaultComputedFormWidget';
|
|
55
|
+
}
|
|
56
|
+
if (!viewWidget) {
|
|
57
|
+
viewWidget = 'DefaultComputedFormWidget';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const viewMode: string = this.fieldContext.viewMode;
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<>
|
|
64
|
+
<div className={className}>
|
|
65
|
+
{viewMode === "view" &&
|
|
66
|
+
this.renderExtensionRenderMode(viewWidget, formik)
|
|
67
|
+
}
|
|
68
|
+
{viewMode === "edit" &&
|
|
69
|
+
this.renderExtensionRenderMode(editWidget, formik)
|
|
70
|
+
}
|
|
71
|
+
</div>
|
|
72
|
+
</>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
renderExtensionRenderMode(widget: string, formik: FormikObject) {
|
|
77
|
+
let DynamicWidget = getExtensionComponent(widget);
|
|
78
|
+
const widgetProps: SolidFormFieldWidgetProps = {
|
|
79
|
+
formik: formik,
|
|
80
|
+
fieldContext: this.fieldContext,
|
|
81
|
+
}
|
|
82
|
+
return (
|
|
83
|
+
<>
|
|
84
|
+
{DynamicWidget && <DynamicWidget {...widgetProps} />}
|
|
85
|
+
</>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Default widget for computed fields — renders as a read-only input in edit mode.
|
|
92
|
+
* Uses the same layout as the short-text view widget for consistency.
|
|
93
|
+
*/
|
|
94
|
+
export const DefaultComputedFormWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
|
|
95
|
+
const fieldMetadata = fieldContext.fieldMetadata;
|
|
96
|
+
const fieldLayoutInfo = fieldContext.field;
|
|
97
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata?.displayName;
|
|
98
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
99
|
+
const viewMode: string = fieldContext.viewMode;
|
|
100
|
+
const value = formik.values[fieldLayoutInfo.attrs.name];
|
|
101
|
+
|
|
102
|
+
if (viewMode === 'view') {
|
|
103
|
+
// View mode: display as plain text (same as DefaultShortTextFormViewWidget)
|
|
104
|
+
return (
|
|
105
|
+
<div className={styles.fieldViewWrapper}>
|
|
106
|
+
{showFieldLabel !== false && (
|
|
107
|
+
<p className={`${styles.fieldViewLabel} form-field-label`}>{fieldLabel}</p>
|
|
108
|
+
)}
|
|
109
|
+
<p className={styles.fieldViewValue}>{value && typeof value === 'string' ? value : ''}</p>
|
|
110
|
+
</div>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Edit mode: read-only input to make it clear this is a server-computed value
|
|
115
|
+
return (
|
|
116
|
+
<div className={styles.fieldWrapper}>
|
|
117
|
+
{showFieldLabel != false &&
|
|
118
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className={`${styles.fieldLabel} form-field-label`}>
|
|
119
|
+
{fieldLabel}
|
|
120
|
+
<SolidFieldTooltip fieldContext={fieldContext} />
|
|
121
|
+
</label>
|
|
122
|
+
}
|
|
123
|
+
<SolidInput
|
|
124
|
+
type="text"
|
|
125
|
+
id={fieldLayoutInfo.attrs.name}
|
|
126
|
+
name={fieldLayoutInfo.attrs.name}
|
|
127
|
+
value={value || ''}
|
|
128
|
+
readOnly
|
|
129
|
+
disabled
|
|
130
|
+
className={styles.fieldInput}
|
|
131
|
+
/>
|
|
132
|
+
</div>
|
|
133
|
+
);
|
|
134
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidDateTimeField.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/form/fields/SolidDateTimeField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"SolidDateTimeField.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/form/fields/SolidDateTimeField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAgBzE,qBAAa,kBAAmB,YAAW,WAAW;IAElD,OAAO,CAAC,YAAY,CAAkB;gBAE1B,YAAY,EAAE,eAAe;IAIzC,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG;IASnD,YAAY,IAAI,GAAG;IASnB,gBAAgB,IAAI,GAAG,CAAC,MAAM;IAe9B,MAAM,CAAC,MAAM,EAAE,YAAY;IAkC3B,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;CAYjE;AAKD,eAAO,MAAM,6BAA6B,6BAA8B,yBAAyB,4CAoDhG,CAAA;AAGD,eAAO,MAAM,6BAA6B,8BAGvC,yBAAyB,4CAwB3B,CAAC"}
|
|
@@ -18,7 +18,10 @@ import { getExtensionComponent } from "../../../../helpers/registry";
|
|
|
18
18
|
import { SolidFieldTooltip } from "../../../../components/common/SolidFieldTooltip";
|
|
19
19
|
import { ERROR_MESSAGES } from "../../../../constants/error-messages";
|
|
20
20
|
import { DateFieldViewComponent } from '../../../../components/core/common/DateFieldViewComponent';
|
|
21
|
+
import dayjs from "dayjs";
|
|
21
22
|
import styles from "./solidFields.module.css";
|
|
23
|
+
import utc from 'dayjs/plugin/utc';
|
|
24
|
+
dayjs.extend(utc);
|
|
22
25
|
var toDateValue = function (value) {
|
|
23
26
|
if (!value)
|
|
24
27
|
return null;
|
|
@@ -41,7 +44,10 @@ var SolidDateTimeField = /** @class */ (function () {
|
|
|
41
44
|
writable: true,
|
|
42
45
|
value: function (value, formData) {
|
|
43
46
|
var fieldLayoutInfo = this.fieldContext.field;
|
|
44
|
-
if (value) {
|
|
47
|
+
if (value instanceof Date && !isNaN(value.getTime())) {
|
|
48
|
+
formData.append(fieldLayoutInfo.attrs.name, dayjs(value).utc().format('YYYY-MM-DD HH:mm:ss'));
|
|
49
|
+
}
|
|
50
|
+
else if (value) {
|
|
45
51
|
formData.append(fieldLayoutInfo.attrs.name, value);
|
|
46
52
|
}
|
|
47
53
|
}
|
|
@@ -151,6 +157,6 @@ export var DefaultDateTimeFormViewWidget = function (_a) {
|
|
|
151
157
|
var showFieldLabel = (_c = fieldLayoutInfo === null || fieldLayoutInfo === void 0 ? void 0 : fieldLayoutInfo.attrs) === null || _c === void 0 ? void 0 : _c.showLabel;
|
|
152
158
|
var rawValue = formik.values[fieldName];
|
|
153
159
|
var format = (_d = fieldLayoutInfo.attrs) === null || _d === void 0 ? void 0 : _d.format;
|
|
154
|
-
return (_jsxs("div", { className: styles.fieldViewWrapper, children: [showFieldLabel !== false && (_jsx("p", { className: "".concat(styles.fieldViewLabel, " form-field-label"), children: fieldLabel })), _jsx("p", { className: styles.fieldViewValue, children: _jsx(DateFieldViewComponent, { value: rawValue, format: format, fallback: "-" }) })] }));
|
|
160
|
+
return (_jsxs("div", { className: styles.fieldViewWrapper, children: [showFieldLabel !== false && (_jsx("p", { className: "".concat(styles.fieldViewLabel, " form-field-label"), children: fieldLabel })), _jsx("p", { className: styles.fieldViewValue, children: _jsx(DateFieldViewComponent, { value: rawValue, format: format, showTime: true, fallback: "-" }) })] }));
|
|
155
161
|
};
|
|
156
162
|
//# sourceMappingURL=SolidDateTimeField.js.map
|