@solidstarters/solid-core-ui 1.1.25 → 1.1.26

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.
Files changed (128) hide show
  1. package/dist/components/common/SolidBreadcrumb.d.ts +1 -2
  2. package/dist/components/common/SolidBreadcrumb.d.ts.map +1 -1
  3. package/dist/components/common/SolidBreadcrumb.js +14 -9
  4. package/dist/components/common/SolidBreadcrumb.js.map +1 -1
  5. package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
  6. package/dist/components/core/form/SolidFormView.js +65 -38
  7. package/dist/components/core/form/SolidFormView.js.map +1 -1
  8. package/dist/components/core/form/fields/SolidBooleanField.d.ts.map +1 -1
  9. package/dist/components/core/form/fields/SolidBooleanField.js +2 -2
  10. package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
  11. package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
  12. package/dist/components/core/form/fields/SolidDateField.js +2 -2
  13. package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
  14. package/dist/components/core/form/fields/SolidDateTimeField.d.ts.map +1 -1
  15. package/dist/components/core/form/fields/SolidDateTimeField.js +2 -2
  16. package/dist/components/core/form/fields/SolidDateTimeField.js.map +1 -1
  17. package/dist/components/core/form/fields/SolidDecimalField.d.ts.map +1 -1
  18. package/dist/components/core/form/fields/SolidDecimalField.js +2 -2
  19. package/dist/components/core/form/fields/SolidDecimalField.js.map +1 -1
  20. package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
  21. package/dist/components/core/form/fields/SolidIntegerField.js +2 -2
  22. package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
  23. package/dist/components/core/form/fields/SolidJsonField.d.ts.map +1 -1
  24. package/dist/components/core/form/fields/SolidJsonField.js +1 -1
  25. package/dist/components/core/form/fields/SolidJsonField.js.map +1 -1
  26. package/dist/components/core/form/fields/SolidLongTextField.d.ts.map +1 -1
  27. package/dist/components/core/form/fields/SolidLongTextField.js +1 -1
  28. package/dist/components/core/form/fields/SolidLongTextField.js.map +1 -1
  29. package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
  30. package/dist/components/core/form/fields/SolidMediaMultipleField.js +27 -96
  31. package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
  32. package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
  33. package/dist/components/core/form/fields/SolidMediaSingleField.js +29 -29
  34. package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
  35. package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
  36. package/dist/components/core/form/fields/SolidRichTextField.js +1 -1
  37. package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
  38. package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts.map +1 -1
  39. package/dist/components/core/form/fields/SolidSelectionDynamicField.js +2 -2
  40. package/dist/components/core/form/fields/SolidSelectionDynamicField.js.map +1 -1
  41. package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts.map +1 -1
  42. package/dist/components/core/form/fields/SolidSelectionStaticField.js +2 -2
  43. package/dist/components/core/form/fields/SolidSelectionStaticField.js.map +1 -1
  44. package/dist/components/core/form/fields/SolidShortTextField.d.ts.map +1 -1
  45. package/dist/components/core/form/fields/SolidShortTextField.js +3 -3
  46. package/dist/components/core/form/fields/SolidShortTextField.js.map +1 -1
  47. package/dist/components/core/form/fields/SolidTimeField.d.ts.map +1 -1
  48. package/dist/components/core/form/fields/SolidTimeField.js +2 -2
  49. package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
  50. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
  51. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +5 -5
  52. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
  53. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
  54. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +3 -3
  55. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
  56. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -1
  57. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +1 -1
  58. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
  59. package/dist/components/core/list/SolidTableRowCell.d.ts +6 -0
  60. package/dist/components/core/list/SolidTableRowCell.d.ts.map +1 -0
  61. package/dist/components/core/list/SolidTableRowCell.js +7 -0
  62. package/dist/components/core/list/SolidTableRowCell.js.map +1 -0
  63. package/dist/components/core/list/columns/SolidDateColumn.d.ts.map +1 -1
  64. package/dist/components/core/list/columns/SolidDateColumn.js +7 -3
  65. package/dist/components/core/list/columns/SolidDateColumn.js.map +1 -1
  66. package/dist/components/core/list/columns/SolidDatetimeColumn.d.ts.map +1 -1
  67. package/dist/components/core/list/columns/SolidDatetimeColumn.js +7 -3
  68. package/dist/components/core/list/columns/SolidDatetimeColumn.js.map +1 -1
  69. package/dist/components/core/list/columns/SolidExternalIdColumn.d.ts.map +1 -1
  70. package/dist/components/core/list/columns/SolidExternalIdColumn.js +7 -3
  71. package/dist/components/core/list/columns/SolidExternalIdColumn.js.map +1 -1
  72. package/dist/components/core/list/columns/SolidIdColumn.d.ts.map +1 -1
  73. package/dist/components/core/list/columns/SolidIdColumn.js +7 -3
  74. package/dist/components/core/list/columns/SolidIdColumn.js.map +1 -1
  75. package/dist/components/core/list/columns/SolidIntColumn.d.ts.map +1 -1
  76. package/dist/components/core/list/columns/SolidIntColumn.js +7 -3
  77. package/dist/components/core/list/columns/SolidIntColumn.js.map +1 -1
  78. package/dist/components/core/list/columns/SolidSelectionDynamicColumn.d.ts.map +1 -1
  79. package/dist/components/core/list/columns/SolidSelectionDynamicColumn.js +7 -3
  80. package/dist/components/core/list/columns/SolidSelectionDynamicColumn.js.map +1 -1
  81. package/dist/components/core/list/columns/SolidSelectionStaticColumn.d.ts.map +1 -1
  82. package/dist/components/core/list/columns/SolidSelectionStaticColumn.js +7 -3
  83. package/dist/components/core/list/columns/SolidSelectionStaticColumn.js.map +1 -1
  84. package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
  85. package/dist/components/core/list/columns/SolidShortTextColumn.js +7 -5
  86. package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
  87. package/dist/components/core/list/columns/SolidTimeColumn.d.ts.map +1 -1
  88. package/dist/components/core/list/columns/SolidTimeColumn.js +7 -3
  89. package/dist/components/core/list/columns/SolidTimeColumn.js.map +1 -1
  90. package/dist/components/core/list/columns/SolidUuidColumn.d.ts.map +1 -1
  91. package/dist/components/core/list/columns/SolidUuidColumn.js +10 -4
  92. package/dist/components/core/list/columns/SolidUuidColumn.js.map +1 -1
  93. package/dist/components/core/model/ModelMetaData.js +5 -5
  94. package/dist/components/core/model/ModelMetaData.js.map +1 -1
  95. package/dist/resources/globals.css +2 -1
  96. package/package.json +1 -1
  97. package/src/components/common/SolidBreadcrumb.tsx +18 -15
  98. package/src/components/core/form/SolidFormView.tsx +20 -3
  99. package/src/components/core/form/fields/SolidBooleanField.tsx +4 -1
  100. package/src/components/core/form/fields/SolidDateField.tsx +4 -1
  101. package/src/components/core/form/fields/SolidDateTimeField.tsx +4 -1
  102. package/src/components/core/form/fields/SolidDecimalField.tsx +6 -3
  103. package/src/components/core/form/fields/SolidIntegerField.tsx +4 -1
  104. package/src/components/core/form/fields/SolidJsonField.tsx +5 -3
  105. package/src/components/core/form/fields/SolidLongTextField.tsx +4 -1
  106. package/src/components/core/form/fields/SolidMediaMultipleField.tsx +33 -118
  107. package/src/components/core/form/fields/SolidMediaSingleField.tsx +39 -33
  108. package/src/components/core/form/fields/SolidRichTextField.tsx +4 -1
  109. package/src/components/core/form/fields/SolidSelectionDynamicField.tsx +4 -1
  110. package/src/components/core/form/fields/SolidSelectionStaticField.tsx +4 -1
  111. package/src/components/core/form/fields/SolidShortTextField.tsx +5 -4
  112. package/src/components/core/form/fields/SolidTimeField.tsx +5 -3
  113. package/src/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +32 -24
  114. package/src/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +30 -25
  115. package/src/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +4 -3
  116. package/src/components/core/list/SolidTableRowCell.tsx +12 -0
  117. package/src/components/core/list/columns/SolidDateColumn.tsx +9 -1
  118. package/src/components/core/list/columns/SolidDatetimeColumn.tsx +9 -1
  119. package/src/components/core/list/columns/SolidExternalIdColumn.tsx +10 -1
  120. package/src/components/core/list/columns/SolidIdColumn.tsx +10 -2
  121. package/src/components/core/list/columns/SolidIntColumn.tsx +9 -1
  122. package/src/components/core/list/columns/SolidSelectionDynamicColumn.tsx +10 -1
  123. package/src/components/core/list/columns/SolidSelectionStaticColumn.tsx +10 -1
  124. package/src/components/core/list/columns/SolidShortTextColumn.tsx +9 -4
  125. package/src/components/core/list/columns/SolidTimeColumn.tsx +9 -1
  126. package/src/components/core/list/columns/SolidUuidColumn.tsx +11 -2
  127. package/src/components/core/model/ModelMetaData.tsx +5 -5
  128. package/src/resources/globals.css +2 -1
@@ -87,9 +87,7 @@ export class SolidMediaSingleField implements ISolidField {
87
87
 
88
88
  const [isDeleteImageDialogVisible, setDeleteImageDialogVisible] = useState(false);
89
89
  const [imageToBeDeletedData, setImageToBeDeletedData] = useState<any>();
90
- const [uploadCompleted, setUploadCompleted] = useState<boolean>(false);
91
- const [fileDetails, setFileDetails] = useState<{ name: string; type: string, fileUrl: string } | null>(null);
92
- const [totalSize, setTotalSize] = useState<string>("0 KB");
90
+ const [fileDetails, setFileDetails] = useState<{ name: string; type: string, fileUrl: string, fileSize: number } | null>(null);
93
91
  const [isReplaceImageDialogVisible, setReplaceImageDialogVisible] = useState(false);
94
92
  const [newFileToUpload, setNewFileToUpload] = useState<any>(null);
95
93
 
@@ -110,7 +108,6 @@ export class SolidMediaSingleField implements ISolidField {
110
108
  deleteMedia(imageToBeDeletedData);
111
109
  }
112
110
  e.stopPropagation();
113
- setUploadCompleted(false);
114
111
  setFileDetails(null);
115
112
  formik.setFieldValue(fieldLayoutInfo.attrs.name, null);
116
113
  setDeleteImageDialogVisible(false);
@@ -129,25 +126,24 @@ export class SolidMediaSingleField implements ISolidField {
129
126
  }
130
127
  };
131
128
 
132
- const uploadFile = (file: any) => {
133
- setUploadCompleted(false);
134
- setTotalSize(formatFileSize(file.size));
135
- setFileDetails({ name: file.name, type: file.type, fileUrl: file.fileUrl });
129
+ const uploadFile = (file: File) => {
130
+ setFileDetails({
131
+ name: file.name,
132
+ type: file.type,
133
+ fileUrl: URL.createObjectURL(file),
134
+ fileSize: file.size
135
+ });
136
136
 
137
137
  const reader = new FileReader();
138
- reader.onloadend = () => {
139
- setUploadCompleted(true);
140
- };
141
138
  reader.readAsDataURL(file);
142
139
  formik.setFieldValue(fieldLayoutInfo.attrs.name, file);
143
140
  };
141
+
144
142
  const handleReplaceFile = () => {
145
143
  // Delete the existing file first
146
144
  if (imageToBeDeletedData) {
147
145
  deleteMedia(imageToBeDeletedData);
148
146
  }
149
-
150
- setUploadCompleted(false);
151
147
  setFileDetails(null);
152
148
  formik.setFieldValue(fieldLayoutInfo.attrs.name, null);
153
149
 
@@ -159,28 +155,36 @@ export class SolidMediaSingleField implements ISolidField {
159
155
 
160
156
  setReplaceImageDialogVisible(false);
161
157
  };
158
+
162
159
  useEffect(() => {
163
160
  const fieldValue = formik?.values[fieldLayoutInfo.attrs.name];
164
161
 
165
162
  if (fieldValue && typeof fieldValue === "object") {
166
163
  let fileUrl = "";
167
164
  let fileName = "Unknown File";
165
+ let fileSize = 0;
168
166
 
169
167
  if (fieldValue instanceof File) {
170
- // Handle new file upload
171
- fileUrl = fieldValue.name;
172
- fileName = fileUrl;
168
+ fileUrl = URL.createObjectURL(fieldValue);
169
+ fileName = fieldValue.name;
170
+ fileSize = fieldValue.size;
173
171
  } else if (fieldValue._full_url) {
174
- // Handle updated file from backend
175
172
  fileUrl = fieldValue._full_url;
176
- fileName = fieldValue.relativeUri?.split("/").pop() || "Unknown File";
173
+ fileName = fieldValue.originalFileName;
174
+ fileSize = fieldValue.fileSize;
177
175
  }
178
176
 
179
- setFileDetails({ name: fileName, type: "Uploaded File", fileUrl });
177
+ setFileDetails({
178
+ name: fileName,
179
+ type: fieldValue.mimeType,
180
+ fileUrl,
181
+ fileSize
182
+ });
180
183
 
181
- // Set upload progress
182
- setUploadCompleted(true);
184
+ // Set file ID for delete operation
183
185
  setImageToBeDeletedData(fieldValue.id);
186
+
187
+ // Ensure formik has the correct value
184
188
  formik.setFieldValue(fieldLayoutInfo.attrs.name, fieldValue);
185
189
  }
186
190
  }, [formik.values, fieldLayoutInfo.attrs.name]);
@@ -202,6 +206,7 @@ export class SolidMediaSingleField implements ISolidField {
202
206
  <div className="flex flex-column gap-2 mt-4">
203
207
  {showFieldLabel != false &&
204
208
  <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
209
+ {fieldMetadata.required && <span className="text-red-500"> *</span>}
205
210
  {/* &nbsp; {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>} */}
206
211
  </label>
207
212
  }
@@ -216,7 +221,9 @@ export class SolidMediaSingleField implements ISolidField {
216
221
  />
217
222
  </div>
218
223
  {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
219
- <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
224
+ <div className="absolute mt-1">
225
+ <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
226
+ </div>
220
227
  )}
221
228
  {fileDetails && (
222
229
  <div className="solid-file-upload-wrapper">
@@ -224,10 +231,11 @@ export class SolidMediaSingleField implements ISolidField {
224
231
  <FileReaderExt fileDetails={fileDetails} />
225
232
  <div className="w-full flex flex-column gap-1">
226
233
  <div className="flex align-items-start justify-content-between">
227
- <Link className="font-normal w-9" href={process.env.NEXT_PUBLIC_BACKEND_API_URL + `/${fileDetails?.fileUrl}`} target="_blank">{fileDetails.name}</Link>
234
+ <Link className="font-normal w-9 text-primary" href={fileDetails.fileUrl} target="_blank">{fileDetails.name}</Link>
228
235
  <div className="flex align-items-center gap-2">
229
236
  <div>
230
237
  <Button
238
+ type="button"
231
239
  text
232
240
  icon={"pi pi-download"}
233
241
  size="small"
@@ -242,6 +250,7 @@ export class SolidMediaSingleField implements ISolidField {
242
250
  </div>
243
251
  <div>
244
252
  <Button
253
+ type="button"
245
254
  text
246
255
  icon={"pi pi-times"}
247
256
  size="small"
@@ -256,12 +265,9 @@ export class SolidMediaSingleField implements ISolidField {
256
265
  </div>
257
266
  </div>
258
267
  </div>
259
- {
260
- uploadCompleted &&
261
- <div className="flex align-items-center gap-2 text-sm">
262
- {totalSize}
263
- </div>
264
- }
268
+ <div className="flex align-items-center gap-2 text-sm">
269
+ {fileDetails && formatFileSize(fileDetails.fileSize)}
270
+ </div>
265
271
  </div>
266
272
  </div>
267
273
  </div>
@@ -273,8 +279,8 @@ export class SolidMediaSingleField implements ISolidField {
273
279
  modal
274
280
  footer={() => (
275
281
  <div className="flex justify-content-center">
276
- <Button label="Yes" icon="pi pi-check" className='small-button' severity="danger" autoFocus onClick={handleCancelUpload} />
277
- <Button label="No" icon="pi pi-times" className='small-button' onClick={() => setDeleteImageDialogVisible(false)} />
282
+ <Button type="button" label="Yes" icon="pi pi-check" className='small-button' severity="danger" autoFocus onClick={handleCancelUpload} />
283
+ <Button type="button" label="No" icon="pi pi-times" className='small-button' onClick={() => setDeleteImageDialogVisible(false)} />
278
284
  </div>
279
285
  )}
280
286
  onHide={() => setDeleteImageDialogVisible(false)}
@@ -287,8 +293,8 @@ export class SolidMediaSingleField implements ISolidField {
287
293
  modal
288
294
  footer={() => (
289
295
  <div className="flex justify-content-center">
290
- <Button label="Yes, Replace" icon="pi pi-check" className='small-button' severity="danger" onClick={handleReplaceFile} />
291
- <Button label="Cancel" icon="pi pi-times" className='small-button' onClick={() => setReplaceImageDialogVisible(false)} />
296
+ <Button type="button" label="Yes, Replace" icon="pi pi-check" className='small-button' severity="danger" onClick={handleReplaceFile} />
297
+ <Button type="button" label="Cancel" icon="pi pi-times" className='small-button' onClick={() => setReplaceImageDialogVisible(false)} />
292
298
  </div>
293
299
  )}
294
300
  onHide={() => setReplaceImageDialogVisible(false)}
@@ -79,6 +79,7 @@ export class SolidRichTextField implements ISolidField {
79
79
  <div className="flex flex-column gap-2 mt-4">
80
80
  {showFieldLabel != false &&
81
81
  <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
82
+ {fieldMetadata.required && <span className="text-red-500"> *</span>}
82
83
  {/* &nbsp; {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>} */}
83
84
  </label>
84
85
  }
@@ -93,7 +94,9 @@ export class SolidRichTextField implements ISolidField {
93
94
  />
94
95
  </div>
95
96
  {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
96
- <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
97
+ <div className="absolute mt-1">
98
+ <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
99
+ </div>
97
100
  )}
98
101
  </div>
99
102
  );
@@ -98,6 +98,7 @@ export class SolidSelectionDynamicField implements ISolidField {
98
98
  <div className="flex flex-column gap-2 mt-4">
99
99
  {showFieldLabel != false &&
100
100
  <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
101
+ {fieldMetadata.required && <span className="text-red-500"> *</span>}
101
102
  {/* &nbsp; {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>} */}
102
103
  </label>
103
104
  }
@@ -117,7 +118,9 @@ export class SolidSelectionDynamicField implements ISolidField {
117
118
  />
118
119
  </div>
119
120
  {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
120
- <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
121
+ <div className="absolute mt-1">
122
+ <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
123
+ </div>
121
124
  )}
122
125
  </div>
123
126
  );
@@ -103,6 +103,7 @@ export class SolidSelectionStaticField implements ISolidField {
103
103
  <div className="flex flex-column gap-2 mt-4">
104
104
  {showFieldLabel != false &&
105
105
  <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
106
+ {fieldMetadata.required && <span className="text-red-500"> *</span>}
106
107
  {/* &nbsp; {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>} */}
107
108
  </label>
108
109
  }
@@ -124,7 +125,9 @@ export class SolidSelectionStaticField implements ISolidField {
124
125
  />
125
126
  </div>
126
127
  {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
127
- <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
128
+ <div className="absolute mt-1">
129
+ <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
130
+ </div>
128
131
  )}
129
132
  </div>
130
133
  );
@@ -85,8 +85,8 @@ export class SolidShortTextField implements ISolidField {
85
85
  <div className="flex flex-column gap-2 mt-4">
86
86
  {showFieldLabel != false &&
87
87
  <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
88
+ {fieldMetadata.required && <span className="text-red-500"> *</span>}
88
89
  {/* &nbsp; {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>} */}
89
- {/* &nbsp; {fieldDescription && <span className="form_field_help_text">`(${fieldDescription})` </span>} */}
90
90
  </label>
91
91
  }
92
92
  <InputText
@@ -102,16 +102,17 @@ export class SolidShortTextField implements ISolidField {
102
102
  />
103
103
  </div>
104
104
  {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
105
- <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
105
+ <div className="absolute mt-1">
106
+ <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
107
+ </div>
106
108
  )}
107
109
  </div>}
108
110
  {includeWrapper === 'no' &&
109
111
  <>
110
112
  {showFieldLabel != false &&
111
113
  <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
114
+ {fieldMetadata.required && <span className="text-red-500"> *</span>}
112
115
  {/* &nbsp; {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>} */}
113
-
114
- {/* &nbsp; {fieldDescription && <span className="form_field_help_text">`(${fieldDescription})` </span>} */}
115
116
  </label>
116
117
  }
117
118
  <InputText
@@ -53,7 +53,7 @@ export class SolidTimeField implements ISolidField {
53
53
  const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
54
54
  const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
55
55
  const readOnlyPermission = this.fieldContext.readOnly;
56
-
56
+
57
57
  const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
58
58
 
59
59
  const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
@@ -64,7 +64,7 @@ export class SolidTimeField implements ISolidField {
64
64
  <div className="flex flex-column gap-2 mt-4">
65
65
  {showFieldLabel != false &&
66
66
  <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
67
-
67
+ {fieldMetadata.required && <span className="text-red-500"> *</span>}
68
68
  {/* &nbsp; {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>} */}
69
69
  </label>
70
70
  }
@@ -86,7 +86,9 @@ export class SolidTimeField implements ISolidField {
86
86
  />
87
87
  </div>
88
88
  {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
89
- <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
89
+ <div className="absolute mt-1">
90
+ <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
91
+ </div>
90
92
  )}
91
93
  </div>
92
94
  );
@@ -125,7 +125,11 @@ export class SolidRelationManyToManyField implements ISolidField {
125
125
  {(!fieldLayoutInfo.attrs.renderMode || fieldLayoutInfo.attrs.renderMode === "autocomplete") &&
126
126
  this.renderAutoCompleteMode(formik, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
127
127
  }
128
- {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />)}
128
+ {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
129
+ <div className="absolute mt-1">
130
+ <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
131
+ </div>
132
+ )}
129
133
  {/* </div> */}
130
134
  </>
131
135
  );
@@ -137,7 +141,7 @@ export class SolidRelationManyToManyField implements ISolidField {
137
141
  const className = fieldLayoutInfo.attrs?.className || 'field col-12';
138
142
  const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
139
143
  const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
140
-
144
+
141
145
  const readOnlyPermission = this.fieldContext.readOnly;
142
146
 
143
147
 
@@ -242,6 +246,7 @@ export class SolidRelationManyToManyField implements ISolidField {
242
246
  {showFieldLabel != false &&
243
247
  <label className="form-field-label">
244
248
  {capitalize(fieldLayoutInfo.attrs.name)}
249
+ {fieldMetadata.required && <span className="text-red-500"> *</span>}
245
250
  </label>
246
251
  }
247
252
  {fieldLayoutInfo.attrs.inlineCreate === "true" &&
@@ -367,29 +372,32 @@ export class SolidRelationManyToManyField implements ISolidField {
367
372
 
368
373
  return (
369
374
  <div className={className}>
370
- {showFieldLabel != false &&
371
- <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">
372
- {fieldLabel}
373
- </label>
374
- }
375
- <div className="flex align-items-center gap-3">
376
- <AutoComplete
377
- readOnly={readOnly || readOnlyPermission}
378
- disabled={disabled || readOnlyPermission}
379
- multiple
380
- {...formik.getFieldProps(fieldLayoutInfo.attrs.name)}
381
- id={fieldLayoutInfo.attrs.name}
382
- field="label"
383
- value={formik.values[fieldLayoutInfo.attrs.name] || ''}
384
- dropdown={!readOnlyPermission}
385
- suggestions={autoCompleteItems}
386
- completeMethod={autoCompleteSearch}
387
- onChange={formik.handleChange}
388
- className="solid-standard-autocomplete w-full"
389
- />
390
- {fieldLayoutInfo.attrs.inlineCreate === "true" && readOnlyPermission === false &&
391
- this.renderSolidFormEmbededView(formik, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
375
+ <div className="mt-4">
376
+ {showFieldLabel != false &&
377
+ <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">
378
+ {fieldLabel}
379
+ {fieldMetadata.required && <span className="text-red-500"> *</span>}
380
+ </label>
392
381
  }
382
+ <div className="flex align-items-center gap-3 mt-2">
383
+ <AutoComplete
384
+ readOnly={readOnly || readOnlyPermission}
385
+ disabled={disabled || readOnlyPermission}
386
+ multiple
387
+ {...formik.getFieldProps(fieldLayoutInfo.attrs.name)}
388
+ id={fieldLayoutInfo.attrs.name}
389
+ field="label"
390
+ value={formik.values[fieldLayoutInfo.attrs.name] || ''}
391
+ dropdown={!readOnlyPermission}
392
+ suggestions={autoCompleteItems}
393
+ completeMethod={autoCompleteSearch}
394
+ onChange={formik.handleChange}
395
+ className="solid-standard-autocomplete w-full"
396
+ />
397
+ {fieldLayoutInfo.attrs.inlineCreate === "true" && readOnlyPermission === false &&
398
+ this.renderSolidFormEmbededView(formik, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
399
+ }
400
+ </div>
393
401
  </div>
394
402
  </div>
395
403
  );
@@ -137,33 +137,38 @@ export class SolidRelationManyToOneField implements ISolidField {
137
137
  }
138
138
  return (
139
139
  <div className={className}>
140
- {showFieldLabel != false &&
141
- <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">
142
- {fieldLabel}
143
- </label>
144
- }
145
- <div className="flex align-items-center gap-3">
146
- <AutoComplete
147
- readOnly={formReadonly || fieldReadonly || readOnlyPermission}
148
- disabled={formDisabled || fieldDisabled || readOnlyPermission}
149
- {...formik.getFieldProps(fieldLayoutInfo.attrs.name)}
150
- id={fieldLayoutInfo.attrs.name}
151
- field="label"
152
- value={formik.values[fieldLayoutInfo.attrs.name] || ''}
153
- dropdown={!readOnlyPermission}
154
- suggestions={autoCompleteItems}
155
- completeMethod={autoCompleteSearch}
156
- onChange={formik.handleChange}
157
- onFocus={(e) => e.target.select()}
158
- className="w-full solid-standard-autocomplete"
159
- />
160
- {fieldLayoutInfo.attrs.inlineCreate === "true" && readOnlyPermission === false &&
161
- this.renderSolidFormEmbededView(formik, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
140
+ <div className="mt-4">
141
+ {showFieldLabel != false &&
142
+ <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">
143
+ {fieldLabel}
144
+ {fieldMetadata.required && <span className="text-red-500"> *</span>}
145
+ </label>
162
146
  }
147
+ <div className="flex align-items-center gap-3 mt-2">
148
+ <AutoComplete
149
+ readOnly={formReadonly || fieldReadonly || readOnlyPermission}
150
+ disabled={formDisabled || fieldDisabled || readOnlyPermission}
151
+ {...formik.getFieldProps(fieldLayoutInfo.attrs.name)}
152
+ id={fieldLayoutInfo.attrs.name}
153
+ field="label"
154
+ value={formik.values[fieldLayoutInfo.attrs.name] || ''}
155
+ dropdown={!readOnlyPermission}
156
+ suggestions={autoCompleteItems}
157
+ completeMethod={autoCompleteSearch}
158
+ onChange={formik.handleChange}
159
+ onFocus={(e) => e.target.select()}
160
+ className="w-full solid-standard-autocomplete"
161
+ />
162
+ {fieldLayoutInfo.attrs.inlineCreate === "true" && readOnlyPermission === false &&
163
+ this.renderSolidFormEmbededView(formik, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
164
+ }
165
+ </div>
166
+ {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
167
+ <div className="absolute mt-1">
168
+ <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
169
+ </div>
170
+ )}
163
171
  </div>
164
- {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
165
- <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
166
- )}
167
172
  </div>
168
173
  );
169
174
  }
@@ -86,7 +86,7 @@ export class SolidRelationOneToManyField implements ISolidField {
86
86
  const lisviewparams = {
87
87
  moduleName: this.fieldContext.fieldMetadata.relationModelModuleName,
88
88
  modelName: camelCase(this.fieldContext.fieldMetadata.relationCoModelSingularName),
89
- inlineCreate: readOnlyPermission === false ? true : false,
89
+ inlineCreate: readOnlyPermission === false ? true : false,
90
90
  customLayout: fieldLayoutInfo?.attrs?.inlineListLayout,
91
91
  embeded: true
92
92
  }
@@ -99,7 +99,7 @@ export class SolidRelationOneToManyField implements ISolidField {
99
99
  const listviewparams = {
100
100
  moduleName: this.fieldContext.fieldMetadata.relationModelModuleName,
101
101
  modelName: camelCase(this.fieldContext.fieldMetadata.relationCoModelSingularName),
102
- inlineCreate: readOnlyPermission === false ? true : false,
102
+ inlineCreate: readOnlyPermission === false ? true : false,
103
103
  customLayout: fieldLayoutInfo?.attrs?.inlineListLayout,
104
104
  embeded: true,
105
105
  customFilter: {
@@ -137,7 +137,8 @@ export class SolidRelationOneToManyField implements ISolidField {
137
137
  {/* <div className="justify-content-center align-items-center"> */}
138
138
  {showFieldLabel != false &&
139
139
  <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
140
- {/* &nbsp;{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>} */}
140
+ {fieldMetadata.required && <span className="text-red-500"> *</span>}
141
+ {/* &nbsp;{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>} */}
141
142
  </label>
142
143
  }
143
144
 
@@ -0,0 +1,12 @@
1
+ const SolidTableRowCell = ({ value, truncateAfter }: { value: string; truncateAfter?: number }) => {
2
+ return (
3
+ <div
4
+ className="solid-table-row"
5
+ style={{ maxWidth: truncateAfter ? `${truncateAfter}ch` : '30ch' }}
6
+ >
7
+ {value}
8
+ </div>
9
+ );
10
+ };
11
+
12
+ export default SolidTableRowCell;
@@ -4,6 +4,7 @@ import { Column, ColumnFilterElementTemplateOptions } from "primereact/column";
4
4
  import { FormEvent } from "primereact/ts-helpers";
5
5
  import { getNumberOfInputs, SolidListViewColumnParams } from '../SolidListViewColumn';
6
6
  import { InputTypes, SolidVarInputsFilterElement } from "../SolidVarInputsFilterElement";
7
+ import SolidTableRowCell from '../SolidTableRowCell';
7
8
 
8
9
  export const dateFilterMatchModeOptions = [
9
10
  { label: 'Equals', value: FilterMatchMode.EQUALS },
@@ -39,6 +40,7 @@ const SolidDateColumn = ({ solidListViewMetaData, fieldMetadata, column }: Solid
39
40
  };
40
41
 
41
42
  // TODO: the body template to be controlled based on the format that one is expecting the date to be displayed in.
43
+ const truncateAfter = solidListViewMetaData?.data?.solidView?.layout?.attrs?.truncateAfter
42
44
  const header = column.attrs.label ?? fieldMetadata.displayName;
43
45
 
44
46
  return (
@@ -54,8 +56,14 @@ const SolidDateColumn = ({ solidListViewMetaData, fieldMetadata, column }: Solid
54
56
  filterMatchModeOptions={dateFilterMatchModeOptions}
55
57
  filterElement={filterTemplate}
56
58
  filterPlaceholder={`Search by ${fieldMetadata.displayName}`}
57
- style={{ minWidth: "12rem" }}
59
+ // style={{ minWidth: "12rem" }}
58
60
  headerClassName="table-header-fs"
61
+ body={(rowData) => (
62
+ <SolidTableRowCell
63
+ value={rowData[fieldMetadata.name]}
64
+ truncateAfter={truncateAfter}
65
+ />
66
+ )}
59
67
  ></Column>
60
68
  );
61
69
 
@@ -4,6 +4,7 @@ import { FormEvent } from "primereact/ts-helpers";
4
4
  import { getNumberOfInputs, SolidListViewColumnParams } from '../SolidListViewColumn';
5
5
  import { InputTypes, SolidVarInputsFilterElement } from "../SolidVarInputsFilterElement";
6
6
  import { dateFilterMatchModeOptions } from './SolidDateColumn';
7
+ import SolidTableRowCell from "../SolidTableRowCell";
7
8
 
8
9
  const SolidDatetimeColumn = ({ solidListViewMetaData, fieldMetadata, column }: SolidListViewColumnParams) => {
9
10
  const filterable = column.attrs.filterable;
@@ -27,6 +28,7 @@ const SolidDatetimeColumn = ({ solidListViewMetaData, fieldMetadata, column }: S
27
28
  };
28
29
 
29
30
  // TODO: the body template to be controlled based on the format that one is expecting the date to be displayed in.
31
+ const truncateAfter = solidListViewMetaData?.data?.solidView?.layout?.attrs?.truncateAfter
30
32
  const header = column.attrs.label ?? fieldMetadata.displayName;
31
33
 
32
34
  return (
@@ -42,8 +44,14 @@ const SolidDatetimeColumn = ({ solidListViewMetaData, fieldMetadata, column }: S
42
44
  filterMatchModeOptions={dateFilterMatchModeOptions}
43
45
  filterElement={filterTemplate}
44
46
  filterPlaceholder={`Search by ${fieldMetadata.displayName}`}
45
- style={{ minWidth: "12rem" }}
47
+ // style={{ minWidth: "12rem" }}
46
48
  headerClassName="table-header-fs"
49
+ body={(rowData) => (
50
+ <SolidTableRowCell
51
+ value={rowData[fieldMetadata.name]}
52
+ truncateAfter={truncateAfter}
53
+ />
54
+ )}
47
55
  ></Column>
48
56
  );
49
57
 
@@ -5,6 +5,7 @@ import { InputTypes, SolidVarInputsFilterElement } from "../SolidVarInputsFilter
5
5
  import { SolidListViewColumnParams } from '../SolidListViewColumn';
6
6
  import { FormEvent } from "primereact/ts-helpers";
7
7
  import { FilterMatchMode } from 'primereact/api';
8
+ import SolidTableRowCell from '../SolidTableRowCell';
8
9
 
9
10
  const SolidExternalIdColumn = ({ solidListViewMetaData, fieldMetadata, column }: SolidListViewColumnParams) => {
10
11
  const filterable = column.attrs.filterable;
@@ -28,6 +29,8 @@ const SolidExternalIdColumn = ({ solidListViewMetaData, fieldMetadata, column }:
28
29
  </SolidVarInputsFilterElement>
29
30
  )
30
31
  }
32
+
33
+ const truncateAfter = solidListViewMetaData?.data?.solidView?.layout?.attrs?.truncateAfter
31
34
  const header = column.attrs.label ?? fieldMetadata.displayName;
32
35
 
33
36
  return (
@@ -43,8 +46,14 @@ const SolidExternalIdColumn = ({ solidListViewMetaData, fieldMetadata, column }:
43
46
  filterMatchModeOptions={filterMatchModeOptions}
44
47
  filterElement={filterTemplate}
45
48
  filterPlaceholder={`Search by ${fieldMetadata.displayName}`}
46
- style={{ minWidth: "12rem" }}
49
+ // style={{ minWidth: "12rem" }}
47
50
  headerClassName="table-header-fs"
51
+ body={(rowData) => (
52
+ <SolidTableRowCell
53
+ value={rowData[fieldMetadata.name]}
54
+ truncateAfter={truncateAfter}
55
+ />
56
+ )}
48
57
  ></Column>
49
58
  );
50
59
 
@@ -4,6 +4,7 @@ import { Column, ColumnFilterElementTemplateOptions } from "primereact/column";
4
4
  import { FormEvent } from "primereact/ts-helpers";
5
5
  import { SolidListViewColumnParams } from '../SolidListViewColumn';
6
6
  import { InputTypes, SolidVarInputsFilterElement } from "../SolidVarInputsFilterElement";
7
+ import SolidTableRowCell from '../SolidTableRowCell';
7
8
 
8
9
  const SolidIdColumn = ({ solidListViewMetaData, fieldMetadata, column }: SolidListViewColumnParams) => {
9
10
  const filterable = column.filterable;
@@ -27,8 +28,9 @@ const SolidIdColumn = ({ solidListViewMetaData, fieldMetadata, column }: SolidLi
27
28
  </SolidVarInputsFilterElement>
28
29
  )
29
30
  }
30
- const header = column.attrs.label ?? fieldMetadata.displayName;
31
31
 
32
+ const truncateAfter = solidListViewMetaData?.data?.solidView?.layout?.attrs?.truncateAfter
33
+ const header = column.attrs.label ?? fieldMetadata.displayName;
32
34
 
33
35
  return (
34
36
  <Column
@@ -43,8 +45,14 @@ const SolidIdColumn = ({ solidListViewMetaData, fieldMetadata, column }: SolidLi
43
45
  filterMatchModeOptions={filterMatchModeOptions}
44
46
  filterElement={filterTemplate}
45
47
  filterPlaceholder={`Search by ${fieldMetadata.displayName}`}
46
- style={{ minWidth: "12rem" }}
48
+ // style={{ minWidth: "12rem" }}
47
49
  headerClassName="table-header-fs"
50
+ body={(rowData) => (
51
+ <SolidTableRowCell
52
+ value={rowData[fieldMetadata.name]}
53
+ truncateAfter={truncateAfter}
54
+ />
55
+ )}
48
56
  ></Column>
49
57
  );
50
58