@solidstarters/solid-core-ui 1.1.6 → 1.1.8

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 (179) hide show
  1. package/dist/components/auth/SolidChangeForcePassword.d.ts.map +1 -1
  2. package/dist/components/auth/SolidChangeForcePassword.js +7 -7
  3. package/dist/components/auth/SolidChangeForcePassword.js.map +1 -1
  4. package/dist/components/auth/SolidForgotPassword.d.ts.map +1 -1
  5. package/dist/components/auth/SolidForgotPassword.js +9 -4
  6. package/dist/components/auth/SolidForgotPassword.js.map +1 -1
  7. package/dist/components/auth/SolidLogin.d.ts.map +1 -1
  8. package/dist/components/auth/SolidLogin.js +13 -6
  9. package/dist/components/auth/SolidLogin.js.map +1 -1
  10. package/dist/components/common/BackButton.d.ts +2 -0
  11. package/dist/components/common/BackButton.d.ts.map +1 -0
  12. package/dist/components/common/BackButton.js +17 -0
  13. package/dist/components/common/BackButton.js.map +1 -0
  14. package/dist/components/common/CancelButton.js +2 -2
  15. package/dist/components/common/CancelButton.js.map +1 -1
  16. package/dist/components/common/DropzonePlaceholder.d.ts.map +1 -1
  17. package/dist/components/common/DropzonePlaceholder.js +2 -1
  18. package/dist/components/common/DropzonePlaceholder.js.map +1 -1
  19. package/dist/components/common/FileReaderExt.d.ts +4 -0
  20. package/dist/components/common/FileReaderExt.d.ts.map +1 -0
  21. package/dist/components/common/FileReaderExt.js +15 -0
  22. package/dist/components/common/FileReaderExt.js.map +1 -0
  23. package/dist/components/common/GeneralSettings.d.ts +4 -0
  24. package/dist/components/common/GeneralSettings.d.ts.map +1 -0
  25. package/dist/components/common/GeneralSettings.js +139 -0
  26. package/dist/components/common/GeneralSettings.js.map +1 -0
  27. package/dist/components/common/SingleSelectAutoCompleteField.d.ts.map +1 -1
  28. package/dist/components/common/SingleSelectAutoCompleteField.js +1 -1
  29. package/dist/components/common/SingleSelectAutoCompleteField.js.map +1 -1
  30. package/dist/components/common/SolidFormStepper.d.ts +2 -0
  31. package/dist/components/common/SolidFormStepper.d.ts.map +1 -0
  32. package/dist/components/common/SolidFormStepper.js +6 -0
  33. package/dist/components/common/SolidFormStepper.js.map +1 -0
  34. package/dist/components/core/common/LoadDynamicJsxComponent.d.ts.map +1 -1
  35. package/dist/components/core/common/LoadDynamicJsxComponent.js +2 -1
  36. package/dist/components/core/common/LoadDynamicJsxComponent.js.map +1 -1
  37. package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
  38. package/dist/components/core/common/SolidGlobalSearchElement.js +6 -5
  39. package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
  40. package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.d.ts +2 -1
  41. package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.d.ts.map +1 -1
  42. package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.js +4 -3
  43. package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.js.map +1 -1
  44. package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
  45. package/dist/components/core/form/SolidFormView.js +83 -54
  46. package/dist/components/core/form/SolidFormView.js.map +1 -1
  47. package/dist/components/core/form/fields/SolidBooleanField.d.ts.map +1 -1
  48. package/dist/components/core/form/fields/SolidBooleanField.js +4 -4
  49. package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
  50. package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
  51. package/dist/components/core/form/fields/SolidDateField.js +7 -7
  52. package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
  53. package/dist/components/core/form/fields/SolidDateTimeField.d.ts.map +1 -1
  54. package/dist/components/core/form/fields/SolidDateTimeField.js +7 -7
  55. package/dist/components/core/form/fields/SolidDateTimeField.js.map +1 -1
  56. package/dist/components/core/form/fields/SolidDecimalField.d.ts.map +1 -1
  57. package/dist/components/core/form/fields/SolidDecimalField.js +4 -4
  58. package/dist/components/core/form/fields/SolidDecimalField.js.map +1 -1
  59. package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
  60. package/dist/components/core/form/fields/SolidIntegerField.js +4 -4
  61. package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
  62. package/dist/components/core/form/fields/SolidJsonField.d.ts.map +1 -1
  63. package/dist/components/core/form/fields/SolidJsonField.js +2 -2
  64. package/dist/components/core/form/fields/SolidJsonField.js.map +1 -1
  65. package/dist/components/core/form/fields/SolidLongTextField.d.ts.map +1 -1
  66. package/dist/components/core/form/fields/SolidLongTextField.js +2 -2
  67. package/dist/components/core/form/fields/SolidLongTextField.js.map +1 -1
  68. package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
  69. package/dist/components/core/form/fields/SolidMediaMultipleField.js +11 -11
  70. package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
  71. package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
  72. package/dist/components/core/form/fields/SolidMediaSingleField.js +13 -13
  73. package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
  74. package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
  75. package/dist/components/core/form/fields/SolidRichTextField.js +2 -2
  76. package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
  77. package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts.map +1 -1
  78. package/dist/components/core/form/fields/SolidSelectionDynamicField.js +4 -4
  79. package/dist/components/core/form/fields/SolidSelectionDynamicField.js.map +1 -1
  80. package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts.map +1 -1
  81. package/dist/components/core/form/fields/SolidSelectionStaticField.js +4 -4
  82. package/dist/components/core/form/fields/SolidSelectionStaticField.js.map +1 -1
  83. package/dist/components/core/form/fields/SolidShortTextField.d.ts.map +1 -1
  84. package/dist/components/core/form/fields/SolidShortTextField.js +2 -2
  85. package/dist/components/core/form/fields/SolidShortTextField.js.map +1 -1
  86. package/dist/components/core/form/fields/SolidTimeField.d.ts.map +1 -1
  87. package/dist/components/core/form/fields/SolidTimeField.js +7 -7
  88. package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
  89. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
  90. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +15 -14
  91. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
  92. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
  93. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +2 -2
  94. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
  95. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +2 -2
  96. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
  97. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  98. package/dist/components/core/list/SolidListView.js +99 -21
  99. package/dist/components/core/list/SolidListView.js.map +1 -1
  100. package/dist/components/core/model/CreateModel.d.ts.map +1 -1
  101. package/dist/components/core/model/CreateModel.js +15 -11
  102. package/dist/components/core/model/CreateModel.js.map +1 -1
  103. package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
  104. package/dist/components/core/model/FieldMetaData.js +6 -6
  105. package/dist/components/core/model/FieldMetaData.js.map +1 -1
  106. package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
  107. package/dist/components/core/model/FieldMetaDataForm.js +189 -176
  108. package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
  109. package/dist/components/core/model/FieldSelector.d.ts.map +1 -1
  110. package/dist/components/core/model/FieldSelector.js +1 -1
  111. package/dist/components/core/model/FieldSelector.js.map +1 -1
  112. package/dist/components/core/model/ModelMetaData.d.ts.map +1 -1
  113. package/dist/components/core/model/ModelMetaData.js +55 -44
  114. package/dist/components/core/model/ModelMetaData.js.map +1 -1
  115. package/dist/components/core/module/CreateModule.d.ts.map +1 -1
  116. package/dist/components/core/module/CreateModule.js +98 -60
  117. package/dist/components/core/module/CreateModule.js.map +1 -1
  118. package/dist/components/core/users/CreateUser.d.ts.map +1 -1
  119. package/dist/components/core/users/CreateUser.js +18 -15
  120. package/dist/components/core/users/CreateUser.js.map +1 -1
  121. package/dist/components/layout/user-profile-menu.d.ts.map +1 -1
  122. package/dist/components/layout/user-profile-menu.js +3 -1
  123. package/dist/components/layout/user-profile-menu.js.map +1 -1
  124. package/dist/index.d.ts +6 -0
  125. package/dist/index.d.ts.map +1 -1
  126. package/dist/index.js +6 -0
  127. package/dist/index.js.map +1 -1
  128. package/dist/redux/api/solidEntityApi.d.ts +2 -0
  129. package/dist/redux/api/solidEntityApi.d.ts.map +1 -1
  130. package/dist/redux/api/solidEntityApi.js +10 -0
  131. package/dist/redux/api/solidEntityApi.js.map +1 -1
  132. package/dist/redux/api/solidSettingsApi.d.ts +9 -0
  133. package/dist/redux/api/solidSettingsApi.d.ts.map +1 -0
  134. package/dist/redux/api/solidSettingsApi.js +40 -0
  135. package/dist/redux/api/solidSettingsApi.js.map +1 -0
  136. package/package.json +1 -1
  137. package/src/components/auth/SolidChangeForcePassword.tsx +2 -3
  138. package/src/components/auth/SolidForgotPassword.tsx +9 -4
  139. package/src/components/auth/SolidLogin.tsx +21 -12
  140. package/src/components/common/BackButton.tsx +27 -0
  141. package/src/components/common/CancelButton.tsx +2 -2
  142. package/src/components/common/DropzonePlaceholder.tsx +11 -3
  143. package/src/components/common/FileReaderExt.tsx +18 -0
  144. package/src/components/common/GeneralSettings.tsx +286 -0
  145. package/src/components/common/SingleSelectAutoCompleteField.tsx +0 -1
  146. package/src/components/common/SolidFormStepper.tsx +12 -0
  147. package/src/components/core/common/LoadDynamicJsxComponent.tsx +2 -1
  148. package/src/components/core/common/SolidGlobalSearchElement.tsx +6 -2
  149. package/src/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx +4 -4
  150. package/src/components/core/form/SolidFormView.tsx +201 -186
  151. package/src/components/core/form/fields/SolidBooleanField.tsx +3 -7
  152. package/src/components/core/form/fields/SolidDateField.tsx +2 -8
  153. package/src/components/core/form/fields/SolidDateTimeField.tsx +19 -24
  154. package/src/components/core/form/fields/SolidDecimalField.tsx +2 -7
  155. package/src/components/core/form/fields/SolidIntegerField.tsx +17 -22
  156. package/src/components/core/form/fields/SolidJsonField.tsx +15 -19
  157. package/src/components/core/form/fields/SolidLongTextField.tsx +19 -24
  158. package/src/components/core/form/fields/SolidMediaMultipleField.tsx +47 -51
  159. package/src/components/core/form/fields/SolidMediaSingleField.tsx +47 -51
  160. package/src/components/core/form/fields/SolidRichTextField.tsx +3 -7
  161. package/src/components/core/form/fields/SolidSelectionDynamicField.tsx +2 -7
  162. package/src/components/core/form/fields/SolidSelectionStaticField.tsx +20 -25
  163. package/src/components/core/form/fields/SolidShortTextField.tsx +18 -23
  164. package/src/components/core/form/fields/SolidTimeField.tsx +19 -24
  165. package/src/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +51 -52
  166. package/src/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +20 -25
  167. package/src/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +6 -5
  168. package/src/components/core/list/SolidListView.tsx +118 -8
  169. package/src/components/core/model/CreateModel.tsx +68 -53
  170. package/src/components/core/model/FieldMetaData.tsx +16 -21
  171. package/src/components/core/model/FieldMetaDataForm.tsx +803 -895
  172. package/src/components/core/model/FieldSelector.tsx +10 -15
  173. package/src/components/core/model/ModelMetaData.tsx +373 -358
  174. package/src/components/core/module/CreateModule.tsx +327 -295
  175. package/src/components/core/users/CreateUser.tsx +175 -167
  176. package/src/components/layout/user-profile-menu.tsx +6 -1
  177. package/src/index.ts +6 -2
  178. package/src/redux/api/solidEntityApi.tsx +11 -0
  179. package/src/redux/api/solidSettingsApi.tsx +47 -0
@@ -41,7 +41,7 @@ export class SolidTimeField implements ISolidField {
41
41
  render(formik: FormikObject) {
42
42
  const fieldMetadata = this.fieldContext.fieldMetadata;
43
43
  const fieldLayoutInfo = this.fieldContext.field;
44
- const className = fieldLayoutInfo.attrs?.className || 'col-12 s-field';
44
+ const className = fieldLayoutInfo.attrs?.className || 'field col-6 flex flex-column gap-2 mt-4';
45
45
  const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
46
46
  const calendarRef = useRef<any>(null); // Reference for the Calendar component
47
47
  const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
@@ -54,31 +54,26 @@ export class SolidTimeField implements ISolidField {
54
54
 
55
55
  return (
56
56
  <div className={className}>
57
- <div className="justify-content-center align-items-center">
58
- <label htmlFor={fieldLayoutInfo.attrs.name}>{fieldLabel}
57
+ <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
59
58
 
60
- &nbsp; {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
61
- </label>
62
- </div>
63
- <div className="flex-auto">
64
- <Calendar
65
- disabled={formDisabled || fieldDisabled}
66
- ref={calendarRef} // Attach ref to Calendar
67
- id={fieldLayoutInfo.attrs.name}
68
- aria-describedby={`${fieldLayoutInfo.attrs.name}-help`}
69
- onChange={formik.handleChange}
70
- //@ts-ignore
71
- value={formik.values[fieldLayoutInfo.attrs.name] ? formik.values[fieldLayoutInfo.attrs.name] : Date()}
72
- // dateFormat="mm/dd/yy"
73
- // placeholder="mm/dd/yyyy hh:mm"
74
- hideOnDateTimeSelect
75
- timeOnly
76
- showTime className=""
77
- hourFormat="24"
78
-
79
- />
80
- </div>
59
+ &nbsp; {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
60
+ </label>
61
+ <Calendar
62
+ disabled={formDisabled || fieldDisabled}
63
+ ref={calendarRef} // Attach ref to Calendar
64
+ id={fieldLayoutInfo.attrs.name}
65
+ aria-describedby={`${fieldLayoutInfo.attrs.name}-help`}
66
+ onChange={formik.handleChange}
67
+ //@ts-ignore
68
+ value={formik.values[fieldLayoutInfo.attrs.name] ? formik.values[fieldLayoutInfo.attrs.name] : Date()}
69
+ // dateFormat="mm/dd/yy"
70
+ // placeholder="mm/dd/yyyy hh:mm"
71
+ hideOnDateTimeSelect
72
+ timeOnly
73
+ showTime className=""
74
+ hourFormat="24"
81
75
 
76
+ />
82
77
  {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
83
78
  <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
84
79
  )}
@@ -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 || 'col-12 s-field';
100
+ const className = fieldLayoutInfo.attrs?.className || 'field col-6 flex flex-column gap-2 mt-4';
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;
@@ -115,24 +115,26 @@ export class SolidRelationManyToManyField implements ISolidField {
115
115
 
116
116
 
117
117
  return (
118
- <div className={className}>
119
- <div className="s-input">
120
- {fieldLayoutInfo.attrs.renderMode === "checkbox" &&
121
- this.renderCheckBoxMode(formik, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
122
- }
123
- {(!fieldLayoutInfo.attrs.renderMode || fieldLayoutInfo.attrs.renderMode === "autocomplete") &&
124
- this.renderAutoCompleteMode(formik, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
125
- }
126
- {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />)}
127
- </div>
128
- </div>
118
+ <>
119
+ {/* <div className={className}> */}
120
+ {fieldLayoutInfo.attrs.renderMode === "checkbox" &&
121
+ <div className={className}>
122
+ {this.renderCheckBoxMode(formik, visibleCreateRelationEntity, setvisibleCreateRelationEntity)}
123
+ </div>
124
+ }
125
+ {(!fieldLayoutInfo.attrs.renderMode || fieldLayoutInfo.attrs.renderMode === "autocomplete") &&
126
+ this.renderAutoCompleteMode(formik, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
127
+ }
128
+ {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />)}
129
+ {/* </div> */}
130
+ </>
129
131
  );
130
132
  }
131
133
 
132
134
  renderCheckBoxMode(formik: FormikObject, visibleCreateRelationEntity: any, setvisibleCreateRelationEntity: any) {
133
135
  const fieldMetadata = this.fieldContext.fieldMetadata;
134
136
  const fieldLayoutInfo = this.fieldContext.field;
135
- const className = fieldLayoutInfo.attrs?.className || 'col-12 s-field';
137
+ const className = fieldLayoutInfo.attrs?.className || 'field col-6 flex flex-column gap-2 mt-4';
136
138
  const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
137
139
 
138
140
  // auto complete specific code.
@@ -232,8 +234,10 @@ export class SolidRelationManyToManyField implements ISolidField {
232
234
 
233
235
  return (
234
236
  <div className={className}>
235
- <div className="flex align-items-center gap-2">
236
- {capitalize(fieldLayoutInfo.attrs.name)}
237
+ <div className="flex align-items-center gap-3">
238
+ <label className="form-field-label">
239
+ {capitalize(fieldLayoutInfo.attrs.name)}
240
+ </label>
237
241
  {fieldLayoutInfo.attrs.inlineCreate === "true" &&
238
242
  this.renderSolidFormEmbededView(formik, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
239
243
  }
@@ -259,18 +263,18 @@ export class SolidRelationManyToManyField implements ISolidField {
259
263
  return (
260
264
  <div>
261
265
 
262
- <Panel toggleable headerTemplate={headerTemplate} style={{ marginBottom: "30px" }}>
266
+ <Panel toggleable headerTemplate={headerTemplate}>
263
267
 
264
- <div style={{ display: "grid", gridTemplateColumns: "auto auto" }}>
265
- {autoCompleteItems && autoCompleteItems.map((a: any) => {
268
+ <div className="formgrid grid">
269
+ {autoCompleteItems && autoCompleteItems.map((a: any, i: number) => {
266
270
  return (
267
- <div key={a.label} className="p-field-checkbox many-to-many-checkbox md:col-6 sm:col-12">
271
+ <div key={a.label} className={`field col-6 flex gap-2 ${i >= 2 ? 'mt-3' : ''}`}>
268
272
  <Checkbox
269
273
  inputId={a.label}
270
274
  checked={formik.values[fieldLayoutInfo.attrs.name].some((item: any) => item.label === a.label)}
271
275
  onChange={() => handleCheckboxChange(a)}
272
276
  />
273
- <label htmlFor={a.label}> {a.label}</label>
277
+ <label htmlFor={a.label} className="form-field-label m-0"> {a.label}</label>
274
278
  </div>
275
279
  )
276
280
  })}
@@ -285,7 +289,7 @@ export class SolidRelationManyToManyField implements ISolidField {
285
289
  renderAutoCompleteMode(formik: FormikObject, visibleCreateRelationEntity: any, setvisibleCreateRelationEntity: any) {
286
290
  const fieldMetadata = this.fieldContext.fieldMetadata;
287
291
  const fieldLayoutInfo = this.fieldContext.field;
288
- const className = fieldLayoutInfo.attrs?.className || 'col-12 s-field';
292
+ const className = fieldLayoutInfo.attrs?.className || 'field col-6 flex flex-column gap-2 mt-4';
289
293
  const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
290
294
 
291
295
  // auto complete specific code.
@@ -354,32 +358,24 @@ export class SolidRelationManyToManyField implements ISolidField {
354
358
 
355
359
  return (
356
360
  <div className={className}>
357
- <div className="justify-content-center align-items-center">
358
- <label htmlFor={fieldLayoutInfo.attrs.name}>{fieldLabel}
359
-
360
- </label>
361
- </div>
362
- <div className="s-input">
363
- <div className="flex align-items-center justify-content-center">
364
- <AutoComplete
365
- readOnly={readOnly}
366
- disabled={disabled}
367
- multiple
368
- {...formik.getFieldProps(fieldLayoutInfo.attrs.name)}
369
- id={fieldLayoutInfo.attrs.name}
370
- field="label"
371
- value={formik.values[fieldLayoutInfo.attrs.name] || ''}
372
- dropdown
373
- className="w-full autocomplete-small-input"
374
- suggestions={autoCompleteItems}
375
- completeMethod={autoCompleteSearch}
376
- onChange={formik.handleChange} />
377
- {fieldLayoutInfo.attrs.inlineCreate === "true" &&
378
- this.renderSolidFormEmbededView(formik, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
379
- }
380
- </div>
381
-
382
- </div>
361
+ <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
362
+
363
+ </label>
364
+ <AutoComplete
365
+ readOnly={readOnly}
366
+ disabled={disabled}
367
+ multiple
368
+ {...formik.getFieldProps(fieldLayoutInfo.attrs.name)}
369
+ id={fieldLayoutInfo.attrs.name}
370
+ field="label"
371
+ value={formik.values[fieldLayoutInfo.attrs.name] || ''}
372
+ dropdown
373
+ suggestions={autoCompleteItems}
374
+ completeMethod={autoCompleteSearch}
375
+ onChange={formik.handleChange} />
376
+ {fieldLayoutInfo.attrs.inlineCreate === "true" &&
377
+ this.renderSolidFormEmbededView(formik, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
378
+ }
383
379
  </div>
384
380
  );
385
381
  }
@@ -388,7 +384,7 @@ export class SolidRelationManyToManyField implements ISolidField {
388
384
 
389
385
  const fieldMetadata = this.fieldContext.fieldMetadata;
390
386
  const fieldLayoutInfo = this.fieldContext.field;
391
- const className = fieldLayoutInfo.attrs?.className || 'col-12 s-field';
387
+ const className = fieldLayoutInfo.attrs?.className || 'field col-6 flex flex-column gap-2 mt-4';
392
388
  const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
393
389
 
394
390
  const params = {
@@ -406,22 +402,25 @@ export class SolidRelationManyToManyField implements ISolidField {
406
402
  }),
407
403
  modelName: camelCase(this.fieldContext.fieldMetadata.relationModelSingularName)
408
404
  }
405
+ // console.log("fieldLayoutInfo?.attrs?.inlineCreateLayout?.attrs?.width ", fieldLayoutInfo?.attrs?.inlineCreateLayout?.attrs?.width);
409
406
 
410
407
  return (
411
- <div className="many-to-many-add" >
412
- <Button icon="pi pi-plus"
408
+ <div >
409
+ <Button
410
+ icon="pi pi-plus"
413
411
  rounded
414
412
  outlined
415
413
  aria-label="Filter"
416
414
  type="button"
415
+ size="small"
417
416
  onClick={() => setvisibleCreateRelationEntity(true)}
417
+ className="custom-add-button"
418
418
  />
419
419
  <Dialog
420
420
  header=""
421
421
  showHeader={false}
422
422
  visible={visibleCreateRelationEntity}
423
- className="many-to-many-creat-form-dialog"
424
- style={{ width: fieldLayoutInfo?.attrs?.inlineCreateLayout?.attrs?.width ?? "40vw" }}
423
+ style={{ width: fieldLayoutInfo?.attrs?.inlineCreateLayout?.attrs?.width ?? "60vw" }}
425
424
  onHide={() => {
426
425
  if (!visibleCreateRelationEntity) return;
427
426
  setvisibleCreateRelationEntity(false);
@@ -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 || 'col-12 s-field';
57
+ const className = fieldLayoutInfo.attrs?.className || 'field col-6 flex flex-column gap-2 mt-4';
58
58
  const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
59
59
  const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
60
60
 
@@ -103,35 +103,30 @@ export class SolidRelationManyToOneField implements ISolidField {
103
103
  setAutoCompleteItems(autoCompleteItems);
104
104
  }
105
105
  }
106
- console.log("formik",formik.values);
106
+ console.log("formik", formik.values);
107
107
 
108
108
  const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
109
109
 
110
110
  return (
111
111
  <div className={className}>
112
- <div className="justify-content-center align-items-center">
113
- <label htmlFor={fieldLayoutInfo.attrs.name}>{fieldLabel}
114
-
115
- </label>
116
- </div>
117
- <div className="s-input">
118
- <AutoComplete
119
- readOnly={formReadonly || fieldReadonly}
120
- disabled={formDisabled || fieldDisabled}
121
- {...formik.getFieldProps(fieldLayoutInfo.attrs.name)}
122
- id={fieldLayoutInfo.attrs.name}
123
- field="label"
124
- value={formik.values[fieldLayoutInfo.attrs.name] || ''}
125
- dropdown
126
- className="w-full small-input"
127
- suggestions={autoCompleteItems}
128
- completeMethod={autoCompleteSearch}
129
- onChange={formik.handleChange} />
130
-
131
- {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
132
- <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
133
- )}
134
- </div>
112
+ <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
113
+
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
+ {isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
128
+ <Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
129
+ )}
135
130
  </div>
136
131
  );
137
132
  }
@@ -54,7 +54,7 @@ export class SolidRelationOneToManyField implements ISolidField {
54
54
  const fieldMetadata = this.fieldContext.fieldMetadata;
55
55
 
56
56
  const fieldLayoutInfo = this.fieldContext.field;
57
- const className = fieldLayoutInfo.attrs?.className || 'col-12 s-field';
57
+ const className = fieldLayoutInfo.attrs?.className || 'field col-12 flex flex-column gap-2 mt-3';
58
58
  const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
59
59
  const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
60
60
  const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
@@ -132,10 +132,10 @@ export class SolidRelationOneToManyField implements ISolidField {
132
132
 
133
133
  return (
134
134
  <div className={className}>
135
- <div className="justify-content-center align-items-center">
136
- <label htmlFor={fieldLayoutInfo.attrs.name}>{fieldLabel}&nbsp;{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}</label>
137
- </div>
138
- <br></br>
135
+ {/* <div className="justify-content-center align-items-center"> */}
136
+ <label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}&nbsp;{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}</label>
137
+ {/* </div>
138
+ <br></br> */}
139
139
  {listViewParams &&
140
140
  <SolidListView key={refreshList.toString()} {...listViewParams} handlePopUpOpen={handlePopupOpen} />
141
141
  }
@@ -183,3 +183,4 @@ export class SolidRelationOneToManyField implements ISolidField {
183
183
  )
184
184
  }
185
185
  }
186
+
@@ -30,6 +30,7 @@ import { SolidLayoutViews } from '../common/SolidLayoutViews'
30
30
  import { SolidConfigureLayoutElement } from '../common/SolidConfigureLayoutElement'
31
31
  import { FilterIcon } from '../../modelsComponents/filterIcon';
32
32
  import { OverlayPanel } from "primereact/overlaypanel";
33
+ import { Toast } from "primereact/toast";
33
34
  const getRandomInt = (min: number, max: number) => {
34
35
  return Math.floor(Math.random() * (max - min + 1)) + min;
35
36
  }
@@ -94,7 +95,10 @@ export const SolidListView = (params: SolidListViewParams) => {
94
95
  useLazyGetSolidEntitiesQuery,
95
96
  useLazyGetSolidEntityByIdQuery,
96
97
  usePrefetch,
97
- useUpdateSolidEntityMutation
98
+ useUpdateSolidEntityMutation,
99
+ useRecoverSolidEntityByIdQuery,
100
+ useLazyRecoverSolidEntityByIdQuery,
101
+ useRecoverSolidEntityMutation
98
102
  } = entityApi;
99
103
 
100
104
  // Get the list view layout & metadata first.
@@ -110,7 +114,6 @@ export const SolidListView = (params: SolidListViewParams) => {
110
114
  refetch
111
115
  } = useGetSolidViewLayoutQuery(listViewMetaDataQs);
112
116
 
113
-
114
117
  const initialFilterMethod = () => {
115
118
 
116
119
  const solidView = solidListViewMetaData.data.solidView;
@@ -179,24 +182,30 @@ export const SolidListView = (params: SolidListViewParams) => {
179
182
  const [sortField, setSortField] = useState("");
180
183
  const [sortOrder, setSortOrder] = useState(0);
181
184
  const [selectedRecords, setSelectedRecords] = useState<any[]>([]);
185
+ const [selectedRecoverRecords, setSelectedRecoverRecords] = useState<any[]>([]);
182
186
  const [loading, setLoading] = useState<boolean>(true);
183
187
  const [isDialogVisible, setDialogVisible] = useState(false);
188
+ const [isRecoverDialogVisible, setRecoverDialogVisible] = useState(false);
184
189
  const [createButtonUrl, setCreateButtonUrl] = useState<string>();
185
190
  const [editButtonUrl, setEditButtonUrl] = useState<string>();
191
+ const [showArchived, setShowArchived] = useState(false);
186
192
 
187
193
  // Custom Row Action
188
194
  const [listViewRowActionPopupState, setListViewRowActionPopupState] = useState(false);
189
195
  const [listViewRowActionData, setListRowActionData] = useState<any>();
190
196
 
197
+ const toast = useRef<Toast>(null);
198
+
191
199
  // Get the list view data.
192
200
  const [triggerGetSolidEntities, { data: solidEntityListViewData, isLoading, error }] = useLazyGetSolidEntitiesQuery();
193
201
 
202
+ const [triggerRecoverSolidEntitiesById, { data: recoverByIdData, isLoading: recoverByIdIsLoading, error: recoverByIdError, isError: recoverByIdIsError, isSuccess: recoverByIdIsSuccess }] = useLazyRecoverSolidEntityByIdQuery();
194
203
 
204
+ const [triggerRecoverSolidEntities, { data: recoverByData, isLoading: recoverByIsLoading, error: recoverError, isError: recoverIsError, isSuccess: recoverByIsSuccess }] = useRecoverSolidEntityMutation();
195
205
 
196
206
  // After data is fetched populate the list view state so as to be able to render the data.
197
207
  useEffect(() => {
198
208
  if (solidEntityListViewData) {
199
-
200
209
  setListViewData(solidEntityListViewData?.records);
201
210
  setTotalRecords(solidEntityListViewData?.meta.totalRecords);
202
211
  setLoading(false);
@@ -231,6 +240,27 @@ export const SolidListView = (params: SolidListViewParams) => {
231
240
  },
232
241
  ] = useDeleteMultipleSolidEntitiesMutation();
233
242
 
243
+ // Fetch Soft Deleted data
244
+ useEffect(() => {
245
+ const queryData = {
246
+ offset: 0,
247
+ limit: 25,
248
+ populate: toPopulate,
249
+ sort: [`id:desc`],
250
+ };
251
+ if (showArchived) {
252
+ queryData.showSoftDeleted = 'true';
253
+ }
254
+ const queryString = qs.stringify(queryData, {
255
+ encodeValuesOnly: true
256
+ });
257
+
258
+ triggerGetSolidEntities(queryString);
259
+ setSelectedRecords([]);
260
+ setSelectedRecoverRecords([]);
261
+ }, [showArchived, recoverByIdIsSuccess, recoverByIsSuccess]);
262
+
263
+
234
264
  // Fetch data after toPopulate has been populated...
235
265
  useEffect(() => {
236
266
  if (toPopulate) {
@@ -250,6 +280,8 @@ export const SolidListView = (params: SolidListViewParams) => {
250
280
 
251
281
  triggerGetSolidEntities(queryString);
252
282
  setSelectedRecords([]);
283
+ setSelectedRecoverRecords([]);
284
+ setShowArchived(false);
253
285
  }
254
286
  }, [isDeleteSolidEntitiesSucess, isDeleteSolidSingleEntitySuccess, toPopulate]);
255
287
 
@@ -279,7 +311,11 @@ export const SolidListView = (params: SolidListViewParams) => {
279
311
  // handle change in the records which are currently selected...
280
312
  const onSelectionChange = (event: any) => {
281
313
  const value = event.value;
282
- setSelectedRecords(value);
314
+ const activeRecords = value.filter((record: any) => record.deletedAt === null);
315
+ const deletedRecords = value.filter((record: any) => record.deletedAt !== null);
316
+
317
+ setSelectedRecords(activeRecords);
318
+ setSelectedRecoverRecords(deletedRecords);
283
319
  };
284
320
 
285
321
  const identifySolidOperatorAndValue = (primeReactMatchMode: FilterMatchMode, value: any): { operator: string, value: string | string[] | any[] } => {
@@ -475,6 +511,51 @@ export const SolidListView = (params: SolidListViewParams) => {
475
511
  );
476
512
  };
477
513
 
514
+ // Recover functions
515
+ const recoverById = (id) => {
516
+ triggerRecoverSolidEntitiesById(id);
517
+ }
518
+
519
+ const recoverAll = () => {
520
+ let recoverList: any = [];
521
+ selectedRecoverRecords.forEach((element: any) => {
522
+ recoverList.push(element.id);
523
+ });
524
+ triggerRecoverSolidEntities(recoverList);
525
+ setRecoverDialogVisible(false);
526
+ }
527
+
528
+ useEffect(() => {
529
+ if (recoverIsError || recoverByIdIsError) {
530
+ showError(recoverByIdIsError ? recoverByIdError : recoverError);
531
+ }
532
+ }, [recoverIsError, recoverByIdIsError])
533
+
534
+ const showError = async (error) => {
535
+ const errorMessages = error?.data?.message;
536
+ if (errorMessages.length > 0) {
537
+ toast?.current?.show({
538
+ severity: "error",
539
+ summary: "Can you send me the report?",
540
+ // sticky: true,
541
+ life: 3000,
542
+ //@ts-ignore
543
+ content: (props) => (
544
+ <div
545
+ className="flex flex-column align-items-left"
546
+ style={{ flex: "1" }}
547
+ >
548
+ {errorMessages.map((m, index) => (
549
+ <div className="flex align-items-center gap-2" key={index}>
550
+ <span className="font-bold text-900">{String(m)}</span>
551
+ </div>
552
+ ))}
553
+ </div>
554
+ ),
555
+ });
556
+ }
557
+ };
558
+
478
559
  // handle bulk deletion
479
560
  const deleteBulk = () => {
480
561
  let deleteList: any = [];
@@ -490,6 +571,7 @@ export const SolidListView = (params: SolidListViewParams) => {
490
571
  const onDeleteClose = () => {
491
572
  setDialogVisible(false);
492
573
  setSelectedRecords([]);
574
+ setSelectedRecoverRecords([]);
493
575
  }
494
576
 
495
577
  // Render columns dynamically based on metadata
@@ -542,6 +624,7 @@ export const SolidListView = (params: SolidListViewParams) => {
542
624
  return (
543
625
  <>
544
626
  <div className="page-header">
627
+ <Toast ref={toast} />
545
628
  <div className="flex gap-3 align-items-center">
546
629
 
547
630
 
@@ -566,7 +649,7 @@ export const SolidListView = (params: SolidListViewParams) => {
566
649
  }
567
650
 
568
651
  {solidListViewMetaData?.data?.solidView?.layout?.attrs?.enableGlobalSearch === true && params.embeded === false &&
569
- <SolidGlobalSearchElement ref={solidGlobalSearchElementRef} viewData={solidListViewMetaData} handleApplyCustomFilter={handleApplyCustomFilter} ></SolidGlobalSearchElement>
652
+ <SolidGlobalSearchElement ref={solidGlobalSearchElementRef} viewData={solidListViewMetaData} handleApplyCustomFilter={handleApplyCustomFilter} setShowArchived={setShowArchived} showArchived={showArchived}></SolidGlobalSearchElement>
570
653
  }
571
654
  </div>
572
655
  <div className="flex align-items-center gap-3">
@@ -580,6 +663,9 @@ export const SolidListView = (params: SolidListViewParams) => {
580
663
  onClick={() => params.handlePopUpOpen(true)}
581
664
  ></Button>
582
665
  }
666
+ {showArchived && <Button type="button" icon="pi pi-refresh" label="Recover" size='small' severity="warning"
667
+ onClick={() => setRecoverDialogVisible(true)}
668
+ ></Button>}
583
669
  <SolidLayoutViews
584
670
  sizeOptions={sizeOptions}
585
671
  setSize={setSize}
@@ -596,10 +682,13 @@ export const SolidListView = (params: SolidListViewParams) => {
596
682
  } */}
597
683
  </div>
598
684
  </div>
599
- <style>{`.p-datatable .p-datatable-loading-overlay {background-color: rgba(0, 0, 0, 0.0);}`}</style>
685
+ <style>{`.p-datatable .p-datatable-loading-overlay {background-color: rgba(0, 0, 0, 0.0);} .greyed-out-row { background-color: #f5f5f5 !important; color: #a0a0a0 !important; opacity: 0.6;}`}</style>
600
686
  <div className="solid-datatable-wrapper">
601
687
  <DataTable
602
688
  value={listViewData}
689
+ rowClassName={(rowData) => {
690
+ return rowData.deletedAt ? "greyed-out-row" : "";
691
+ }}
603
692
  showGridlines={false}
604
693
  lazy
605
694
  scrollable
@@ -620,7 +709,7 @@ export const SolidListView = (params: SolidListViewParams) => {
620
709
  sortOrder={sortOrder === 1 || sortOrder === -1 ? sortOrder : 0}
621
710
  loading={loading || isLoading}
622
711
  loadingIcon="pi pi-spinner"
623
- selection={selectedRecords}
712
+ selection={[...selectedRecords, ...selectedRecoverRecords]}
624
713
  onSelectionChange={onSelectionChange}
625
714
  selectionMode="multiple"
626
715
  removableSort
@@ -635,7 +724,14 @@ export const SolidListView = (params: SolidListViewParams) => {
635
724
 
636
725
  {renderColumnsDynamically(listViewMetaData)}
637
726
  {actionsAllowed.includes(`${updatePermission(params.modelName)}`) && solidListViewMetaData?.data?.solidView?.layout?.attrs?.edit !== false &&
638
- <Column body={detailsBodyTemplate} ></Column>
727
+ <Column body={(rowData) => (
728
+ rowData.deletedAt ? (
729
+ <a onClick={() => recoverById(rowData.id)} className="retrieve-button">
730
+ <i className="pi pi-refresh" style={{ fontSize: "1rem" }}/>
731
+ </a>
732
+ ) :
733
+ detailsBodyTemplate(rowData)
734
+ )}></Column>
639
735
  }
640
736
  {solidListViewMetaData?.data?.solidView?.layout?.attrs?.rowButtons &&
641
737
  solidListViewMetaData?.data?.solidView?.layout?.attrs?.rowButtons.map((rowAction: any) => {
@@ -678,6 +774,20 @@ export const SolidListView = (params: SolidListViewParams) => {
678
774
  <p>Are you sure you want to delete the selected records?</p>
679
775
  </Dialog>
680
776
 
777
+ <Dialog
778
+ visible={isRecoverDialogVisible}
779
+ header="Confirm Recover"
780
+ modal
781
+ footer={() => (
782
+ <div className="flex justify-content-center">
783
+ <Button label="Yes" icon="pi pi-check" className='small-button' severity="danger" autoFocus onClick={recoverAll} />
784
+ <Button label="No" icon="pi pi-times" className='small-button' onClick={() => setRecoverDialogVisible(false)} />
785
+ </div>
786
+ )}
787
+ onHide={() => setRecoverDialogVisible(false)}
788
+ >
789
+ <p>Are you sure you want to recover all records?</p>
790
+ </Dialog>
681
791
 
682
792
  {listViewRowActionData &&
683
793
  <Dialog