@solidstarters/solid-core-ui 1.1.17 → 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/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/core/common/SolidGlobalSearchElement.js +3 -3
- package/dist/components/core/common/SolidGlobalSearchElement.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 +18 -16
- 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 +19 -17
- 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 +15 -11
- 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/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +42 -34
- 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/FieldMetaData.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaData.js +54 -1
- 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 +118 -51
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/module/CreateModule.js +2 -1
- package/dist/components/core/module/CreateModule.js.map +1 -1
- 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/common/SingleSelectAutoCompleteField.tsx +3 -1
- package/src/components/core/common/SolidGlobalSearchElement.tsx +3 -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 +6 -3
- package/src/components/core/form/fields/SolidMediaSingleField.tsx +6 -3
- 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 +29 -25
- package/src/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +92 -2
- package/src/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +5 -1
- package/src/components/core/list/SolidListView.tsx +12 -3
- 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/FieldMetaData.tsx +25 -1
- package/src/components/core/model/FieldMetaDataForm.tsx +108 -18
- package/src/components/core/module/CreateModule.tsx +1 -1
- package/src/redux/api/modelApi.ts +9 -2
|
@@ -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,6 +93,7 @@ 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);
|
|
@@ -274,10 +275,12 @@ export class SolidMediaMultipleField implements ISolidField {
|
|
|
274
275
|
return (
|
|
275
276
|
<div className={className}>
|
|
276
277
|
<div className="flex flex-column gap-2 mt-4">
|
|
277
|
-
|
|
278
|
+
{showFieldLabel != false &&
|
|
279
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
278
280
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
282
|
+
</label>
|
|
283
|
+
}
|
|
281
284
|
<div
|
|
282
285
|
{...getRootProps()}
|
|
283
286
|
className="solid-dropzone-wrapper"
|
|
@@ -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>();
|
|
@@ -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}
|
|
@@ -51,7 +51,8 @@ export class SolidTimeField 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
|
-
|
|
54
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
55
|
+
|
|
55
56
|
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
56
57
|
|
|
57
58
|
const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
|
|
@@ -60,10 +61,12 @@ export class SolidTimeField implements ISolidField {
|
|
|
60
61
|
return (
|
|
61
62
|
<div className={className}>
|
|
62
63
|
<div className="flex flex-column gap-2 mt-4">
|
|
63
|
-
|
|
64
|
+
{showFieldLabel != false &&
|
|
65
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
68
|
+
</label>
|
|
69
|
+
}
|
|
67
70
|
<Calendar
|
|
68
71
|
disabled={formDisabled || fieldDisabled}
|
|
69
72
|
ref={calendarRef} // Attach ref to Calendar
|
|
@@ -136,6 +136,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
136
136
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
137
137
|
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
138
138
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
139
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
139
140
|
|
|
140
141
|
// auto complete specific code.
|
|
141
142
|
const entityApi = createSolidEntityApi(fieldMetadata.relationModelSingularName);
|
|
@@ -235,9 +236,11 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
235
236
|
return (
|
|
236
237
|
<div className={className}>
|
|
237
238
|
<div className="flex align-items-center gap-3">
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
{showFieldLabel != false &&
|
|
240
|
+
<label className="form-field-label">
|
|
241
|
+
{capitalize(fieldLayoutInfo.attrs.name)}
|
|
242
|
+
</label>
|
|
243
|
+
}
|
|
241
244
|
{fieldLayoutInfo.attrs.inlineCreate === "true" &&
|
|
242
245
|
this.renderSolidFormEmbededView(formik, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
|
|
243
246
|
}
|
|
@@ -291,6 +294,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
291
294
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
292
295
|
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
293
296
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
297
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
294
298
|
|
|
295
299
|
// auto complete specific code.
|
|
296
300
|
const entityApi = createSolidEntityApi(fieldMetadata.relationModelSingularName);
|
|
@@ -358,29 +362,29 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
358
362
|
|
|
359
363
|
return (
|
|
360
364
|
<div className={className}>
|
|
361
|
-
|
|
362
|
-
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">
|
|
363
|
-
|
|
365
|
+
{showFieldLabel != false &&
|
|
366
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">
|
|
367
|
+
{fieldLabel}
|
|
364
368
|
</label>
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
369
|
+
}
|
|
370
|
+
<div className="flex align-items-center gap-3">
|
|
371
|
+
<AutoComplete
|
|
372
|
+
readOnly={readOnly}
|
|
373
|
+
disabled={disabled}
|
|
374
|
+
multiple
|
|
375
|
+
{...formik.getFieldProps(fieldLayoutInfo.attrs.name)}
|
|
376
|
+
id={fieldLayoutInfo.attrs.name}
|
|
377
|
+
field="label"
|
|
378
|
+
value={formik.values[fieldLayoutInfo.attrs.name] || ''}
|
|
379
|
+
dropdown
|
|
380
|
+
suggestions={autoCompleteItems}
|
|
381
|
+
completeMethod={autoCompleteSearch}
|
|
382
|
+
onChange={formik.handleChange}
|
|
383
|
+
className="solid-standard-autocomplete w-full"
|
|
384
|
+
/>
|
|
385
|
+
{fieldLayoutInfo.attrs.inlineCreate === "true" &&
|
|
386
|
+
this.renderSolidFormEmbededView(formik, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
|
|
387
|
+
}
|
|
384
388
|
</div>
|
|
385
389
|
</div>
|
|
386
390
|
);
|
|
@@ -7,6 +7,12 @@ import { useState } from "react";
|
|
|
7
7
|
import * as Yup from 'yup';
|
|
8
8
|
import { Schema } from "yup";
|
|
9
9
|
import { FormikObject, ISolidField, SolidFieldProps } from "../ISolidField";
|
|
10
|
+
import { camelCase, capitalize } from "lodash";
|
|
11
|
+
import { Button } from "primereact/button";
|
|
12
|
+
import { Checkbox } from "primereact/checkbox";
|
|
13
|
+
import { Dialog } from "primereact/dialog";
|
|
14
|
+
import { Panel } from "primereact/panel";
|
|
15
|
+
import SolidFormView from "../../SolidFormView";
|
|
10
16
|
|
|
11
17
|
|
|
12
18
|
export class SolidRelationManyToOneField implements ISolidField {
|
|
@@ -57,6 +63,8 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
57
63
|
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
58
64
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
59
65
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
66
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
67
|
+
const [visibleCreateRelationEntity, setvisibleCreateRelationEntity] = useState(false);
|
|
60
68
|
|
|
61
69
|
// auto complete specific code.
|
|
62
70
|
const entityApi = createSolidEntityApi(fieldMetadata.relationModelSingularName);
|
|
@@ -106,11 +114,36 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
106
114
|
|
|
107
115
|
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
108
116
|
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
const disabled = fieldLayoutInfo.attrs?.disabled;
|
|
121
|
+
const readOnly = fieldLayoutInfo.attrs?.readOnly;
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
const customCreateHandler = (values: any) => {
|
|
125
|
+
const currentRelationData = formik.values[fieldLayoutInfo.attrs.name] || [];
|
|
126
|
+
const jsonValues = Object.fromEntries(values.entries());
|
|
127
|
+
const updatedRelationData = [
|
|
128
|
+
...currentRelationData,
|
|
129
|
+
{
|
|
130
|
+
label: jsonValues[fieldMetadata?.relationModel?.userKeyField?.name],
|
|
131
|
+
value: "new",
|
|
132
|
+
original: jsonValues,
|
|
133
|
+
},
|
|
134
|
+
];
|
|
135
|
+
|
|
136
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, updatedRelationData);
|
|
137
|
+
|
|
138
|
+
}
|
|
109
139
|
return (
|
|
110
140
|
<div className={className}>
|
|
111
141
|
<div className="flex flex-column gap-2 mt-4">
|
|
112
|
-
|
|
113
|
-
|
|
142
|
+
{showFieldLabel != false &&
|
|
143
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">
|
|
144
|
+
{fieldLabel}
|
|
145
|
+
</label>
|
|
146
|
+
}
|
|
114
147
|
<AutoComplete
|
|
115
148
|
readOnly={formReadonly || fieldReadonly}
|
|
116
149
|
disabled={formDisabled || fieldDisabled}
|
|
@@ -124,6 +157,9 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
124
157
|
onChange={formik.handleChange}
|
|
125
158
|
className="w-full solid-standard-autocomplete"
|
|
126
159
|
/>
|
|
160
|
+
{fieldLayoutInfo.attrs.inlineCreate === "true" &&
|
|
161
|
+
this.renderSolidFormEmbededView(formik, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
|
|
162
|
+
}
|
|
127
163
|
</div>
|
|
128
164
|
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
129
165
|
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
@@ -131,4 +167,58 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
131
167
|
</div>
|
|
132
168
|
);
|
|
133
169
|
}
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
renderSolidFormEmbededView(formik: FormikObject, customCreateHandler: any, visibleCreateRelationEntity: any, setvisibleCreateRelationEntity: any) {
|
|
173
|
+
|
|
174
|
+
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
175
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
176
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-6 flex flex-column gap-2 mt-4';
|
|
177
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
178
|
+
|
|
179
|
+
const params = {
|
|
180
|
+
moduleName: this.fieldContext.fieldMetadata.relationModelModuleName,
|
|
181
|
+
id: "new",
|
|
182
|
+
embeded: true,
|
|
183
|
+
layout: fieldLayoutInfo?.attrs?.inlineCreateLayout,
|
|
184
|
+
customCreateHandler: ((values: any) => {
|
|
185
|
+
setvisibleCreateRelationEntity(false);
|
|
186
|
+
customCreateHandler(values)
|
|
187
|
+
}),
|
|
188
|
+
inlineCreateAutoSave: fieldLayoutInfo?.attrs?.inlineCreateAutoSave,
|
|
189
|
+
handlePopupClose: (() => {
|
|
190
|
+
setvisibleCreateRelationEntity(false);
|
|
191
|
+
}),
|
|
192
|
+
modelName: camelCase(this.fieldContext.fieldMetadata.relationModelSingularName)
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
<div >
|
|
197
|
+
<Button
|
|
198
|
+
icon="pi pi-plus"
|
|
199
|
+
rounded
|
|
200
|
+
outlined
|
|
201
|
+
aria-label="Filter"
|
|
202
|
+
type="button"
|
|
203
|
+
size="small"
|
|
204
|
+
onClick={() => setvisibleCreateRelationEntity(true)}
|
|
205
|
+
className="custom-add-button"
|
|
206
|
+
/>
|
|
207
|
+
<Dialog
|
|
208
|
+
header=""
|
|
209
|
+
showHeader={false}
|
|
210
|
+
visible={visibleCreateRelationEntity}
|
|
211
|
+
style={{ width: fieldLayoutInfo?.attrs?.inlineCreateLayout?.attrs?.width ?? "60vw" }}
|
|
212
|
+
onHide={() => {
|
|
213
|
+
if (!visibleCreateRelationEntity) return;
|
|
214
|
+
setvisibleCreateRelationEntity(false);
|
|
215
|
+
}}
|
|
216
|
+
className="solid-dialog"
|
|
217
|
+
>
|
|
218
|
+
<SolidFormView {...params} />
|
|
219
|
+
|
|
220
|
+
</Dialog>
|
|
221
|
+
</div>
|
|
222
|
+
)
|
|
223
|
+
}
|
|
134
224
|
}
|
|
@@ -62,6 +62,7 @@ export class SolidRelationOneToManyField implements ISolidField {
|
|
|
62
62
|
const [listViewParams, setListViewParams] = useState<any>()
|
|
63
63
|
const [formViewParams, setformViewParams] = useState<any>()
|
|
64
64
|
const [refreshList, setRefreshList] = useState(false); // Added state for rerender
|
|
65
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
65
66
|
|
|
66
67
|
|
|
67
68
|
const handlePopupOpen = (id: any) => {
|
|
@@ -133,7 +134,10 @@ export class SolidRelationOneToManyField implements ISolidField {
|
|
|
133
134
|
return (
|
|
134
135
|
<div className={className}>
|
|
135
136
|
{/* <div className="justify-content-center align-items-center"> */}
|
|
136
|
-
|
|
137
|
+
{showFieldLabel != false &&
|
|
138
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel} {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}</label>
|
|
139
|
+
}
|
|
140
|
+
|
|
137
141
|
{/* </div>
|
|
138
142
|
<br></br> */}
|
|
139
143
|
{listViewParams &&
|
|
@@ -59,6 +59,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
59
59
|
// const [showGlobalSearchElement, setShowGlobalSearchElement] = useState<boolean>(false);
|
|
60
60
|
|
|
61
61
|
const [toPopulate, setToPopulate] = useState<string[]>([]);
|
|
62
|
+
const [toPopulateMedia, setToPopulateMedia] = useState<string[]>([]);
|
|
62
63
|
const [actionsAllowed, setActionsAllowed] = useState<string[]>([]);
|
|
63
64
|
|
|
64
65
|
const [triggerCheckIfPermissionExists] = useLazyCheckIfPermissionExistsQuery();
|
|
@@ -123,6 +124,8 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
123
124
|
|
|
124
125
|
const initialFilters: any = {};
|
|
125
126
|
const toPopulate: string[] = [];
|
|
127
|
+
const toPopulateMedia: string[] = [];
|
|
128
|
+
|
|
126
129
|
for (let i = 0; i < solidView.layout.children?.length; i++) {
|
|
127
130
|
const column = solidView.layout.children[i];
|
|
128
131
|
const fieldMetadata = solidFieldsMetadata[column.attrs.name];
|
|
@@ -155,10 +158,14 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
155
158
|
if (fieldMetadata.type === 'relation' && fieldMetadata.relationType === 'many-to-one') {
|
|
156
159
|
toPopulate.push(fieldMetadata.name);
|
|
157
160
|
}
|
|
161
|
+
if (fieldMetadata.type === 'mediaSingle' || fieldMetadata.relationType === 'mediaMultiple') {
|
|
162
|
+
toPopulateMedia.push(fieldMetadata.name);
|
|
163
|
+
}
|
|
158
164
|
}
|
|
159
165
|
// setFilters(initialFilters);
|
|
160
166
|
setRows(solidListViewMetaData?.data?.solidView?.layout?.attrs?.defaultPageSize ? solidListViewMetaData?.data?.solidView?.layout?.attrs.defaultPageSize : 25)
|
|
161
167
|
setToPopulate(toPopulate);
|
|
168
|
+
setToPopulateMedia(toPopulateMedia);
|
|
162
169
|
}
|
|
163
170
|
|
|
164
171
|
useEffect(() => {
|
|
@@ -268,11 +275,12 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
268
275
|
|
|
269
276
|
// Fetch data after toPopulate has been populated...
|
|
270
277
|
useEffect(() => {
|
|
271
|
-
if (toPopulate) {
|
|
278
|
+
if (toPopulate || toPopulateMedia) {
|
|
272
279
|
const queryData = {
|
|
273
280
|
offset: 0,
|
|
274
281
|
limit: 25,
|
|
275
282
|
populate: toPopulate,
|
|
283
|
+
populateMedia: toPopulateMedia,
|
|
276
284
|
sort: [`id:desc`],
|
|
277
285
|
filters: { ...params.customFilter }
|
|
278
286
|
};
|
|
@@ -288,7 +296,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
288
296
|
setSelectedRecoverRecords([]);
|
|
289
297
|
setShowArchived(false);
|
|
290
298
|
}
|
|
291
|
-
}, [isDeleteSolidEntitiesSucess, isDeleteSolidSingleEntitySuccess, toPopulate]);
|
|
299
|
+
}, [isDeleteSolidEntitiesSucess, isDeleteSolidSingleEntitySuccess, toPopulate, toPopulateMedia]);
|
|
292
300
|
|
|
293
301
|
// Handle pagination event.
|
|
294
302
|
const onPageChange = (event: any) => {
|
|
@@ -402,6 +410,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
402
410
|
limit: limit ?? rows,
|
|
403
411
|
filters: filters ?? filters,
|
|
404
412
|
populate: toPopulate,
|
|
413
|
+
populateMedia: toPopulateMedia
|
|
405
414
|
};
|
|
406
415
|
|
|
407
416
|
if (sortField) {
|
|
@@ -702,7 +711,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
702
711
|
rows={rows}
|
|
703
712
|
rowsPerPageOptions={solidListViewMetaData?.data?.solidView?.layout?.attrs?.pageSizeOptions}
|
|
704
713
|
dataKey="id"
|
|
705
|
-
emptyMessage=
|
|
714
|
+
emptyMessage={solidListViewMetaData?.data?.solidView?.model?.description || 'No Entities found.'}
|
|
706
715
|
filterDisplay="menu"
|
|
707
716
|
totalRecords={totalRecords}
|
|
708
717
|
first={first}
|
|
@@ -9,11 +9,29 @@ const SolidMediaMultipleColumn = ({ solidListViewMetaData, fieldMetadata, column
|
|
|
9
9
|
const showFilterOperator = false;
|
|
10
10
|
const columnDataType = undefined;
|
|
11
11
|
const header = column.attrs.label ?? fieldMetadata.displayName;
|
|
12
|
+
const imageBodyTemplate = (product: any) => {
|
|
13
|
+
if (!product?._media?.[fieldMetadata.name]) return null;
|
|
12
14
|
|
|
15
|
+
const imageUrls = product._media[fieldMetadata.name].map((i: any) => i._full_url);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
{imageUrls.map((url: string, index: number) => (
|
|
20
|
+
<img
|
|
21
|
+
key={index}
|
|
22
|
+
src={url}
|
|
23
|
+
alt={`product-image-${index}`}
|
|
24
|
+
className="w-6rem shadow-2 border-round"
|
|
25
|
+
/>
|
|
26
|
+
))}
|
|
27
|
+
</>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
13
30
|
return (
|
|
14
31
|
<Column
|
|
15
32
|
key={fieldMetadata.name}
|
|
16
33
|
field={fieldMetadata.name}
|
|
34
|
+
body={imageBodyTemplate}
|
|
17
35
|
header={header}
|
|
18
36
|
// className="text-sm"
|
|
19
37
|
sortable={column.attrs.sortable}
|