@solidstarters/solid-core-ui 1.1.16 → 1.1.18
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/auth/AuthLayout.d.ts +4 -0
- package/dist/components/auth/AuthLayout.d.ts.map +1 -0
- package/dist/components/auth/AuthLayout.js +80 -0
- package/dist/components/auth/AuthLayout.js.map +1 -0
- package/dist/components/auth/ForgotPasswordThankYou.d.ts +2 -0
- package/dist/components/auth/ForgotPasswordThankYou.d.ts.map +1 -0
- package/dist/components/auth/ForgotPasswordThankYou.js +16 -0
- package/dist/components/auth/ForgotPasswordThankYou.js.map +1 -0
- package/dist/components/auth/GoogleAuthChecking.d.ts +2 -0
- package/dist/components/auth/GoogleAuthChecking.d.ts.map +1 -0
- package/dist/components/auth/GoogleAuthChecking.js +99 -0
- package/dist/components/auth/GoogleAuthChecking.js.map +1 -0
- package/dist/components/auth/SolidChangeForcePassword.d.ts.map +1 -1
- package/dist/components/auth/SolidChangeForcePassword.js +44 -39
- package/dist/components/auth/SolidChangeForcePassword.js.map +1 -1
- package/dist/components/auth/SolidForgotPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidForgotPassword.js +1 -2
- package/dist/components/auth/SolidForgotPassword.js.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.d.ts +1 -3
- package/dist/components/auth/SolidInitialLoginOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.js +16 -12
- package/dist/components/auth/SolidInitialLoginOtp.js.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.d.ts +1 -3
- package/dist/components/auth/SolidInitiateRegisterOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.js +16 -12
- package/dist/components/auth/SolidInitiateRegisterOtp.js.map +1 -1
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +12 -8
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidRegister.d.ts.map +1 -1
- package/dist/components/auth/SolidRegister.js +13 -9
- package/dist/components/auth/SolidRegister.js.map +1 -1
- package/dist/components/auth/SolidResetPassword.d.ts +1 -4
- package/dist/components/auth/SolidResetPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidResetPassword.js +14 -10
- package/dist/components/auth/SolidResetPassword.js.map +1 -1
- package/dist/components/common/GeneralSettings.d.ts +1 -3
- package/dist/components/common/GeneralSettings.d.ts.map +1 -1
- package/dist/components/common/GeneralSettings.js +21 -18
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/common/NotFound.d.ts +2 -0
- package/dist/components/common/NotFound.d.ts.map +1 -0
- package/dist/components/common/NotFound.js +7 -0
- package/dist/components/common/NotFound.js.map +1 -0
- package/dist/components/common/SingleSelectAutoCompleteField.d.ts.map +1 -1
- package/dist/components/common/SingleSelectAutoCompleteField.js +3 -1
- package/dist/components/common/SingleSelectAutoCompleteField.js.map +1 -1
- package/dist/components/common/SocialMediaLogin.d.ts.map +1 -1
- package/dist/components/common/SocialMediaLogin.js +3 -2
- package/dist/components/common/SocialMediaLogin.js.map +1 -1
- package/dist/components/common/SolidAdmin.d.ts +2 -0
- package/dist/components/common/SolidAdmin.d.ts.map +1 -0
- package/dist/components/common/SolidAdmin.js +5 -0
- package/dist/components/common/SolidAdmin.js.map +1 -0
- package/dist/components/common/SolidFormStepper.d.ts.map +1 -1
- package/dist/components/common/SolidFormStepper.js +8 -1
- package/dist/components/common/SolidFormStepper.js.map +1 -1
- package/dist/components/common/SolidThemeLink.d.ts +2 -0
- package/dist/components/common/SolidThemeLink.d.ts.map +1 -0
- package/dist/components/common/SolidThemeLink.js +5 -0
- package/dist/components/common/SolidThemeLink.js.map +1 -0
- package/dist/components/common/error.d.ts +9 -0
- package/dist/components/common/error.d.ts.map +1 -0
- package/dist/components/common/error.js +7 -0
- package/dist/components/common/error.js.map +1 -0
- package/dist/components/core/common/FilterComponent.js +7 -7
- package/dist/components/core/common/FilterComponent.js.map +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.js +4 -3
- package/dist/components/core/common/SolidConfigureLayoutElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +38 -18
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/form/SolidFormLayouts.d.ts +3 -0
- package/dist/components/core/form/SolidFormLayouts.d.ts.map +1 -0
- package/dist/components/core/form/SolidFormLayouts.js +57 -0
- package/dist/components/core/form/SolidFormLayouts.js.map +1 -0
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +13 -1
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.js +9 -7
- package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.js +7 -5
- package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.js +7 -5
- package/dist/components/core/form/fields/SolidDateTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDecimalField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDecimalField.js +9 -7
- package/dist/components/core/form/fields/SolidDecimalField.js.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.js +9 -7
- package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.js +6 -4
- package/dist/components/core/form/fields/SolidJsonField.js.map +1 -1
- package/dist/components/core/form/fields/SolidLongTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidLongTextField.js +8 -6
- package/dist/components/core/form/fields/SolidLongTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.js +29 -23
- package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +22 -19
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.js +9 -7
- package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js +10 -8
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.js +10 -8
- package/dist/components/core/form/fields/SolidSelectionStaticField.js.map +1 -1
- 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/SolidTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.js +7 -5
- package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +16 -12
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts +1 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +66 -7
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +12 -10
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +2 -2
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +48 -62
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +9 -2
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js +10 -3
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
- package/dist/components/core/model/CreateModel.d.ts.map +1 -1
- package/dist/components/core/model/CreateModel.js +12 -1
- package/dist/components/core/model/CreateModel.js.map +1 -1
- package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaData.js +55 -2
- package/dist/components/core/model/FieldMetaData.js.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.d.ts +1 -1
- package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js +128 -61
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/model/ModelMetaData.js +5 -5
- package/dist/components/core/module/CreateModule.d.ts.map +1 -1
- package/dist/components/core/module/CreateModule.js +7 -3
- package/dist/components/core/module/CreateModule.js.map +1 -1
- package/dist/components/core/users/CreateUser.js +2 -2
- package/dist/components/layout/AdminLayout.d.ts +4 -0
- package/dist/components/layout/AdminLayout.d.ts.map +1 -0
- package/dist/components/layout/AdminLayout.js +86 -0
- package/dist/components/layout/AdminLayout.js.map +1 -0
- package/dist/components/layout/AppConfig.d.ts.map +1 -1
- package/dist/components/layout/AppConfig.js +4 -9
- package/dist/components/layout/AppConfig.js.map +1 -1
- package/dist/components/layout/user-profile-menu.js +1 -1
- package/dist/components/layout/user-profile-menu.js.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/nextAuth/authProviders.d.ts +4 -0
- package/dist/nextAuth/authProviders.d.ts.map +1 -0
- package/dist/nextAuth/authProviders.js +231 -0
- package/dist/nextAuth/authProviders.js.map +1 -0
- package/dist/nextAuth/refreshAccessToken.d.ts +2 -0
- package/dist/nextAuth/refreshAccessToken.d.ts.map +1 -0
- package/dist/nextAuth/refreshAccessToken.js +76 -0
- package/dist/nextAuth/refreshAccessToken.js.map +1 -0
- package/dist/redux/api/modelApi.d.ts +2 -1
- package/dist/redux/api/modelApi.d.ts.map +1 -1
- package/dist/redux/api/modelApi.js +9 -2
- package/dist/redux/api/modelApi.js.map +1 -1
- package/package.json +1 -1
- package/src/components/auth/AuthLayout.tsx +126 -0
- package/src/components/auth/ForgotPasswordThankYou.tsx +45 -0
- package/src/components/auth/GoogleAuthChecking.tsx +60 -0
- package/src/components/auth/SolidChangeForcePassword.tsx +21 -32
- package/src/components/auth/SolidForgotPassword.tsx +3 -2
- package/src/components/auth/SolidInitialLoginOtp.tsx +16 -8
- package/src/components/auth/SolidInitiateRegisterOtp.tsx +17 -9
- package/src/components/auth/SolidLogin.tsx +16 -10
- package/src/components/auth/SolidRegister.tsx +17 -9
- package/src/components/auth/SolidResetPassword.tsx +13 -6
- package/src/components/common/GeneralSettings.tsx +7 -2
- package/src/components/common/NotFound.tsx +22 -0
- package/src/components/common/SingleSelectAutoCompleteField.tsx +3 -1
- package/src/components/common/SocialMediaLogin.tsx +24 -25
- package/src/components/common/SolidAdmin.tsx +7 -0
- package/src/components/common/SolidFormStepper.tsx +55 -2
- package/src/components/common/SolidThemeLink.tsx +5 -0
- package/src/components/common/error.tsx +30 -0
- package/src/components/core/common/FilterComponent.tsx +70 -70
- package/src/components/core/common/SolidConfigureLayoutElement.tsx +6 -1
- package/src/components/core/common/SolidGlobalSearchElement.tsx +48 -20
- package/src/components/core/form/SolidFormLayouts.tsx +93 -0
- package/src/components/core/form/SolidFormView.tsx +64 -3
- package/src/components/core/form/fields/SolidBooleanField.tsx +6 -3
- package/src/components/core/form/fields/SolidDateField.tsx +6 -3
- package/src/components/core/form/fields/SolidDateTimeField.tsx +6 -3
- package/src/components/core/form/fields/SolidDecimalField.tsx +6 -3
- package/src/components/core/form/fields/SolidIntegerField.tsx +6 -3
- package/src/components/core/form/fields/SolidJsonField.tsx +6 -3
- package/src/components/core/form/fields/SolidLongTextField.tsx +6 -3
- package/src/components/core/form/fields/SolidMediaMultipleField.tsx +20 -12
- package/src/components/core/form/fields/SolidMediaSingleField.tsx +9 -6
- package/src/components/core/form/fields/SolidRichTextField.tsx +7 -3
- package/src/components/core/form/fields/SolidSelectionDynamicField.tsx +6 -3
- package/src/components/core/form/fields/SolidSelectionStaticField.tsx +6 -3
- package/src/components/core/form/fields/SolidShortTextField.tsx +8 -4
- package/src/components/core/form/fields/SolidTimeField.tsx +7 -4
- package/src/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +14 -8
- package/src/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +93 -3
- package/src/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +5 -1
- package/src/components/core/kanban/SolidKanbanView.tsx +4 -4
- package/src/components/core/list/SolidListView.tsx +16 -64
- package/src/components/core/list/columns/SolidMediaMultipleColumn.tsx +18 -0
- package/src/components/core/list/columns/SolidMediaSingleColumn.tsx +21 -0
- package/src/components/core/model/CreateModel.tsx +58 -0
- package/src/components/core/model/FieldMetaData.tsx +27 -1
- package/src/components/core/model/FieldMetaDataForm.tsx +134 -44
- package/src/components/core/model/ModelMetaData.tsx +5 -5
- package/src/components/core/module/CreateModule.tsx +12 -4
- package/src/components/core/users/CreateUser.tsx +2 -2
- package/src/components/layout/AdminLayout.tsx +62 -0
- package/src/components/layout/AppConfig.tsx +4 -3
- package/src/components/layout/user-profile-menu.tsx +1 -1
- package/src/index.ts +17 -1
- package/src/nextAuth/authProviders.tsx +220 -0
- package/src/nextAuth/refreshAccessToken.tsx +27 -0
- package/src/redux/api/modelApi.ts +9 -2
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import { useGetmodelByIdQuery } from "@/redux/api/modelApi";
|
|
3
|
+
import { useGetmoduleByIdQuery } from "@/redux/api/moduleApi";
|
|
4
|
+
import { useGetusersByIdQuery } from "@/redux/api/userApi";
|
|
5
|
+
import { useEffect } from "react";
|
|
6
|
+
import CreateModel from "../model/CreateModel";
|
|
7
|
+
import CreateModule from "../module/CreateModule";
|
|
8
|
+
import CreateUser from "../users/CreateUser";
|
|
9
|
+
import SolidFormView from "./SolidFormView";
|
|
10
|
+
import { camelCase } from "change-case";
|
|
11
|
+
|
|
12
|
+
type SolidViewParams = {
|
|
13
|
+
params: {
|
|
14
|
+
moduleName: string;
|
|
15
|
+
modelName: string;
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const SolidFormLayouts = ({ params }: any) => {
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
data: modelData,
|
|
24
|
+
error,
|
|
25
|
+
isLoading,
|
|
26
|
+
isError,
|
|
27
|
+
refetch
|
|
28
|
+
} = useGetmodelByIdQuery(params.id);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
refetch();
|
|
31
|
+
}, [refetch]);
|
|
32
|
+
|
|
33
|
+
const {
|
|
34
|
+
data: moduleData,
|
|
35
|
+
error: moduleError,
|
|
36
|
+
isLoading: isModuleLoading,
|
|
37
|
+
isError: isModuleError,
|
|
38
|
+
refetch: refetchModule
|
|
39
|
+
} = useGetmoduleByIdQuery(params.id);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
refetchModule();
|
|
42
|
+
}, [refetchModule]);
|
|
43
|
+
|
|
44
|
+
const {
|
|
45
|
+
data: userData,
|
|
46
|
+
error: usererror,
|
|
47
|
+
isLoading: isuserLoading,
|
|
48
|
+
isError: isuserError,
|
|
49
|
+
refetch: refetchuser
|
|
50
|
+
} = useGetusersByIdQuery(params.id);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
refetchuser();
|
|
53
|
+
}, [refetchuser]);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<div className="page-parent-wrapper">
|
|
57
|
+
{params.modelName === "model-metadata" &&
|
|
58
|
+
// <SolidFormView {...params} embeded={false} modelName={camelCase(params.modelName)} />
|
|
59
|
+
(params.id === "new" ?
|
|
60
|
+
<CreateModel params={params}></CreateModel>
|
|
61
|
+
:
|
|
62
|
+
<CreateModel params={params} data={modelData?.data}></CreateModel>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
{params.modelName === "module-metadata" &&
|
|
66
|
+
// <SolidFormView {...params} embeded={false} modelName={camelCase(params.modelName)} />
|
|
67
|
+
(params.id === "new" ?
|
|
68
|
+
<CreateModule params={params}></CreateModule>
|
|
69
|
+
:
|
|
70
|
+
<CreateModule params={params} data={moduleData?.data}></CreateModule>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
{params.modelName === "user" &&
|
|
75
|
+
// <SolidFormView {...params} embeded={false} modelName={camelCase(params.modelName)} />
|
|
76
|
+
(params.id === "new" ?
|
|
77
|
+
<CreateUser params={params}></CreateUser>
|
|
78
|
+
:
|
|
79
|
+
<CreateUser params={params} data={userData?.data}></CreateUser>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
{params.modelName === "field-metadata" &&
|
|
84
|
+
<SolidFormView {...params} embeded={false} modelName={camelCase(params.modelName)} />
|
|
85
|
+
}
|
|
86
|
+
{params.modelName !== "field-metadata" && params.modelName !== "model-metadata" && params.modelName !== "module-metadata" && params.modelName !== "user" &&
|
|
87
|
+
<SolidFormView {...params} embeded={false} modelName={camelCase(params.modelName)} />
|
|
88
|
+
}
|
|
89
|
+
</div>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export default SolidFormLayouts
|
|
@@ -34,6 +34,7 @@ import { SolidShortTextField } from "./fields/SolidShortTextField";
|
|
|
34
34
|
import { SolidTimeField } from "./fields/SolidTimeField";
|
|
35
35
|
import { BackButton } from "@/components/common/BackButton";
|
|
36
36
|
import { SolidFormStepper } from "@/components/common/SolidFormStepper";
|
|
37
|
+
import { OverlayPanel } from "primereact/overlaypanel";
|
|
37
38
|
|
|
38
39
|
export type SolidFormViewProps = {
|
|
39
40
|
moduleName: string;
|
|
@@ -297,6 +298,8 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
297
298
|
const errorFields: string[] = [];
|
|
298
299
|
|
|
299
300
|
const [triggerCheckIfPermissionExists] = useLazyCheckIfPermissionExistsQuery();
|
|
301
|
+
const op = useRef(null);
|
|
302
|
+
|
|
300
303
|
useEffect(() => {
|
|
301
304
|
|
|
302
305
|
const fetchPermissions = async () => {
|
|
@@ -678,6 +681,61 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
678
681
|
setDeleteDialogVisible(false);
|
|
679
682
|
}
|
|
680
683
|
|
|
684
|
+
const formActionDropdown = () => {
|
|
685
|
+
return (
|
|
686
|
+
<div>
|
|
687
|
+
<Button
|
|
688
|
+
outlined
|
|
689
|
+
severity="secondary"
|
|
690
|
+
type="button"
|
|
691
|
+
icon={
|
|
692
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
693
|
+
<path d="M6 14C5.45 14 4.97917 13.8042 4.5875 13.4125C4.19583 13.0208 4 12.55 4 12C4 11.45 4.19583 10.9792 4.5875 10.5875C4.97917 10.1958 5.45 10 6 10C6.55 10 7.02083 10.1958 7.4125 10.5875C7.80417 10.9792 8 11.45 8 12C8 12.55 7.80417 13.0208 7.4125 13.4125C7.02083 13.8042 6.55 14 6 14ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM18 14C17.45 14 16.9792 13.8042 16.5875 13.4125C16.1958 13.0208 16 12.55 16 12C16 11.45 16.1958 10.9792 16.5875 10.5875C16.9792 10.1958 17.45 10 18 10C18.55 10 19.0208 10.1958 19.4125 10.5875C19.8042 10.9792 20 11.45 20 12C20 12.55 19.8042 13.0208 19.4125 13.4125C19.0208 13.8042 18.55 14 18 14Z" fill="#4B4D52" />
|
|
694
|
+
</svg>
|
|
695
|
+
}
|
|
696
|
+
size="small"
|
|
697
|
+
className="bg-primary-reverse p-0"
|
|
698
|
+
style={{
|
|
699
|
+
height: 32,
|
|
700
|
+
width: 32
|
|
701
|
+
}}
|
|
702
|
+
onClick={(e) =>
|
|
703
|
+
// @ts-ignore
|
|
704
|
+
op.current.toggle(e)
|
|
705
|
+
}
|
|
706
|
+
/>
|
|
707
|
+
<OverlayPanel ref={op} className="solid-custom-overlay">
|
|
708
|
+
<div className="flex flex-column gap-1 p-1">
|
|
709
|
+
<Button
|
|
710
|
+
text
|
|
711
|
+
type="button"
|
|
712
|
+
className="w-8rem text-left gap-2 text-color"
|
|
713
|
+
label="Duplicate"
|
|
714
|
+
size="small"
|
|
715
|
+
iconPos="left"
|
|
716
|
+
icon={<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
717
|
+
<path d="M6 11.9997C5.63333 11.9997 5.31944 11.8691 5.05833 11.608C4.79722 11.3469 4.66667 11.033 4.66667 10.6663V2.66634C4.66667 2.29967 4.79722 1.98579 5.05833 1.72467C5.31944 1.46356 5.63333 1.33301 6 1.33301H12C12.3667 1.33301 12.6806 1.46356 12.9417 1.72467C13.2028 1.98579 13.3333 2.29967 13.3333 2.66634V10.6663C13.3333 11.033 13.2028 11.3469 12.9417 11.608C12.6806 11.8691 12.3667 11.9997 12 11.9997H6ZM6 10.6663H12V2.66634H6V10.6663ZM3.33333 14.6663C2.96667 14.6663 2.65278 14.5358 2.39167 14.2747C2.13056 14.0136 2 13.6997 2 13.333V3.99967H3.33333V13.333H10.6667V14.6663H3.33333Z" fill="black" fill-opacity="0.88" />
|
|
718
|
+
</svg>}
|
|
719
|
+
/>
|
|
720
|
+
<Button
|
|
721
|
+
text
|
|
722
|
+
type="button"
|
|
723
|
+
className="w-8rem text-left gap-2 text-color"
|
|
724
|
+
label="Delete"
|
|
725
|
+
size="small"
|
|
726
|
+
iconPos="left"
|
|
727
|
+
icon={<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
728
|
+
<path d="M4.66666 14C4.29999 14 3.9861 13.8694 3.72499 13.6083C3.46388 13.3472 3.33332 13.0333 3.33332 12.6667V4H2.66666V2.66667H5.99999V2H9.99999V2.66667H13.3333V4H12.6667V12.6667C12.6667 13.0333 12.5361 13.3472 12.275 13.6083C12.0139 13.8694 11.7 14 11.3333 14H4.66666ZM11.3333 4H4.66666V12.6667H11.3333V4ZM5.99999 11.3333H7.33332V5.33333H5.99999V11.3333ZM8.66666 11.3333H9.99999V5.33333H8.66666V11.3333Z" fill="#4B4D52" />
|
|
729
|
+
</svg>
|
|
730
|
+
}
|
|
731
|
+
onClick={() => setDeleteDialogVisible(true)}
|
|
732
|
+
/>
|
|
733
|
+
</div>
|
|
734
|
+
</OverlayPanel>
|
|
735
|
+
</div>
|
|
736
|
+
)
|
|
737
|
+
}
|
|
738
|
+
|
|
681
739
|
return (
|
|
682
740
|
<div className="solid-form-wrapper">
|
|
683
741
|
<Toast ref={toast} />
|
|
@@ -830,13 +888,16 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
830
888
|
{params.embeded !== true &&
|
|
831
889
|
<SolidCancelButton />
|
|
832
890
|
}
|
|
891
|
+
{formActionDropdown()}
|
|
833
892
|
</div>
|
|
834
893
|
</>
|
|
835
894
|
)}
|
|
836
895
|
</div>
|
|
837
|
-
|
|
838
|
-
<
|
|
839
|
-
|
|
896
|
+
{params.embeded !== true &&
|
|
897
|
+
<div className="solid-form-stepper">
|
|
898
|
+
<SolidFormStepper />
|
|
899
|
+
</div>
|
|
900
|
+
}
|
|
840
901
|
<div className="p-4 solid-form-content">
|
|
841
902
|
{renderFormDynamically(formViewMetaData)}
|
|
842
903
|
</div>
|
|
@@ -69,6 +69,7 @@ export class SolidBooleanField implements ISolidField {
|
|
|
69
69
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
70
70
|
const booleanOptions = ["false", "true"];
|
|
71
71
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
72
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
72
73
|
|
|
73
74
|
useEffect(() => { formik.setFieldValue(fieldLayoutInfo.attrs.name, "false") }, [])
|
|
74
75
|
|
|
@@ -83,9 +84,11 @@ export class SolidBooleanField implements ISolidField {
|
|
|
83
84
|
return (
|
|
84
85
|
<div className={className}>
|
|
85
86
|
<div className="flex flex-column gap-2 mt-4">
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
{showFieldLabel != false &&
|
|
88
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
89
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
90
|
+
</label>
|
|
91
|
+
}
|
|
89
92
|
{/* <InputText
|
|
90
93
|
id={fieldLayoutInfo.attrs.name}
|
|
91
94
|
className="small-input"
|
|
@@ -52,6 +52,7 @@ export class SolidDateField implements ISolidField {
|
|
|
52
52
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
53
53
|
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
54
54
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
55
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
55
56
|
|
|
56
57
|
const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
|
|
57
58
|
// const fieldReadonly = fieldLayoutInfo.attrs?.readonly;
|
|
@@ -62,9 +63,11 @@ export class SolidDateField implements ISolidField {
|
|
|
62
63
|
return (
|
|
63
64
|
<div className={className}>
|
|
64
65
|
<div className="flex flex-column gap-2 mt-4">
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
{showFieldLabel != false &&
|
|
67
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
68
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
69
|
+
</label>
|
|
70
|
+
}
|
|
68
71
|
<Calendar
|
|
69
72
|
disabled={formDisabled || fieldDisabled}
|
|
70
73
|
ref={calendarRef} // Attach ref to Calendar
|
|
@@ -51,6 +51,7 @@ export class SolidDateTimeField implements ISolidField {
|
|
|
51
51
|
const calendarRef = useRef<any>(null); // Reference for the Calendar component
|
|
52
52
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
53
53
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
54
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
54
55
|
|
|
55
56
|
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
56
57
|
|
|
@@ -60,9 +61,11 @@ export class SolidDateTimeField implements ISolidField {
|
|
|
60
61
|
return (
|
|
61
62
|
<div className={className}>
|
|
62
63
|
<div className="flex flex-column gap-2 mt-4">
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
{showFieldLabel != false &&
|
|
65
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
66
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
67
|
+
</label>
|
|
68
|
+
}
|
|
66
69
|
<Calendar
|
|
67
70
|
disabled={formDisabled || fieldDisabled}
|
|
68
71
|
ref={calendarRef} // Attach ref to Calendar
|
|
@@ -52,6 +52,7 @@ export class SolidDecimalField implements ISolidField {
|
|
|
52
52
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
53
53
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
54
54
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
55
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
55
56
|
|
|
56
57
|
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
57
58
|
|
|
@@ -64,9 +65,11 @@ export class SolidDecimalField implements ISolidField {
|
|
|
64
65
|
return (
|
|
65
66
|
<div className={className}>
|
|
66
67
|
<div className="flex flex-column gap-2 mt-4">
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
{showFieldLabel != false &&
|
|
69
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
70
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
71
|
+
</label>
|
|
72
|
+
}
|
|
70
73
|
<InputNumber
|
|
71
74
|
readOnly={formReadonly || fieldReadonly}
|
|
72
75
|
disabled={formDisabled || fieldDisabled}
|
|
@@ -53,6 +53,7 @@ export class SolidIntegerField implements ISolidField {
|
|
|
53
53
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
54
54
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
55
55
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
56
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
56
57
|
|
|
57
58
|
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
58
59
|
|
|
@@ -65,9 +66,11 @@ export class SolidIntegerField implements ISolidField {
|
|
|
65
66
|
return (
|
|
66
67
|
<div className={className}>
|
|
67
68
|
<div className="flex flex-column gap-2 mt-4">
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
{showFieldLabel != false &&
|
|
70
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
71
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
72
|
+
</label>
|
|
73
|
+
}
|
|
71
74
|
<InputNumber
|
|
72
75
|
readOnly={formReadonly || fieldReadonly}
|
|
73
76
|
disabled={formDisabled || fieldDisabled}
|
|
@@ -47,6 +47,7 @@ export class SolidJsonField implements ISolidField {
|
|
|
47
47
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
48
48
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
49
49
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
50
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
50
51
|
|
|
51
52
|
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
52
53
|
|
|
@@ -56,10 +57,12 @@ export class SolidJsonField implements ISolidField {
|
|
|
56
57
|
return (
|
|
57
58
|
<div className={className}>
|
|
58
59
|
<div className="flex flex-column gap-2 mt-4">
|
|
59
|
-
|
|
60
|
+
{showFieldLabel != false &&
|
|
61
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
64
|
+
</label>
|
|
65
|
+
}
|
|
63
66
|
<CodeEditor
|
|
64
67
|
formik={formik}
|
|
65
68
|
field={fieldLayoutInfo.attrs.name}
|
|
@@ -65,6 +65,7 @@ export class SolidLongTextField implements ISolidField {
|
|
|
65
65
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
66
66
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
67
67
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
68
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
68
69
|
|
|
69
70
|
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
70
71
|
|
|
@@ -77,9 +78,11 @@ export class SolidLongTextField implements ISolidField {
|
|
|
77
78
|
return (
|
|
78
79
|
<div className={className}>
|
|
79
80
|
<div className="flex flex-column gap-2 mt-4">
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
{showFieldLabel != false &&
|
|
82
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
83
|
+
{fieldDescription && <span>({fieldDescription}) </span>}
|
|
84
|
+
</label>
|
|
85
|
+
}
|
|
83
86
|
<InputTextarea
|
|
84
87
|
readOnly={formReadonly || fieldReadonly}
|
|
85
88
|
disabled={formDisabled || fieldDisabled}
|
|
@@ -93,13 +93,14 @@ export class SolidMediaMultipleField implements ISolidField {
|
|
|
93
93
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
94
94
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
95
95
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
96
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
96
97
|
|
|
97
98
|
const [imagesPreview, setImagesPreview] = useState<Array<string | ArrayBuffer>>([]);
|
|
98
99
|
const [isDeleteImageDialogVisible, setDeleteImageDialogVisible] = useState(false);
|
|
99
100
|
const [imageToBeDeletedData, setImageToBeDeletedData] = useState<any>();
|
|
100
101
|
const [uploadProgress, setUploadProgress] = useState<Record<string, number>>({});
|
|
101
102
|
const [uploadCompleted, setUploadCompleted] = useState<Record<string, boolean>>({});
|
|
102
|
-
const [fileDetails, setFileDetails] = useState<{ name: string; type: string; size: number }[]>([]);
|
|
103
|
+
const [fileDetails, setFileDetails] = useState<{ name: string; type: string; size: number, id: number }[]>([]);
|
|
103
104
|
const [uploadedSize, setUploadedSize] = useState<Record<string, string>>({});
|
|
104
105
|
const [totalSize, setTotalSize] = useState<Record<string, string>>({});
|
|
105
106
|
const [selectedFileId, setSelectedFileId] = useState<string | null>(null);
|
|
@@ -118,7 +119,7 @@ export class SolidMediaMultipleField implements ISolidField {
|
|
|
118
119
|
const fieldValue = formik?.values[fieldLayoutInfo.attrs.name];
|
|
119
120
|
if (Array.isArray(fieldValue) && fieldValue.length > 0) {
|
|
120
121
|
const urls: string[] = [];
|
|
121
|
-
const details: { name: string; type: string; size: number }[] = [];
|
|
122
|
+
const details: { name: string; type: string; size: number, id: any }[] = [];
|
|
122
123
|
const progress: Record<string, number> = {};
|
|
123
124
|
const completed: Record<string, boolean> = {};
|
|
124
125
|
|
|
@@ -126,13 +127,14 @@ export class SolidMediaMultipleField implements ISolidField {
|
|
|
126
127
|
if (file instanceof File) {
|
|
127
128
|
// New file (from local upload)
|
|
128
129
|
urls.push(URL.createObjectURL(file));
|
|
129
|
-
details.push({ name: file.name, type: file.type, size: file.size });
|
|
130
|
+
details.push({ name: file.name, type: file.type, size: file.size, id: `${file.name}-${file.size}`, });
|
|
130
131
|
} else if (typeof file === "object" && file._full_url) {
|
|
131
132
|
urls.push(file._full_url);
|
|
132
133
|
details.push({
|
|
133
134
|
name: file.relativeUri || "Unknown", // Use relativeUri or fallback
|
|
134
135
|
type: file.mediaStorageProviderMetadata?.type || "Unknown", // Extract type if available
|
|
135
136
|
size: 0, // API doesn't provide size, set 0 or fetch from metadata if available
|
|
137
|
+
id: file.id
|
|
136
138
|
});
|
|
137
139
|
}
|
|
138
140
|
});
|
|
@@ -147,7 +149,7 @@ export class SolidMediaMultipleField implements ISolidField {
|
|
|
147
149
|
}
|
|
148
150
|
}, [formik.values, fieldLayoutInfo.attrs.name]);
|
|
149
151
|
|
|
150
|
-
const handleDropImages = (acceptedFiles:
|
|
152
|
+
const handleDropImages = (acceptedFiles: any[]) => {
|
|
151
153
|
if (!acceptedFiles.length) return;
|
|
152
154
|
|
|
153
155
|
const newFileDetails = [...fileDetails];
|
|
@@ -159,7 +161,7 @@ export class SolidMediaMultipleField implements ISolidField {
|
|
|
159
161
|
acceptedFiles.forEach((file) => {
|
|
160
162
|
const fileId = `${file.name}-${file.size}`; // Unique identifier for tracking each file
|
|
161
163
|
|
|
162
|
-
newFileDetails.push({ name: file.name, type: file.type, size: file.size });
|
|
164
|
+
newFileDetails.push({ name: file.name, type: file.type, size: file.size, id: file.id });
|
|
163
165
|
newUploadProgress[fileId] = 0;
|
|
164
166
|
newUploadedSize[fileId] = "0 KB";
|
|
165
167
|
newTotalSize[fileId] = formatFileSize(file.size);
|
|
@@ -224,18 +226,22 @@ export class SolidMediaMultipleField implements ISolidField {
|
|
|
224
226
|
formik.setFieldValue(fieldLayoutInfo.attrs.name, fileDetails.filter((file) => `${file.name}-${file.size}` !== fileId));
|
|
225
227
|
};
|
|
226
228
|
|
|
227
|
-
const confirmDeleteFile = (fileId: any) => {
|
|
229
|
+
const confirmDeleteFile = (fileId: any, deleteId: number) => {
|
|
228
230
|
setSelectedFileId(fileId);
|
|
229
231
|
setDeleteImageDialogVisible(true);
|
|
232
|
+
setImageToBeDeletedData(deleteId)
|
|
230
233
|
};
|
|
231
234
|
|
|
232
235
|
const deleteFile = () => {
|
|
233
|
-
if (selectedFileId) {
|
|
236
|
+
if (selectedFileId && imageToBeDeletedData) {
|
|
234
237
|
handleCancelUpload(selectedFileId);
|
|
238
|
+
deleteMedia(imageToBeDeletedData);
|
|
235
239
|
setDeleteImageDialogVisible(false);
|
|
240
|
+
setShowAllFiles(false)
|
|
236
241
|
setSelectedFileId(null);
|
|
237
242
|
}
|
|
238
243
|
};
|
|
244
|
+
|
|
239
245
|
const {
|
|
240
246
|
getRootProps,
|
|
241
247
|
getInputProps,
|
|
@@ -269,10 +275,12 @@ export class SolidMediaMultipleField implements ISolidField {
|
|
|
269
275
|
return (
|
|
270
276
|
<div className={className}>
|
|
271
277
|
<div className="flex flex-column gap-2 mt-4">
|
|
272
|
-
|
|
278
|
+
{showFieldLabel != false &&
|
|
279
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
273
280
|
|
|
274
|
-
|
|
275
|
-
|
|
281
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
282
|
+
</label>
|
|
283
|
+
}
|
|
276
284
|
<div
|
|
277
285
|
{...getRootProps()}
|
|
278
286
|
className="solid-dropzone-wrapper"
|
|
@@ -290,7 +298,7 @@ export class SolidMediaMultipleField implements ISolidField {
|
|
|
290
298
|
<div className="font-bold">{fileDetails[0].name}</div>
|
|
291
299
|
<div
|
|
292
300
|
className="cancel-upload-button"
|
|
293
|
-
onClick={() => confirmDeleteFile(`${fileDetails[0].name}-${fileDetails[0].size}
|
|
301
|
+
onClick={() => confirmDeleteFile(`${fileDetails[0].name}-${fileDetails[0].size}`, fileDetails[0].id)}
|
|
294
302
|
>
|
|
295
303
|
<svg xmlns="http://www.w3.org/2000/svg" width="6" height="6" viewBox="0 0 6 6" fill="none">
|
|
296
304
|
<path d="M0.6 6L0 5.4L2.4 3L0 0.6L0.6 0L3 2.4L5.4 0L6 0.6L3.6 3L6 5.4L5.4 6L3 3.6L0.6 6Z" fill="#4B4D52" />
|
|
@@ -355,7 +363,7 @@ export class SolidMediaMultipleField implements ISolidField {
|
|
|
355
363
|
<div className="font-bold">{file.name}</div>
|
|
356
364
|
<div
|
|
357
365
|
className="cancel-upload-button"
|
|
358
|
-
onClick={() => confirmDeleteFile(fileId)}
|
|
366
|
+
onClick={() => confirmDeleteFile(fileId, file?.id)}
|
|
359
367
|
>
|
|
360
368
|
<svg xmlns="http://www.w3.org/2000/svg" width="6" height="6" viewBox="0 0 6 6" fill="none">
|
|
361
369
|
<path d="M0.6 6L0 5.4L2.4 3L0 0.6L0.6 0L3 2.4L5.4 0L6 0.6L3.6 3L6 5.4L5.4 6L3 3.6L0.6 6Z" fill="#4B4D52" />
|
|
@@ -78,6 +78,7 @@ export class SolidMediaSingleField implements ISolidField {
|
|
|
78
78
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
79
79
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
80
80
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
81
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
81
82
|
|
|
82
83
|
const [isDeleteImageDialogVisible, setDeleteImageDialogVisible] = useState(false);
|
|
83
84
|
const [imageToBeDeletedData, setImageToBeDeletedData] = useState<any>();
|
|
@@ -115,8 +116,8 @@ export class SolidMediaSingleField implements ISolidField {
|
|
|
115
116
|
};
|
|
116
117
|
const handleCancelUpload = (e: React.MouseEvent) => {
|
|
117
118
|
e.stopPropagation();
|
|
118
|
-
if (imageToBeDeletedData
|
|
119
|
-
deleteMedia(imageToBeDeletedData
|
|
119
|
+
if (imageToBeDeletedData) {
|
|
120
|
+
deleteMedia(imageToBeDeletedData);
|
|
120
121
|
}
|
|
121
122
|
e.stopPropagation();
|
|
122
123
|
setUploadProgress(0);
|
|
@@ -191,7 +192,7 @@ export class SolidMediaSingleField implements ISolidField {
|
|
|
191
192
|
// Set upload progress
|
|
192
193
|
setUploadProgress(100);
|
|
193
194
|
setUploadCompleted(true);
|
|
194
|
-
|
|
195
|
+
setImageToBeDeletedData(fieldValue.id)
|
|
195
196
|
// Ensure Formik has the existing file URL
|
|
196
197
|
formik.setFieldValue(fieldLayoutInfo.attrs.name, fieldValue);
|
|
197
198
|
}
|
|
@@ -230,9 +231,11 @@ export class SolidMediaSingleField implements ISolidField {
|
|
|
230
231
|
return (
|
|
231
232
|
<div className={className}>
|
|
232
233
|
<div className="flex flex-column gap-2 mt-4">
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
{showFieldLabel != false &&
|
|
235
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
236
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
237
|
+
</label>
|
|
238
|
+
}
|
|
236
239
|
<div
|
|
237
240
|
{...getRootProps()}
|
|
238
241
|
className="solid-dropzone-wrapper"
|
|
@@ -61,6 +61,8 @@ export class SolidRichTextField implements ISolidField {
|
|
|
61
61
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
62
62
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
63
63
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
64
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
65
|
+
|
|
64
66
|
const [text, setText] = useState();
|
|
65
67
|
|
|
66
68
|
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
@@ -74,9 +76,11 @@ export class SolidRichTextField implements ISolidField {
|
|
|
74
76
|
return (
|
|
75
77
|
<div className={className}>
|
|
76
78
|
<div className="flex flex-column gap-2 mt-4">
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
{showFieldLabel != false &&
|
|
80
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
81
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
82
|
+
</label>
|
|
83
|
+
}
|
|
80
84
|
<Editor
|
|
81
85
|
readOnly={formReadonly || fieldReadonly}
|
|
82
86
|
disabled={formDisabled || fieldDisabled}
|
|
@@ -55,6 +55,7 @@ export class SolidSelectionDynamicField implements ISolidField {
|
|
|
55
55
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
56
56
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
57
57
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
58
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
58
59
|
|
|
59
60
|
const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
|
|
60
61
|
const fieldReadonly = fieldLayoutInfo.attrs?.readonly;
|
|
@@ -94,9 +95,11 @@ export class SolidSelectionDynamicField implements ISolidField {
|
|
|
94
95
|
return (
|
|
95
96
|
<div className={className}>
|
|
96
97
|
<div className="flex flex-column gap-2 mt-4">
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
{showFieldLabel != false &&
|
|
99
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
100
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
101
|
+
</label>
|
|
102
|
+
}
|
|
100
103
|
<AutoComplete
|
|
101
104
|
readOnly={formReadonly || fieldReadonly}
|
|
102
105
|
disabled={formDisabled || fieldDisabled}
|
|
@@ -76,6 +76,7 @@ export class SolidSelectionStaticField implements ISolidField {
|
|
|
76
76
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
77
77
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
78
78
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
79
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
79
80
|
|
|
80
81
|
const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
|
|
81
82
|
const fieldReadonly = fieldLayoutInfo.attrs?.readonly;
|
|
@@ -99,9 +100,11 @@ export class SolidSelectionStaticField implements ISolidField {
|
|
|
99
100
|
return (
|
|
100
101
|
<div className={className}>
|
|
101
102
|
<div className="flex flex-column gap-2 mt-4">
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
{showFieldLabel != false &&
|
|
104
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
105
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
106
|
+
</label>
|
|
107
|
+
}
|
|
105
108
|
<AutoComplete
|
|
106
109
|
readOnly={formReadonly || fieldReadonly}
|
|
107
110
|
disabled={formDisabled || fieldDisabled}
|
|
@@ -68,6 +68,8 @@ export class SolidShortTextField implements ISolidField {
|
|
|
68
68
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
69
69
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
70
70
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
71
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
72
|
+
|
|
71
73
|
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
72
74
|
|
|
73
75
|
const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
|
|
@@ -79,11 +81,13 @@ export class SolidShortTextField implements ISolidField {
|
|
|
79
81
|
return (
|
|
80
82
|
<div className={className}>
|
|
81
83
|
<div className="flex flex-column gap-2 mt-4">
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
{showFieldLabel != false &&
|
|
85
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
86
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
84
87
|
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
{/* {fieldDescription && <span className="form_field_help_text">`(${fieldDescription})` </span>} */}
|
|
89
|
+
</label>
|
|
90
|
+
}
|
|
87
91
|
<InputText
|
|
88
92
|
readOnly={formReadonly || fieldReadonly}
|
|
89
93
|
disabled={formDisabled || fieldDisabled}
|