@solidstarters/solid-core-ui 1.1.11 → 1.1.12
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/SolidForgotPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidForgotPassword.js +2 -1
- package/dist/components/auth/SolidForgotPassword.js.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.js +2 -1
- package/dist/components/auth/SolidInitialLoginOtp.js.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.js +2 -1
- 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 +2 -1
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidOTPVerify.d.ts.map +1 -1
- package/dist/components/auth/SolidOTPVerify.js +2 -1
- package/dist/components/auth/SolidOTPVerify.js.map +1 -1
- package/dist/components/auth/SolidRegister.d.ts.map +1 -1
- package/dist/components/auth/SolidRegister.js +125 -103
- package/dist/components/auth/SolidRegister.js.map +1 -1
- package/dist/components/auth/SolidResetPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidResetPassword.js +2 -1
- package/dist/components/auth/SolidResetPassword.js.map +1 -1
- package/dist/components/common/DropzonePlaceholder.js +1 -1
- package/dist/components/common/DropzonePlaceholder.js.map +1 -1
- package/dist/components/common/GeneralSettings.d.ts.map +1 -1
- package/dist/components/common/GeneralSettings.js +43 -31
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/core/common/FilterComponent.d.ts +2 -1
- package/dist/components/core/common/FilterComponent.d.ts.map +1 -1
- package/dist/components/core/common/FilterComponent.js +52 -16
- package/dist/components/core/common/FilterComponent.js.map +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.d.ts +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.js +5 -2
- 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 +131 -23
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/filter/SolidManyToOneFilterElement.d.ts.map +1 -1
- package/dist/components/core/filter/SolidManyToOneFilterElement.js +1 -1
- package/dist/components/core/filter/SolidManyToOneFilterElement.js.map +1 -1
- package/dist/components/core/filter/SolidSelectionDynamicFilterElement.js +1 -1
- package/dist/components/core/filter/SolidSelectionDynamicFilterElement.js.map +1 -1
- package/dist/components/core/filter/SolidSelectionStaticFilterElement.js +1 -1
- package/dist/components/core/filter/SolidSelectionStaticFilterElement.js.map +1 -1
- package/dist/components/core/filter/SolidVarInputsFilterElement.d.ts.map +1 -1
- package/dist/components/core/filter/SolidVarInputsFilterElement.js +11 -10
- package/dist/components/core/filter/SolidVarInputsFilterElement.js.map +1 -1
- package/dist/components/core/filter/columns/SolidBigintField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidBigintField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidBigintField.js +8 -0
- package/dist/components/core/filter/columns/SolidBigintField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidBooleanField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidBooleanField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidBooleanField.js +27 -0
- package/dist/components/core/filter/columns/SolidBooleanField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidComputedField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidComputedField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidComputedField.js +22 -0
- package/dist/components/core/filter/columns/SolidComputedField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidDateField.d.ts +9 -0
- package/dist/components/core/filter/columns/SolidDateField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidDateField.js +35 -0
- package/dist/components/core/filter/columns/SolidDateField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.js +24 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidDecimalField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidDecimalField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidDecimalField.js +8 -0
- package/dist/components/core/filter/columns/SolidDecimalField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.js +25 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidFloatField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidFloatField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidFloatField.js +8 -0
- package/dist/components/core/filter/columns/SolidFloatField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidIdField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidIdField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidIdField.js +25 -0
- package/dist/components/core/filter/columns/SolidIdField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidIntField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidIntField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidIntField.js +34 -0
- package/dist/components/core/filter/columns/SolidIntField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidLongTextField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidLongTextField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidLongTextField.js +8 -0
- package/dist/components/core/filter/columns/SolidLongTextField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.js +35 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.js +35 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidRelationField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidRelationField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidRelationField.js +12 -0
- package/dist/components/core/filter/columns/SolidRelationField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidRichTextField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidRichTextField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidRichTextField.js +8 -0
- package/dist/components/core/filter/columns/SolidRichTextField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.js +25 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.js +26 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidShortTextField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidShortTextField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidShortTextField.js +33 -0
- package/dist/components/core/filter/columns/SolidShortTextField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidTimeField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidTimeField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidTimeField.js +24 -0
- package/dist/components/core/filter/columns/SolidTimeField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidUuidField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidUuidField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidUuidField.js +25 -0
- package/dist/components/core/filter/columns/SolidUuidField.js.map +1 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.d.ts +4 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.js +54 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.js.map +1 -0
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +18 -9
- 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 +4 -4
- package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.js +7 -7
- 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 -7
- 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 +4 -4
- 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 +4 -4
- 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 +2 -2
- 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 +2 -2
- 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 +155 -46
- 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 +87 -31
- 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 +2 -2
- 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 +4 -4
- 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 +4 -4
- 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 +2 -2
- 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 -7
- package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +2 -2
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +2 -2
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +2 -2
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +57 -54
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/model/CreateModel.d.ts.map +1 -1
- package/dist/components/core/model/CreateModel.js +20 -16
- package/dist/components/core/model/CreateModel.js.map +1 -1
- package/dist/components/core/module/CreateModule.d.ts.map +1 -1
- package/dist/components/core/module/CreateModule.js +23 -23
- package/dist/components/core/module/CreateModule.js.map +1 -1
- package/dist/components/layout/AppSidebar.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.js +42 -11
- package/dist/components/layout/AppSidebar.js.map +1 -1
- package/dist/components/layout/navbar-two-menu.d.ts.map +1 -1
- package/dist/components/layout/navbar-two-menu.js +6 -2
- package/dist/components/layout/navbar-two-menu.js.map +1 -1
- package/dist/components/layout/user-profile-menu.d.ts.map +1 -1
- package/dist/components/layout/user-profile-menu.js +7 -3
- package/dist/components/layout/user-profile-menu.js.map +1 -1
- package/dist/helpers/AppTitle.d.ts +4 -0
- package/dist/helpers/AppTitle.d.ts.map +1 -0
- package/dist/helpers/AppTitle.js +8 -0
- package/dist/helpers/AppTitle.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/auth/SolidForgotPassword.tsx +2 -6
- package/src/components/auth/SolidInitialLoginOtp.tsx +2 -6
- package/src/components/auth/SolidInitiateRegisterOtp.tsx +2 -6
- package/src/components/auth/SolidLogin.tsx +2 -5
- package/src/components/auth/SolidOTPVerify.tsx +4 -7
- package/src/components/auth/SolidRegister.tsx +207 -178
- package/src/components/auth/SolidResetPassword.tsx +2 -6
- package/src/components/common/DropzonePlaceholder.tsx +1 -1
- package/src/components/common/GeneralSettings.tsx +310 -193
- package/src/components/core/common/FilterComponent.tsx +148 -202
- package/src/components/core/common/SolidConfigureLayoutElement.tsx +6 -4
- package/src/components/core/common/SolidGlobalSearchElement.tsx +193 -50
- package/src/components/core/filter/SolidManyToOneFilterElement.tsx +3 -1
- package/src/components/core/filter/SolidSelectionDynamicFilterElement.tsx +1 -1
- package/src/components/core/filter/SolidSelectionStaticFilterElement.tsx +1 -1
- package/src/components/core/filter/SolidVarInputsFilterElement.tsx +103 -135
- package/src/components/core/form/SolidFormView.tsx +32 -21
- package/src/components/core/form/fields/SolidBooleanField.tsx +8 -6
- package/src/components/core/form/fields/SolidDateField.tsx +5 -5
- package/src/components/core/form/fields/SolidDateTimeField.tsx +23 -22
- package/src/components/core/form/fields/SolidDecimalField.tsx +5 -3
- package/src/components/core/form/fields/SolidIntegerField.tsx +18 -16
- package/src/components/core/form/fields/SolidJsonField.tsx +14 -12
- package/src/components/core/form/fields/SolidLongTextField.tsx +18 -17
- package/src/components/core/form/fields/SolidMediaMultipleField.tsx +257 -79
- package/src/components/core/form/fields/SolidMediaSingleField.tsx +148 -61
- package/src/components/core/form/fields/SolidRichTextField.tsx +6 -4
- package/src/components/core/form/fields/SolidSelectionDynamicField.tsx +6 -5
- package/src/components/core/form/fields/SolidSelectionStaticField.tsx +24 -23
- package/src/components/core/form/fields/SolidShortTextField.tsx +19 -17
- package/src/components/core/form/fields/SolidTimeField.tsx +23 -21
- package/src/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +2 -2
- package/src/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +17 -16
- package/src/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +2 -2
- package/src/components/core/list/SolidListView.tsx +59 -42
- package/src/components/core/model/CreateModel.tsx +92 -81
- package/src/components/core/module/CreateModule.tsx +181 -183
- package/src/components/layout/AppSidebar.tsx +35 -10
- package/src/components/layout/navbar-two-menu.tsx +6 -1
- package/src/components/layout/user-profile-menu.tsx +20 -8
- package/src/helpers/AppTitle.tsx +14 -0
- package/src/index.ts +2 -1
- package/dist/components/core/extension/dynamicComponentMap.d.ts +0 -3
- package/dist/components/core/extension/dynamicComponentMap.d.ts.map +0 -1
- package/dist/components/core/extension/dynamicComponentMap.js +0 -6
- package/dist/components/core/extension/dynamicComponentMap.js.map +0 -1
- package/dist/components/core/hooks/GlobalStateContext.d.ts +0 -11
- package/dist/components/core/hooks/GlobalStateContext.d.ts.map +0 -1
- package/dist/components/core/hooks/GlobalStateContext.js +0 -17
- package/dist/components/core/hooks/GlobalStateContext.js.map +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { DropzonePlaceholder } from "@/components/common/DropzonePlaceholder";
|
|
3
|
-
import { DropzoneUpload } from "@/components/common/DropzoneUpload";
|
|
4
3
|
import { useDeleteMediaMutation } from "@/redux/api/mediaApi";
|
|
5
4
|
import { Button } from "primereact/button";
|
|
6
5
|
import { Dialog } from "primereact/dialog";
|
|
@@ -10,7 +9,8 @@ import { useDropzone } from "react-dropzone";
|
|
|
10
9
|
import * as Yup from 'yup';
|
|
11
10
|
import { Schema } from "yup";
|
|
12
11
|
import { FormikObject, ISolidField, SolidFieldProps } from "./ISolidField";
|
|
13
|
-
|
|
12
|
+
import { FileReaderExt } from "@/components/common/FileReaderExt";
|
|
13
|
+
import { ProgressBar } from "primereact/progressbar";
|
|
14
14
|
export class SolidMediaSingleField implements ISolidField {
|
|
15
15
|
|
|
16
16
|
private fieldContext: SolidFieldProps;
|
|
@@ -74,7 +74,7 @@ export class SolidMediaSingleField implements ISolidField {
|
|
|
74
74
|
render(formik: FormikObject) {
|
|
75
75
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
76
76
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
77
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
77
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
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;
|
|
@@ -82,6 +82,17 @@ export class SolidMediaSingleField implements ISolidField {
|
|
|
82
82
|
const [isDeleteImageDialogVisible, setDeleteImageDialogVisible] = useState(false);
|
|
83
83
|
const [imageToBeDeletedData, setImageToBeDeletedData] = useState<any>();
|
|
84
84
|
const [imagesPreview, setImagesPreview] = useState<string | ArrayBuffer | null>(null);
|
|
85
|
+
const [uploadProgress, setUploadProgress] = useState<number>(0);
|
|
86
|
+
const [uploadCompleted, setUploadCompleted] = useState<boolean>(false);
|
|
87
|
+
const [fileDetails, setFileDetails] = useState<{ name: string; type: string } | null>(null);
|
|
88
|
+
const [uploadedSize, setUploadedSize] = useState<string>("0 MB");
|
|
89
|
+
const [totalSize, setTotalSize] = useState<string>("0 KB");
|
|
90
|
+
|
|
91
|
+
const formatFileSize = (size: number) => {
|
|
92
|
+
return size >= 1024 * 1024
|
|
93
|
+
? `${(size / (1024 * 1024)).toFixed(1)} MB`
|
|
94
|
+
: `${(size / 1024).toFixed(1)} KB`;
|
|
95
|
+
};
|
|
85
96
|
|
|
86
97
|
const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
|
|
87
98
|
const fieldReadonly = fieldLayoutInfo.attrs?.readonly;
|
|
@@ -102,30 +113,92 @@ export class SolidMediaSingleField implements ISolidField {
|
|
|
102
113
|
formik.setFieldValue(fieldLayoutInfo.attrs.name, null);
|
|
103
114
|
setDeleteImageDialogVisible(false);
|
|
104
115
|
};
|
|
116
|
+
const handleCancelUpload = (e: React.MouseEvent) => {
|
|
117
|
+
e.stopPropagation();
|
|
118
|
+
if (imageToBeDeletedData?.imagesPreview.id) {
|
|
119
|
+
deleteMedia(imageToBeDeletedData.imagesPreview.id);
|
|
120
|
+
}
|
|
121
|
+
e.stopPropagation();
|
|
122
|
+
setUploadProgress(0);
|
|
123
|
+
setUploadCompleted(false);
|
|
124
|
+
setFileDetails(null);
|
|
125
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, null);
|
|
126
|
+
setDeleteImageDialogVisible(false);
|
|
127
|
+
};
|
|
105
128
|
|
|
106
129
|
const handleDropImage = (acceptedFiles: File[]) => {
|
|
130
|
+
// const file = acceptedFiles[0];
|
|
131
|
+
// if (file) {
|
|
132
|
+
// formik.setFieldValue(fieldLayoutInfo.attrs.name, file);
|
|
133
|
+
// } else {
|
|
134
|
+
// console.error("No file was accepted");
|
|
135
|
+
// }
|
|
107
136
|
const file = acceptedFiles[0];
|
|
108
|
-
if (file)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
137
|
+
if (!file) return;
|
|
138
|
+
|
|
139
|
+
setUploadCompleted(false);
|
|
140
|
+
setUploadProgress(0);
|
|
141
|
+
setTotalSize(formatFileSize(file.size));
|
|
142
|
+
setUploadedSize("0 KB");
|
|
143
|
+
setFileDetails({ name: file.name, type: file.type });
|
|
144
|
+
|
|
145
|
+
const reader = new FileReader();
|
|
146
|
+
|
|
147
|
+
reader.onloadstart = () => {
|
|
148
|
+
setUploadProgress(0);
|
|
149
|
+
setUploadedSize("0 KB");
|
|
150
|
+
};
|
|
151
|
+
reader.onprogress = (event) => {
|
|
152
|
+
if (event.loaded && event.total) {
|
|
153
|
+
const percent = Math.round((event.loaded / event.total) * 100);
|
|
154
|
+
setUploadProgress(percent);
|
|
155
|
+
setUploadedSize(formatFileSize(event.loaded));
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
reader.onloadend = () => {
|
|
160
|
+
setUploadProgress(100);
|
|
161
|
+
setUploadCompleted(true);
|
|
162
|
+
setUploadedSize(totalSize); // Set uploaded size to total size after completion
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
reader.readAsDataURL(file);
|
|
166
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, file);
|
|
113
167
|
};
|
|
114
168
|
|
|
169
|
+
// useEffect(() => {
|
|
170
|
+
// const fieldValue = formik?.values[fieldLayoutInfo.attrs.name];
|
|
171
|
+
|
|
172
|
+
// if (fieldValue instanceof File) {
|
|
173
|
+
// setImagesPreview(URL.createObjectURL(fieldValue)); // Generate preview URL for file
|
|
174
|
+
// }
|
|
175
|
+
// if (typeof fieldValue === 'object') {
|
|
176
|
+
// setImagesPreview(fieldValue); // Generate preview URL for file
|
|
177
|
+
// }
|
|
178
|
+
// if (!fieldValue) {
|
|
179
|
+
// setImagesPreview(null);
|
|
180
|
+
// }
|
|
181
|
+
// }, [formik.values, fieldLayoutInfo.attrs.name]);
|
|
115
182
|
useEffect(() => {
|
|
116
183
|
const fieldValue = formik?.values[fieldLayoutInfo.attrs.name];
|
|
117
184
|
|
|
118
|
-
if (fieldValue
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
185
|
+
if (fieldValue && typeof fieldValue === "object") {
|
|
186
|
+
const fileUrl = fieldValue._full_url;
|
|
187
|
+
if (typeof fileUrl === "string" && fileUrl.length > 0) {
|
|
188
|
+
const fileName = fileUrl.split("/").pop(); // Extract filename from URL
|
|
189
|
+
setFileDetails({ name: fileName || "Unknown File", type: "Uploaded File" });
|
|
190
|
+
|
|
191
|
+
// Set upload progress
|
|
192
|
+
setUploadProgress(100);
|
|
193
|
+
setUploadCompleted(true);
|
|
194
|
+
|
|
195
|
+
// Ensure Formik has the existing file URL
|
|
196
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, fieldValue);
|
|
197
|
+
}
|
|
126
198
|
}
|
|
127
199
|
}, [formik.values, fieldLayoutInfo.attrs.name]);
|
|
128
200
|
|
|
201
|
+
|
|
129
202
|
const {
|
|
130
203
|
getRootProps: getRootProps,
|
|
131
204
|
getInputProps: getInputProps,
|
|
@@ -156,61 +229,75 @@ export class SolidMediaSingleField implements ISolidField {
|
|
|
156
229
|
|
|
157
230
|
return (
|
|
158
231
|
<div className={className}>
|
|
159
|
-
<
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
{isDragActive ? (
|
|
232
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
233
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
234
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
235
|
+
</label>
|
|
236
|
+
<div
|
|
237
|
+
{...getRootProps()}
|
|
238
|
+
className="solid-dropzone-wrapper"
|
|
239
|
+
>
|
|
240
|
+
<input {...getInputProps()} />
|
|
169
241
|
<DropzonePlaceholder />
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
242
|
+
</div>
|
|
243
|
+
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
244
|
+
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
245
|
+
)}
|
|
246
|
+
{fileDetails && (
|
|
247
|
+
<div className="solid-file-upload-wrapper">
|
|
248
|
+
<div className="flex align-items-center gap-2">
|
|
249
|
+
<FileReaderExt fileDetails={fileDetails} />
|
|
250
|
+
<div className="w-full flex flex-column gap-1">
|
|
251
|
+
<div className="flex align-items-center justify-content-between">
|
|
252
|
+
<div className="font-bold">{fileDetails.name}</div>
|
|
253
|
+
<div className="cancel-upload-button" onClick={() => setDeleteImageDialogVisible(true)}>
|
|
254
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="6" height="6" viewBox="0 0 6 6" fill="none">
|
|
255
|
+
<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" />
|
|
256
|
+
</svg>
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
{
|
|
260
|
+
uploadCompleted ?
|
|
261
|
+
<div className="flex align-items-center gap-2 text-sm">
|
|
262
|
+
{totalSize} of {totalSize}
|
|
263
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4" viewBox="0 0 4 4" fill="none">
|
|
264
|
+
<circle cx="2" cy="2" r="2" fill="#C1C1C1" />
|
|
265
|
+
</svg>
|
|
266
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
267
|
+
<mask id="mask0_2480_8635" style={{ maskType: 'alpha' }} maskUnits="userSpaceOnUse" x="0" y="0" width="20" height="20">
|
|
268
|
+
<rect width="20" height="20" fill="#D9D9D9" />
|
|
269
|
+
</mask>
|
|
270
|
+
<g mask="url(#mask0_2480_8635)">
|
|
271
|
+
<path d="M9.16 12.76L13.39 8.53L12.55 7.69L9.16 11.08L7.45 9.37L6.61 10.21L9.16 12.76ZM10 16C9.17 16 8.39 15.8424 7.66 15.5272C6.93 15.2124 6.295 14.785 5.755 14.245C5.215 13.705 4.7876 13.07 4.4728 12.34C4.1576 11.61 4 10.83 4 10C4 9.17 4.1576 8.39 4.4728 7.66C4.7876 6.93 5.215 6.295 5.755 5.755C6.295 5.215 6.93 4.7874 7.66 4.4722C8.39 4.1574 9.17 4 10 4C10.83 4 11.61 4.1574 12.34 4.4722C13.07 4.7874 13.705 5.215 14.245 5.755C14.785 6.295 15.2124 6.93 15.5272 7.66C15.8424 8.39 16 9.17 16 10C16 10.83 15.8424 11.61 15.5272 12.34C15.2124 13.07 14.785 13.705 14.245 14.245C13.705 14.785 13.07 15.2124 12.34 15.5272C11.61 15.8424 10.83 16 10 16Z" fill="#722ED1" />
|
|
272
|
+
</g>
|
|
273
|
+
</svg>
|
|
274
|
+
Completed
|
|
275
|
+
</div>
|
|
276
|
+
:
|
|
277
|
+
<div className="flex align-items-center gap-2 text-sm">
|
|
278
|
+
{uploadedSize} of {totalSize}
|
|
279
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4" viewBox="0 0 4 4" fill="none">
|
|
280
|
+
<circle cx="2" cy="2" r="2" fill="#C1C1C1" />
|
|
281
|
+
</svg>
|
|
282
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
283
|
+
<path d="M7.375 10.5V5.40625L5.75 7.03125L4.875 6.125L8 3L11.125 6.125L10.25 7.03125L8.625 5.40625V10.5H7.375ZM4.25 13C3.90625 13 3.61198 12.8776 3.36719 12.6328C3.1224 12.388 3 12.0938 3 11.75V9.875H4.25V11.75H11.75V9.875H13V11.75C13 12.0938 12.8776 12.388 12.6328 12.6328C12.388 12.8776 12.0938 13 11.75 13H4.25Z" fill="black" />
|
|
284
|
+
</svg>
|
|
285
|
+
Uploading ${uploadProgress}% Completed
|
|
286
|
+
</div>
|
|
184
287
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
severity="secondary"
|
|
189
|
-
outlined
|
|
190
|
-
aria-label="Bookmark"
|
|
191
|
-
className="absolute right-0 top-0 bg-white z-5 m-2"
|
|
192
|
-
style={{
|
|
193
|
-
height: 25,
|
|
194
|
-
width: 25,
|
|
195
|
-
}}
|
|
196
|
-
/>
|
|
197
|
-
<DropzoneUpload />
|
|
288
|
+
</div>
|
|
289
|
+
</div>
|
|
290
|
+
<ProgressBar value={uploadProgress} showValue={false} style={{ height: 4 }} className="mt-2" />
|
|
198
291
|
</div>
|
|
199
|
-
) : (
|
|
200
|
-
<DropzonePlaceholder />
|
|
201
292
|
)}
|
|
202
|
-
{ }
|
|
203
293
|
</div>
|
|
204
|
-
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
205
|
-
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
206
|
-
)}
|
|
207
294
|
<Dialog
|
|
208
295
|
visible={isDeleteImageDialogVisible}
|
|
209
296
|
header="Confirm Delete"
|
|
210
297
|
modal
|
|
211
298
|
footer={() => (
|
|
212
299
|
<div className="flex justify-content-center">
|
|
213
|
-
<Button label="Yes" icon="pi pi-check" className='small-button' severity="danger" autoFocus onClick={
|
|
300
|
+
<Button label="Yes" icon="pi pi-check" className='small-button' severity="danger" autoFocus onClick={handleCancelUpload} />
|
|
214
301
|
<Button label="No" icon="pi pi-times" className='small-button' onClick={() => setDeleteImageDialogVisible(false)} />
|
|
215
302
|
</div>
|
|
216
303
|
)}
|
|
@@ -221,4 +308,4 @@ export class SolidMediaSingleField implements ISolidField {
|
|
|
221
308
|
</div>
|
|
222
309
|
);
|
|
223
310
|
}
|
|
224
|
-
}
|
|
311
|
+
}
|
|
@@ -57,7 +57,7 @@ export class SolidRichTextField implements ISolidField {
|
|
|
57
57
|
render(formik: FormikObject) {
|
|
58
58
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
59
59
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
60
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
60
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
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;
|
|
@@ -73,6 +73,7 @@ export class SolidRichTextField implements ISolidField {
|
|
|
73
73
|
|
|
74
74
|
return (
|
|
75
75
|
<div className={className}>
|
|
76
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
76
77
|
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
77
78
|
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
78
79
|
</label>
|
|
@@ -85,9 +86,10 @@ export class SolidRichTextField implements ISolidField {
|
|
|
85
86
|
onTextChange={e => formik.setFieldValue(fieldLayoutInfo.attrs.name, e.htmlValue)}
|
|
86
87
|
style={{ height: "320px" }}
|
|
87
88
|
/>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
)}
|
|
89
|
+
</div>
|
|
90
|
+
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
91
|
+
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
92
|
+
)}
|
|
91
93
|
</div>
|
|
92
94
|
);
|
|
93
95
|
}
|
|
@@ -51,7 +51,7 @@ export class SolidSelectionDynamicField implements ISolidField {
|
|
|
51
51
|
render(formik: FormikObject) {
|
|
52
52
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
53
53
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
54
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
54
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
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;
|
|
@@ -93,8 +93,8 @@ export class SolidSelectionDynamicField implements ISolidField {
|
|
|
93
93
|
|
|
94
94
|
return (
|
|
95
95
|
<div className={className}>
|
|
96
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
96
97
|
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
97
|
-
|
|
98
98
|
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
99
99
|
</label>
|
|
100
100
|
<AutoComplete
|
|
@@ -109,9 +109,10 @@ export class SolidSelectionDynamicField implements ISolidField {
|
|
|
109
109
|
completeMethod={selectionDynamicSearch}
|
|
110
110
|
// onChange={(e) => updateInputs(index, e.value)} />
|
|
111
111
|
onChange={formik.handleChange} />
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
)}
|
|
112
|
+
</div>
|
|
113
|
+
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
114
|
+
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
115
|
+
)}
|
|
115
116
|
</div>
|
|
116
117
|
);
|
|
117
118
|
}
|
|
@@ -26,10 +26,10 @@ export class SolidSelectionStaticField implements ISolidField {
|
|
|
26
26
|
const fieldName = this.fieldContext.field.attrs.name;
|
|
27
27
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
28
28
|
const fieldDefaultValue = fieldMetadata?.defaultValue;
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
// Get existing value from form data
|
|
31
31
|
const existingValue = this.fieldContext.data[fieldName];
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
// Function to get display value based on selectionStaticValues
|
|
34
34
|
const getDisplayValue = (value: string | null): string | null => {
|
|
35
35
|
if (!value) return null;
|
|
@@ -41,16 +41,16 @@ export class SolidSelectionStaticField implements ISolidField {
|
|
|
41
41
|
}
|
|
42
42
|
return null;
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
// Determine the final value to use (existing value or default value)
|
|
46
46
|
const finalValue = existingValue ?? fieldDefaultValue ?? '';
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
// Get display value for the final value
|
|
49
49
|
const displayValue = getDisplayValue(finalValue);
|
|
50
|
-
|
|
50
|
+
|
|
51
51
|
return { label: displayValue ?? '', value: finalValue };
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
|
|
55
55
|
validationSchema(): Schema {
|
|
56
56
|
|
|
@@ -72,7 +72,7 @@ export class SolidSelectionStaticField implements ISolidField {
|
|
|
72
72
|
render(formik: FormikObject) {
|
|
73
73
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
74
74
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
75
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
75
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
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;
|
|
@@ -98,22 +98,23 @@ export class SolidSelectionStaticField implements ISolidField {
|
|
|
98
98
|
|
|
99
99
|
return (
|
|
100
100
|
<div className={className}>
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
101
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
102
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
103
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
104
|
+
</label>
|
|
105
|
+
<AutoComplete
|
|
106
|
+
readOnly={formReadonly || fieldReadonly}
|
|
107
|
+
disabled={formDisabled || fieldDisabled}
|
|
108
|
+
{...formik.getFieldProps(fieldLayoutInfo.attrs.name)}
|
|
109
|
+
id={fieldLayoutInfo.attrs.name}
|
|
110
|
+
field="label"
|
|
111
|
+
value={formik.values[fieldLayoutInfo.attrs.name] || ''}
|
|
112
|
+
dropdown
|
|
113
|
+
suggestions={selectionStaticItems}
|
|
114
|
+
completeMethod={selectionStaticSearch}
|
|
115
|
+
// onChange={(e) => updateInputs(index, e.value)} />
|
|
116
|
+
onChange={formik.handleChange} />
|
|
117
|
+
</div>
|
|
117
118
|
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
118
119
|
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
119
120
|
)}
|
|
@@ -23,12 +23,12 @@ export class SolidShortTextField implements ISolidField {
|
|
|
23
23
|
initialValue(): any {
|
|
24
24
|
const fieldName = this.fieldContext.field.attrs.name;
|
|
25
25
|
const fieldDefaultValue = this.fieldContext?.fieldMetadata?.defaultValue;
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
const existingValue = this.fieldContext.data[fieldName];
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
return existingValue !== undefined && existingValue !== null ? existingValue : fieldDefaultValue || '';
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
|
|
33
33
|
validationSchema(): Schema {
|
|
34
34
|
let schema: Yup.StringSchema<string | null | undefined> = Yup.string();
|
|
@@ -64,7 +64,7 @@ export class SolidShortTextField implements ISolidField {
|
|
|
64
64
|
render(formik: FormikObject) {
|
|
65
65
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
66
66
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
67
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
67
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
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;
|
|
@@ -78,19 +78,21 @@ export class SolidShortTextField implements ISolidField {
|
|
|
78
78
|
|
|
79
79
|
return (
|
|
80
80
|
<div className={className}>
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
82
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
83
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
84
|
+
|
|
85
|
+
{/* {fieldDescription && <span className="form_field_help_text">`(${fieldDescription})` </span>} */}
|
|
86
|
+
</label>
|
|
87
|
+
<InputText
|
|
88
|
+
readOnly={formReadonly || fieldReadonly}
|
|
89
|
+
disabled={formDisabled || fieldDisabled}
|
|
90
|
+
id={fieldLayoutInfo.attrs.name}
|
|
91
|
+
aria-describedby={`${fieldLayoutInfo.attrs.name}-help`}
|
|
92
|
+
onChange={formik.handleChange}
|
|
93
|
+
value={formik.values[fieldLayoutInfo.attrs.name] || ''}
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
94
96
|
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
95
97
|
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
96
98
|
)}
|
|
@@ -24,9 +24,9 @@ export class SolidTimeField implements ISolidField {
|
|
|
24
24
|
initialValue(): any {
|
|
25
25
|
const fieldName = this.fieldContext.field.attrs.name;
|
|
26
26
|
const fieldDefaultValue = this.fieldContext?.fieldMetadata?.defaultValue;
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
const existingValue = this.fieldContext.data[fieldName];
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
return existingValue !== undefined && existingValue !== null ? existingValue : fieldDefaultValue || '';
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -46,7 +46,7 @@ export class SolidTimeField implements ISolidField {
|
|
|
46
46
|
render(formik: FormikObject) {
|
|
47
47
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
48
48
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
49
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
49
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
50
50
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
51
51
|
const calendarRef = useRef<any>(null); // Reference for the Calendar component
|
|
52
52
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
@@ -59,26 +59,28 @@ export class SolidTimeField implements ISolidField {
|
|
|
59
59
|
|
|
60
60
|
return (
|
|
61
61
|
<div className={className}>
|
|
62
|
-
<
|
|
62
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
63
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
63
64
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
65
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
66
|
+
</label>
|
|
67
|
+
<Calendar
|
|
68
|
+
disabled={formDisabled || fieldDisabled}
|
|
69
|
+
ref={calendarRef} // Attach ref to Calendar
|
|
70
|
+
id={fieldLayoutInfo.attrs.name}
|
|
71
|
+
aria-describedby={`${fieldLayoutInfo.attrs.name}-help`}
|
|
72
|
+
onChange={formik.handleChange}
|
|
73
|
+
//@ts-ignore
|
|
74
|
+
value={formik.values[fieldLayoutInfo.attrs.name] ? formik.values[fieldLayoutInfo.attrs.name] : Date()}
|
|
75
|
+
// dateFormat="mm/dd/yy"
|
|
76
|
+
// placeholder="mm/dd/yyyy hh:mm"
|
|
77
|
+
hideOnDateTimeSelect
|
|
78
|
+
timeOnly
|
|
79
|
+
showTime className=""
|
|
80
|
+
hourFormat="24"
|
|
80
81
|
|
|
81
|
-
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
82
84
|
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
83
85
|
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
84
86
|
)}
|
|
@@ -97,7 +97,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
97
97
|
render(formik: FormikObject) {
|
|
98
98
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
99
99
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
100
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
100
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
101
101
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
102
102
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
103
103
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
@@ -134,7 +134,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
134
134
|
renderCheckBoxMode(formik: FormikObject, visibleCreateRelationEntity: any, setvisibleCreateRelationEntity: any) {
|
|
135
135
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
136
136
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
137
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
137
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
138
138
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
139
139
|
|
|
140
140
|
// auto complete specific code.
|
|
@@ -54,7 +54,7 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
54
54
|
render(formik: FormikObject) {
|
|
55
55
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
56
56
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
57
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
57
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
58
58
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
59
59
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
60
60
|
|
|
@@ -109,21 +109,22 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
109
109
|
|
|
110
110
|
return (
|
|
111
111
|
<div className={className}>
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
112
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
113
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
114
|
+
</label>
|
|
115
|
+
<AutoComplete
|
|
116
|
+
readOnly={formReadonly || fieldReadonly}
|
|
117
|
+
disabled={formDisabled || fieldDisabled}
|
|
118
|
+
{...formik.getFieldProps(fieldLayoutInfo.attrs.name)}
|
|
119
|
+
id={fieldLayoutInfo.attrs.name}
|
|
120
|
+
field="label"
|
|
121
|
+
value={formik.values[fieldLayoutInfo.attrs.name] || ''}
|
|
122
|
+
dropdown
|
|
123
|
+
suggestions={autoCompleteItems}
|
|
124
|
+
completeMethod={autoCompleteSearch}
|
|
125
|
+
onChange={formik.handleChange}
|
|
126
|
+
/>
|
|
127
|
+
</div>
|
|
127
128
|
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
128
129
|
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
129
130
|
)}
|