@solidxai/core-ui 0.1.12-beta.7 → 0.1.12-beta.9

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 (233) hide show
  1. package/dist/components/auth/AuthLayout.d.ts.map +1 -1
  2. package/dist/components/auth/AuthLayout.js +19 -17
  3. package/dist/components/auth/AuthLayout.js.map +1 -1
  4. package/dist/components/auth/AuthLayout.tsx +59 -34
  5. package/dist/components/common/BackendReconnectIndicator.d.ts +6 -0
  6. package/dist/components/common/BackendReconnectIndicator.d.ts.map +1 -0
  7. package/dist/components/common/BackendReconnectIndicator.js +25 -0
  8. package/dist/components/common/BackendReconnectIndicator.js.map +1 -0
  9. package/dist/components/common/BackendReconnectIndicator.tsx +45 -0
  10. package/dist/components/common/SettingsComponent.d.ts.map +1 -1
  11. package/dist/components/common/SettingsComponent.js +7 -3
  12. package/dist/components/common/SettingsComponent.js.map +1 -1
  13. package/dist/components/common/SettingsComponent.module.css +144 -12
  14. package/dist/components/common/SettingsComponent.tsx +22 -3
  15. package/dist/components/common/SolidAdmin.d.ts.map +1 -1
  16. package/dist/components/common/SolidAdmin.js +7 -2
  17. package/dist/components/common/SolidAdmin.js.map +1 -1
  18. package/dist/components/common/SolidAdmin.tsx +7 -2
  19. package/dist/components/common/SolidBreadcrumb.d.ts.map +1 -1
  20. package/dist/components/common/SolidBreadcrumb.js +1 -6
  21. package/dist/components/common/SolidBreadcrumb.js.map +1 -1
  22. package/dist/components/common/SolidBreadcrumb.tsx +1 -8
  23. package/dist/components/common/SolidMaterialSymbol.d.ts +10 -0
  24. package/dist/components/common/SolidMaterialSymbol.d.ts.map +1 -0
  25. package/dist/components/common/SolidMaterialSymbol.js +69 -0
  26. package/dist/components/common/SolidMaterialSymbol.js.map +1 -0
  27. package/dist/components/common/SolidMaterialSymbol.tsx +96 -0
  28. package/dist/components/common/SolidToastProvider.d.ts.map +1 -1
  29. package/dist/components/common/SolidToastProvider.js +14 -1
  30. package/dist/components/common/SolidToastProvider.js.map +1 -1
  31. package/dist/components/common/SolidToastProvider.tsx +19 -1
  32. package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.module.css +3 -1
  33. package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
  34. package/dist/components/core/common/SolidGlobalSearchElement.js +3 -2
  35. package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
  36. package/dist/components/core/common/SolidGlobalSearchElement.tsx +14 -18
  37. package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.d.ts.map +1 -1
  38. package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js +43 -16
  39. package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js.map +1 -1
  40. package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx +24 -2
  41. package/dist/components/core/form/SolidFormFooter.js +1 -1
  42. package/dist/components/core/form/SolidFormFooter.js.map +1 -1
  43. package/dist/components/core/form/SolidFormFooter.tsx +1 -1
  44. package/dist/components/core/form/SolidFormLayouts.js +1 -1
  45. package/dist/components/core/form/SolidFormLayouts.js.map +1 -1
  46. package/dist/components/core/form/SolidFormLayouts.tsx +2 -2
  47. package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
  48. package/dist/components/core/form/fields/SolidMediaMultipleField.js +120 -56
  49. package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
  50. package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +63 -50
  51. package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
  52. package/dist/components/core/form/fields/SolidMediaSingleField.js +115 -37
  53. package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
  54. package/dist/components/core/form/fields/SolidMediaSingleField.tsx +36 -35
  55. package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
  56. package/dist/components/core/form/fields/SolidRichTextField.js +54 -5
  57. package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
  58. package/dist/components/core/form/fields/SolidRichTextField.tsx +71 -7
  59. package/dist/components/core/form/fields/mediaFieldUtils.d.ts +3 -0
  60. package/dist/components/core/form/fields/mediaFieldUtils.d.ts.map +1 -0
  61. package/dist/components/core/form/fields/mediaFieldUtils.js +30 -0
  62. package/dist/components/core/form/fields/mediaFieldUtils.js.map +1 -0
  63. package/dist/components/core/form/fields/mediaFieldUtils.ts +45 -0
  64. package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.d.ts.map +1 -1
  65. package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.js +1 -1
  66. package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.js.map +1 -1
  67. package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.tsx +3 -1
  68. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
  69. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +22 -23
  70. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
  71. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +13 -7
  72. package/dist/components/core/form/fields/widgets/SolidIconEditWidget.d.ts.map +1 -1
  73. package/dist/components/core/form/fields/widgets/SolidIconEditWidget.js +16 -11
  74. package/dist/components/core/form/fields/widgets/SolidIconEditWidget.js.map +1 -1
  75. package/dist/components/core/form/fields/widgets/SolidIconEditWidget.tsx +32 -18
  76. package/dist/components/core/form/fields/widgets/SolidIconViewWidget.d.ts.map +1 -1
  77. package/dist/components/core/form/fields/widgets/SolidIconViewWidget.js +3 -1
  78. package/dist/components/core/form/fields/widgets/SolidIconViewWidget.js.map +1 -1
  79. package/dist/components/core/form/fields/widgets/SolidIconViewWidget.tsx +11 -5
  80. package/dist/components/core/list/SolidDataTable.d.ts.map +1 -1
  81. package/dist/components/core/list/SolidDataTable.js +3 -2
  82. package/dist/components/core/list/SolidDataTable.js.map +1 -1
  83. package/dist/components/core/list/SolidDataTable.tsx +3 -2
  84. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  85. package/dist/components/core/list/SolidListView.js +11 -5
  86. package/dist/components/core/list/SolidListView.js.map +1 -1
  87. package/dist/components/core/list/SolidListView.tsx +15 -8
  88. package/dist/components/core/list/SolidListViewColumn.d.ts.map +1 -1
  89. package/dist/components/core/list/SolidListViewColumn.js +1 -0
  90. package/dist/components/core/list/SolidListViewColumn.js.map +1 -1
  91. package/dist/components/core/list/SolidListViewColumn.tsx +1 -0
  92. package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
  93. package/dist/components/core/list/columns/SolidShortTextColumn.js +7 -2
  94. package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
  95. package/dist/components/core/list/columns/SolidShortTextColumn.tsx +7 -2
  96. package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.d.ts.map +1 -1
  97. package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.js +4 -1
  98. package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.js.map +1 -1
  99. package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.tsx +5 -2
  100. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts.map +1 -1
  101. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +2 -1
  102. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
  103. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +2 -1
  104. package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.d.ts.map +1 -1
  105. package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.js +4 -1
  106. package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.js.map +1 -1
  107. package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.tsx +5 -2
  108. package/dist/components/core/locales/SolidLocale.d.ts.map +1 -1
  109. package/dist/components/core/locales/SolidLocale.js +1 -1
  110. package/dist/components/core/locales/SolidLocale.js.map +1 -1
  111. package/dist/components/core/locales/SolidLocale.tsx +1 -0
  112. package/dist/components/core/model/CreateModel.css +26 -0
  113. package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
  114. package/dist/components/core/model/FieldMetaData.js +21 -3
  115. package/dist/components/core/model/FieldMetaData.js.map +1 -1
  116. package/dist/components/core/model/FieldMetaData.tsx +45 -4
  117. package/dist/components/core/model/FieldMetaDataForm.css +82 -0
  118. package/dist/components/core/model/FieldMetaDataForm.d.ts +1 -0
  119. package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
  120. package/dist/components/core/model/FieldMetaDataForm.js +246 -235
  121. package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
  122. package/dist/components/core/model/FieldMetaDataForm.tsx +46 -34
  123. package/dist/components/core/model/FieldSelector.js +1 -1
  124. package/dist/components/core/model/FieldSelector.js.map +1 -1
  125. package/dist/components/core/model/FieldSelector.tsx +1 -1
  126. package/dist/components/core/model/ModelMetaData.js +1 -1
  127. package/dist/components/core/model/ModelMetaData.js.map +1 -1
  128. package/dist/components/core/model/ModelMetaData.tsx +1 -1
  129. package/dist/components/core/module/CreateModule.css +55 -2
  130. package/dist/components/core/module/CreateModule.d.ts.map +1 -1
  131. package/dist/components/core/module/CreateModule.js +2 -2
  132. package/dist/components/core/module/CreateModule.js.map +1 -1
  133. package/dist/components/core/module/CreateModule.tsx +3 -2
  134. package/dist/components/core/module/ModuleMetadataExplorer.css +27 -0
  135. package/dist/components/core/module/ModuleMetadataExplorer.d.ts.map +1 -1
  136. package/dist/components/core/module/ModuleMetadataExplorer.js +1 -1
  137. package/dist/components/core/module/ModuleMetadataExplorer.js.map +1 -1
  138. package/dist/components/core/module/ModuleMetadataExplorer.tsx +1 -0
  139. package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
  140. package/dist/components/core/tree/SolidTreeView.js +6 -1
  141. package/dist/components/core/tree/SolidTreeView.js.map +1 -1
  142. package/dist/components/core/tree/SolidTreeView.tsx +7 -1
  143. package/dist/components/layout/AdminHeaderActions.d.ts.map +1 -1
  144. package/dist/components/layout/AdminHeaderActions.js +10 -9
  145. package/dist/components/layout/AdminHeaderActions.js.map +1 -1
  146. package/dist/components/layout/AdminHeaderActions.tsx +2 -0
  147. package/dist/components/layout/AppSidebar.d.ts.map +1 -1
  148. package/dist/components/layout/AppSidebar.js +2 -1
  149. package/dist/components/layout/AppSidebar.js.map +1 -1
  150. package/dist/components/layout/AppSidebar.tsx +12 -5
  151. package/dist/components/layout/SolidMenuItemIcon.d.ts +9 -0
  152. package/dist/components/layout/SolidMenuItemIcon.d.ts.map +1 -0
  153. package/dist/components/layout/SolidMenuItemIcon.js +20 -0
  154. package/dist/components/layout/SolidMenuItemIcon.js.map +1 -0
  155. package/dist/components/layout/SolidMenuItemIcon.tsx +45 -0
  156. package/dist/components/layout/navbar-two-menu.d.ts.map +1 -1
  157. package/dist/components/layout/navbar-two-menu.js +6 -7
  158. package/dist/components/layout/navbar-two-menu.js.map +1 -1
  159. package/dist/components/layout/navbar-two-menu.tsx +4 -12
  160. package/dist/components/shad-cn-ui/SolidCodeEditor.d.ts.map +1 -1
  161. package/dist/components/shad-cn-ui/SolidCodeEditor.js +30 -2
  162. package/dist/components/shad-cn-ui/SolidCodeEditor.js.map +1 -1
  163. package/dist/components/shad-cn-ui/SolidCodeEditor.tsx +38 -1
  164. package/dist/helpers/backendHealthMonitor.d.ts +39 -0
  165. package/dist/helpers/backendHealthMonitor.d.ts.map +1 -0
  166. package/dist/helpers/backendHealthMonitor.js +255 -0
  167. package/dist/helpers/backendHealthMonitor.js.map +1 -0
  168. package/dist/helpers/backendHealthMonitor.ts +177 -0
  169. package/dist/helpers/helpers.d.ts +1 -0
  170. package/dist/helpers/helpers.d.ts.map +1 -1
  171. package/dist/helpers/helpers.js +9 -0
  172. package/dist/helpers/helpers.js.map +1 -1
  173. package/dist/helpers/helpers.ts +11 -1
  174. package/dist/helpers/menuItemIcons.d.ts +34 -0
  175. package/dist/helpers/menuItemIcons.d.ts.map +1 -0
  176. package/dist/helpers/menuItemIcons.js +144 -0
  177. package/dist/helpers/menuItemIcons.js.map +1 -0
  178. package/dist/helpers/menuItemIcons.ts +191 -0
  179. package/dist/helpers/relationDisplay.d.ts +3 -0
  180. package/dist/helpers/relationDisplay.d.ts.map +1 -0
  181. package/dist/helpers/relationDisplay.js +92 -0
  182. package/dist/helpers/relationDisplay.js.map +1 -0
  183. package/dist/helpers/relationDisplay.ts +101 -0
  184. package/dist/helpers/settingsPayload.d.ts +1 -0
  185. package/dist/helpers/settingsPayload.d.ts.map +1 -1
  186. package/dist/helpers/settingsPayload.js.map +1 -1
  187. package/dist/helpers/settingsPayload.ts +1 -0
  188. package/dist/helpers/solidIcons.d.ts +2 -0
  189. package/dist/helpers/solidIcons.d.ts.map +1 -1
  190. package/dist/helpers/solidIcons.js +8 -0
  191. package/dist/helpers/solidIcons.js.map +1 -1
  192. package/dist/helpers/solidIcons.tsx +10 -1
  193. package/dist/helpers/waitForBackendAvailability.d.ts +1 -0
  194. package/dist/helpers/waitForBackendAvailability.d.ts.map +1 -1
  195. package/dist/helpers/waitForBackendAvailability.js +35 -22
  196. package/dist/helpers/waitForBackendAvailability.js.map +1 -1
  197. package/dist/helpers/waitForBackendAvailability.ts +18 -12
  198. package/dist/http/solidHttp.d.ts.map +1 -1
  199. package/dist/http/solidHttp.js +10 -4
  200. package/dist/http/solidHttp.js.map +1 -1
  201. package/dist/http/solidHttp.ts +9 -4
  202. package/dist/redux/api/datasourceIntrospectionApi.d.ts +4 -0
  203. package/dist/redux/api/datasourceIntrospectionApi.d.ts.map +1 -1
  204. package/dist/redux/api/datasourceIntrospectionApi.js.map +1 -1
  205. package/dist/redux/api/datasourceIntrospectionApi.ts +4 -0
  206. package/dist/redux/api/fetchBaseQuery.d.ts.map +1 -1
  207. package/dist/redux/api/fetchBaseQuery.js +9 -3
  208. package/dist/redux/api/fetchBaseQuery.js.map +1 -1
  209. package/dist/redux/api/fetchBaseQuery.tsx +9 -3
  210. package/dist/redux/store/StoreProvider.d.ts.map +1 -1
  211. package/dist/redux/store/StoreProvider.js +4 -3
  212. package/dist/redux/store/StoreProvider.js.map +1 -1
  213. package/dist/redux/store/StoreProvider.tsx +4 -3
  214. package/dist/resources/globals.css +341 -49
  215. package/dist/resources/solid-custom.css +410 -12
  216. package/dist/resources/solid-responsive.css +27 -16
  217. package/dist/resources/solid-tailwind-generated.css +1 -1
  218. package/dist/routes/AppEventListener.d.ts.map +1 -1
  219. package/dist/routes/AppEventListener.js +23 -0
  220. package/dist/routes/AppEventListener.js.map +1 -1
  221. package/dist/routes/AppEventListener.tsx +29 -0
  222. package/dist/routes/pages/admin/core/DashboardPage.module.css +12 -0
  223. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.css +306 -3
  224. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts.map +1 -1
  225. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js +745 -393
  226. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js.map +1 -1
  227. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.tsx +1074 -420
  228. package/dist/routes/pages/admin/core/DatasourcesPage.css +15 -0
  229. package/dist/routes/pages/admin/core/DatasourcesPage.d.ts.map +1 -1
  230. package/dist/routes/pages/admin/core/DatasourcesPage.js +7 -188
  231. package/dist/routes/pages/admin/core/DatasourcesPage.js.map +1 -1
  232. package/dist/routes/pages/admin/core/DatasourcesPage.tsx +3 -393
  233. package/package.json +3 -2
@@ -71,6 +71,7 @@ import { ERROR_MESSAGES } from "../../../constants/error-messages";
71
71
  import { useSolidAutocompleteField } from "../../../hooks/useSolidAutocompleteField";
72
72
  import { SolidAutocomplete, SolidButton, SolidCheckbox, SolidDatePicker, SolidDialog, SolidDialogBody, SolidInput, SolidTextarea, SolidNumberInput, SolidSelect, SolidSegmentedControl, SolidRadioGroup, SolidTabGroup, SolidMessage, SolidCodeEditor, } from "../../shad-cn-ui";
73
73
  import styles from "../form/fields/solidFields.module.css";
74
+ import "./FieldMetaDataForm.css";
74
75
  var SolidFieldType;
75
76
  (function (SolidFieldType) {
76
77
  // numeric types
@@ -319,11 +320,14 @@ var fieldBasedPayloadFormating = function (values, currentFields, fieldMetaData)
319
320
  return transformedPayload;
320
321
  };
321
322
  function fetchCurrentFields(solidFieldType, fieldDefaultMetaData) {
322
- var _a;
323
+ var _a, _b;
324
+ var fieldTypes = Array.isArray((_a = fieldDefaultMetaData === null || fieldDefaultMetaData === void 0 ? void 0 : fieldDefaultMetaData.data) === null || _a === void 0 ? void 0 : _a.fieldTypes)
325
+ ? fieldDefaultMetaData.data.fieldTypes
326
+ : [];
323
327
  if (solidFieldType) {
324
- var allowedFields = (_a = fieldDefaultMetaData === null || fieldDefaultMetaData === void 0 ? void 0 : fieldDefaultMetaData.data) === null || _a === void 0 ? void 0 : _a.fieldTypes.filter(function (e) { return e.fieldType === solidFieldType; });
328
+ var allowedFields = fieldTypes.filter(function (e) { return e.fieldType === solidFieldType; });
325
329
  if (allowedFields.length > 0) {
326
- return allowedFields[0].fields;
330
+ return (_b = allowedFields[0].fields) !== null && _b !== void 0 ? _b : [];
327
331
  }
328
332
  }
329
333
  return [
@@ -560,8 +564,8 @@ var createValidationSchema = function (currentFields, selectedType, allFields, f
560
564
  };
561
565
  var FieldMetaDataForm = function (_a) {
562
566
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
563
- var _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83;
564
- var setIsDirty = _a.setIsDirty, modelMetaData = _a.modelMetaData, fieldMetaData = _a.fieldMetaData, setFieldMetaData = _a.setFieldMetaData, allFields = _a.allFields, deleteModelFunction = _a.deleteModelFunction, setVisiblePopup = _a.setVisiblePopup, params = _a.params, setIsRequiredPopUp = _a.setIsRequiredPopUp, showToaster = _a.showToaster, onDraftSubmit = _a.onDraftSubmit, onClose = _a.onClose, availableFieldTypes = _a.availableFieldTypes, _84 = _a.forceShowTypeSelector, forceShowTypeSelector = _84 === void 0 ? false : _84, _85 = _a.selectorRequireContinue, selectorRequireContinue = _85 === void 0 ? false : _85, _86 = _a.selectorContinueLabel, selectorContinueLabel = _86 === void 0 ? "Next" : _86, _87 = _a.selectorInitialFieldType, selectorInitialFieldType = _87 === void 0 ? null : _87, _88 = _a.disableIdentityEditingForExisting, disableIdentityEditingForExisting = _88 === void 0 ? true : _88, _89 = _a.submitLabel, submitLabel = _89 === void 0 ? "Finish" : _89;
567
+ var _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86;
568
+ var setIsDirty = _a.setIsDirty, modelMetaData = _a.modelMetaData, fieldMetaData = _a.fieldMetaData, setFieldMetaData = _a.setFieldMetaData, allFields = _a.allFields, deleteModelFunction = _a.deleteModelFunction, setVisiblePopup = _a.setVisiblePopup, params = _a.params, setIsRequiredPopUp = _a.setIsRequiredPopUp, showToaster = _a.showToaster, onDraftSubmit = _a.onDraftSubmit, onClose = _a.onClose, availableFieldTypes = _a.availableFieldTypes, _87 = _a.forceShowTypeSelector, forceShowTypeSelector = _87 === void 0 ? false : _87, _88 = _a.selectorRequireContinue, selectorRequireContinue = _88 === void 0 ? false : _88, _89 = _a.selectorContinueLabel, selectorContinueLabel = _89 === void 0 ? "Next" : _89, _90 = _a.selectorInitialFieldType, selectorInitialFieldType = _90 === void 0 ? null : _90, _91 = _a.disableIdentityEditingForExisting, disableIdentityEditingForExisting = _91 === void 0 ? true : _91, _92 = _a.submitLabel, submitLabel = _92 === void 0 ? "Finish" : _92;
565
569
  var booleanOptions = ["false", "true"];
566
570
  var booleanSegmentedOptions = booleanOptions.map(function (value) { return ({
567
571
  label: capitalize(value),
@@ -570,44 +574,45 @@ var FieldMetaDataForm = function (_a) {
570
574
  var resolveBooleanOptionValue = function (value) {
571
575
  return typeof value === "string" ? value : value ? "true" : "false";
572
576
  };
573
- var _90 = useState(false), isBackPopupVisible = _90[0], setIsBackPopupVisible = _90[1];
574
- var _91 = useState(false), showColumnName = _91[0], setShowColumnName = _91[1];
577
+ var _93 = useState(false), isBackPopupVisible = _93[0], setIsBackPopupVisible = _93[1];
578
+ var _94 = useState(false), showColumnName = _94[0], setShowColumnName = _94[1];
575
579
  var pathname = usePathname();
576
- var _92 = useGetFieldDefaultMetaDataQuery(null), fieldDefaultMetaData = _92.data, isLoading = _92.isLoading, error = _92.error, refetch = _92.refetch;
577
- var _93 = useState(fetchCurrentFields(fieldMetaData && fieldMetaData.type, fieldDefaultMetaData)), currentFields = _93[0], setCurrentFields = _93[1];
578
- var _94 = useLazyGetMediaStorageProvidersQuery(), triggerGetMediaStorageProvider = _94[0], _95 = _94[1], MediaStorageProviderData = _95.data, isMediaStorageProviderFetching = _95.isFetching, MediaStorageProviderError = _95.error;
579
- var _96 = useLazyGetmodulesQuery(), triggerGetModules = _96[0], _97 = _96[1], moduleData = _97.data, isModuleFetching = _97.isFetching, moduleError = _97.error;
580
- var _98 = useLazyGetModelsQuery(), triggerGetModels = _98[0], _99 = _98[1], modelData = _99.data, ismodelFetching = _99.isFetching, modelError = _99.error;
581
- var _100 = useUpdateUserKeyMutation(), updateUserKey = _100[0], _101 = _100[1], isUpdateUserKeyLoading = _101.isLoading, isUpdateUserKeySuccess = _101.isSuccess, isUpdateUserKeyError = _101.isError, UpdateUserKeyError = _101.error, newModel = _101.data;
582
- var _102 = useState(), markdownText = _102[0], setMarkdownText = _102[1];
583
- var _103 = useState(Boolean(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.encrypt)), encryptState = _103[0], setEncryptState = _103[1];
584
- var _104 = useState(forceShowTypeSelector || !fieldMetaData), showTypeFilter = _104[0], setShowTypeFilter = _104[1];
585
- var _105 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.type)
580
+ var _95 = useGetFieldDefaultMetaDataQuery(null), fieldDefaultMetaData = _95.data, isLoading = _95.isLoading, error = _95.error, refetch = _95.refetch;
581
+ var _96 = useState(fetchCurrentFields(fieldMetaData && fieldMetaData.type, fieldDefaultMetaData)), currentFields = _96[0], setCurrentFields = _96[1];
582
+ var _97 = useLazyGetMediaStorageProvidersQuery(), triggerGetMediaStorageProvider = _97[0], _98 = _97[1], MediaStorageProviderData = _98.data, isMediaStorageProviderFetching = _98.isFetching, MediaStorageProviderError = _98.error;
583
+ var _99 = useLazyGetmodulesQuery(), triggerGetModules = _99[0], _100 = _99[1], moduleData = _100.data, isModuleFetching = _100.isFetching, moduleError = _100.error;
584
+ var _101 = useLazyGetModelsQuery(), triggerGetModels = _101[0], _102 = _101[1], modelData = _102.data, ismodelFetching = _102.isFetching, modelError = _102.error;
585
+ var _103 = useUpdateUserKeyMutation(), updateUserKey = _103[0], _104 = _103[1], isUpdateUserKeyLoading = _104.isLoading, isUpdateUserKeySuccess = _104.isSuccess, isUpdateUserKeyError = _104.isError, UpdateUserKeyError = _104.error, newModel = _104.data;
586
+ var _105 = useState(), markdownText = _105[0], setMarkdownText = _105[1];
587
+ var _106 = useState(Boolean(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.encrypt)), encryptState = _106[0], setEncryptState = _106[1];
588
+ var _107 = useState(forceShowTypeSelector || !fieldMetaData), showTypeFilter = _107[0], setShowTypeFilter = _107[1];
589
+ var _108 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.type)
586
590
  ? { label: fieldMetaData.type, value: fieldMetaData.type }
587
591
  : selectorInitialFieldType
588
592
  ? { label: selectorInitialFieldType, value: selectorInitialFieldType }
589
- : null), selectedType = _105[0], setSelectedType = _105[1];
593
+ : null), selectedType = _108[0], setSelectedType = _108[1];
590
594
  var selectedTypeValue = (selectedType === null || selectedType === void 0 ? void 0 : selectedType.value) || "";
591
- var _106 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.computedFieldValueType) && { label: fieldMetaData.computedFieldValueType, value: fieldMetaData.computedFieldValueType }), selectedComputedFieldValueType = _106[0], setSelectedComputedFieldValueType = _106[1];
592
- var _107 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.selectionDynamicProvider) && { label: fieldMetaData.selectionDynamicProvider, value: fieldMetaData.selectionDynamicProvider }), selectionDynamicProvider = _107[0], setSelectionDynamicProvider = _107[1];
595
+ var _109 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.computedFieldValueType) && { label: fieldMetaData.computedFieldValueType, value: fieldMetaData.computedFieldValueType }), selectedComputedFieldValueType = _109[0], setSelectedComputedFieldValueType = _109[1];
596
+ var _110 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.selectionDynamicProvider) && { label: fieldMetaData.selectionDynamicProvider, value: fieldMetaData.selectionDynamicProvider }), selectionDynamicProvider = _110[0], setSelectionDynamicProvider = _110[1];
593
597
  // const [externalIdProvider, setExternalIdProvider] = useState(fieldMetaData?.externalIdProvider && { label: fieldMetaData.externalIdProvider, value: fieldMetaData.externalIdProvider });
594
- var _108 = useState([]), filteredComputedFieldValueTypes = _108[0], setFilteredComputedFieldValueTypes = _108[1];
595
- var _109 = useState([]), filteredSelectionDynamicProvider = _109[0], setFilteredSelectionDynamicProvider = _109[1];
596
- var _110 = useState([]), ormTypeOptions = _110[0], setOrmTypeOptions = _110[1];
597
- var _111 = useState(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.ormType), selectedOrmType = _111[0], setSelectedOrmType = _111[1];
598
- var _112 = useState(false), askForUserKeyField = _112[0], setAskForUserKeyField = _112[1];
599
- var _113 = useState([]), userKeyFieldData = _113[0], setUserKeyFieldData = _113[1];
600
- var _114 = useState([]), filteredExternalIdProvider = _114[0], setFilteredExternalIdProvider = _114[1];
601
- var _115 = useState([]), filteredSelectionEncryptionType = _115[0], setFilteredSelectionEncryptionType = _115[1];
602
- var _116 = useState([]), filteredSelectionDecryptWhen = _116[0], setFilteredSelectionDecryptWhen = _116[1];
598
+ var _111 = useState([]), filteredComputedFieldValueTypes = _111[0], setFilteredComputedFieldValueTypes = _111[1];
599
+ var _112 = useState([]), filteredSelectionDynamicProvider = _112[0], setFilteredSelectionDynamicProvider = _112[1];
600
+ var _113 = useState([]), ormTypeOptions = _113[0], setOrmTypeOptions = _113[1];
601
+ var _114 = useState(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.ormType), selectedOrmType = _114[0], setSelectedOrmType = _114[1];
602
+ var _115 = useState(false), askForUserKeyField = _115[0], setAskForUserKeyField = _115[1];
603
+ var _116 = useState([]), userKeyFieldData = _116[0], setUserKeyFieldData = _116[1];
604
+ var _117 = useState([]), filteredExternalIdProvider = _117[0], setFilteredExternalIdProvider = _117[1];
605
+ var _118 = useState([]), filteredSelectionEncryptionType = _118[0], setFilteredSelectionEncryptionType = _118[1];
606
+ var _119 = useState([]), filteredSelectionDecryptWhen = _119[0], setFilteredSelectionDecryptWhen = _119[1];
603
607
  var validationSchema = React.useMemo(function () { return createValidationSchema(currentFields, selectedType, allFields, fieldMetaData, encryptState); }, [currentFields, encryptState]);
604
- var _117 = useState(false), typeSelected = _117[0], setTypeSelected = _117[1];
608
+ var _120 = useState(false), typeSelected = _120[0], setTypeSelected = _120[1];
605
609
  var showRegexFields = currentFields.includes("regexPattern");
606
610
  var showMinFields = currentFields.includes("min");
607
611
  var showMaxFields = currentFields.includes("max");
608
612
  var showOrmOptions = currentFields.includes("ormType") && Boolean(ormTypeOptions && ormTypeOptions.length);
609
613
  var showValidationSection = selectedTypeValue !== "relation" && (showRegexFields || showMinFields || showMaxFields || showOrmOptions);
610
614
  var isExistingFieldReadOnly = disableIdentityEditingForExisting && Boolean(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id);
615
+ var fieldTypeLabel = capitalize(String((_o = (_m = selectedType === null || selectedType === void 0 ? void 0 : selectedType.label) !== null && _m !== void 0 ? _m : selectedTypeValue) !== null && _o !== void 0 ? _o : "field"));
611
616
  var closeForm = useCallback(function () {
612
617
  if (typeof onClose === "function") {
613
618
  onClose();
@@ -984,7 +989,7 @@ var FieldMetaDataForm = function (_a) {
984
989
  { label: "False", value: "false" },
985
990
  ];
986
991
  var defaultPasswordPolicy = fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.regexPattern;
987
- var _118 = useState(defaultPasswordPolicy), selectedPasswordPolicy = _118[0], setSelectedPasswordPolicy = _118[1];
992
+ var _121 = useState(defaultPasswordPolicy), selectedPasswordPolicy = _121[0], setSelectedPasswordPolicy = _121[1];
988
993
  var passwordPolicyOptions = [
989
994
  { label: 'Lowercase and Uppercase Alphabets Required', value: '^(?=.*[a-z])(?=.*[A-Z]).*$' },
990
995
  { label: 'Lowercase and Uppercase Alphabets and Numbers Required', value: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).*$' },
@@ -997,8 +1002,8 @@ var FieldMetaDataForm = function (_a) {
997
1002
  { label: 'Video (Supports MP4, AVI, MKV, etc.)', value: 'video' },
998
1003
  { label: 'File (Supports PDF, DOCX, TXT, etc.)', value: 'file' }
999
1004
  ];
1000
- var resolvedMediaTypeOptions = useMemo(function () { var _a, _b; return (_b = (_a = fieldDefaultMetaData === null || fieldDefaultMetaData === void 0 ? void 0 : fieldDefaultMetaData.data) === null || _a === void 0 ? void 0 : _a.mediaTypes) !== null && _b !== void 0 ? _b : mediaTypesOptions; }, [(_m = fieldDefaultMetaData === null || fieldDefaultMetaData === void 0 ? void 0 : fieldDefaultMetaData.data) === null || _m === void 0 ? void 0 : _m.mediaTypes]);
1001
- var _119 = useState(resolvedMediaTypeOptions), filteredMediaTypes = _119[0], setFilteredMediaTypes = _119[1];
1005
+ var resolvedMediaTypeOptions = useMemo(function () { var _a, _b; return (_b = (_a = fieldDefaultMetaData === null || fieldDefaultMetaData === void 0 ? void 0 : fieldDefaultMetaData.data) === null || _a === void 0 ? void 0 : _a.mediaTypes) !== null && _b !== void 0 ? _b : mediaTypesOptions; }, [(_p = fieldDefaultMetaData === null || fieldDefaultMetaData === void 0 ? void 0 : fieldDefaultMetaData.data) === null || _p === void 0 ? void 0 : _p.mediaTypes]);
1006
+ var _122 = useState(resolvedMediaTypeOptions), filteredMediaTypes = _122[0], setFilteredMediaTypes = _122[1];
1002
1007
  useEffect(function () {
1003
1008
  setFilteredMediaTypes(resolvedMediaTypeOptions);
1004
1009
  }, [resolvedMediaTypeOptions]);
@@ -1047,9 +1052,9 @@ var FieldMetaDataForm = function (_a) {
1047
1052
  min: fieldMetaData ? fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.min : null,
1048
1053
  max: fieldMetaData ? fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.max : null,
1049
1054
  private: fieldMetaData ? fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.private : false,
1050
- mediaTypes: (_o = fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaTypes) !== null && _o !== void 0 ? _o : [],
1055
+ mediaTypes: (_q = fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaTypes) !== null && _q !== void 0 ? _q : [],
1051
1056
  mediaMaxSizeKb: fieldMetaData ? fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaMaxSizeKb : null,
1052
- mediaStorageProviderId: fieldMetaData ? (_p = fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaStorageProvider) === null || _p === void 0 ? void 0 : _p.id : null,
1057
+ mediaStorageProviderId: fieldMetaData ? (_r = fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaStorageProvider) === null || _r === void 0 ? void 0 : _r.id : null,
1053
1058
  mediaStorageProvider: fieldMetaData ? fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaStorageProvider : null,
1054
1059
  mediaEmbedded: fieldMetaData ? ((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaEmbedded) && (fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaEmbedded.toString())) : "true",
1055
1060
  relationType: fieldMetaData ? fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.relationType : null,
@@ -1087,7 +1092,7 @@ var FieldMetaDataForm = function (_a) {
1087
1092
  var newFieldData, formtatedFieldPayload_1, data;
1088
1093
  return __generator(this, function (_a) {
1089
1094
  try {
1090
- newFieldData = __assign(__assign({}, values), { isSystem: values.isSystem == true ? true : '' });
1095
+ newFieldData = __assign(__assign({}, values), { isSystem: values.isSystem === true });
1091
1096
  formtatedFieldPayload_1 = fieldBasedPayloadFormating(newFieldData, currentFields, fieldMetaData);
1092
1097
  if (typeof onDraftSubmit === "function") {
1093
1098
  onDraftSubmit(formtatedFieldPayload_1);
@@ -1127,6 +1132,9 @@ var FieldMetaDataForm = function (_a) {
1127
1132
  }); },
1128
1133
  validateOnBlur: false // Disable validation on blur
1129
1134
  });
1135
+ var fieldEditorTitle = fieldMetaData
1136
+ ? "Edit ".concat(((_s = formik === null || formik === void 0 ? void 0 : formik.values) === null || _s === void 0 ? void 0 : _s.displayName) || fieldTypeLabel, " Field")
1137
+ : "Add ".concat(fieldTypeLabel, " Field");
1130
1138
  var mediaTypeSelectedItems = useMemo(function () {
1131
1139
  if (!Array.isArray(formik.values.mediaTypes))
1132
1140
  return [];
@@ -1209,6 +1217,7 @@ var FieldMetaDataForm = function (_a) {
1209
1217
  }
1210
1218
  }, [isUpdateUserKeySuccess, isUpdateUserKeyError]);
1211
1219
  var handleTypeSelect = function (e, label) {
1220
+ var _a, _b, _c, _d, _e;
1212
1221
  if (!fieldMetaData) {
1213
1222
  resetFormStateForTypeSelection({ keepSelectedType: true });
1214
1223
  }
@@ -1221,16 +1230,18 @@ var FieldMetaDataForm = function (_a) {
1221
1230
  else {
1222
1231
  formik.setFieldValue("regexPattern", "");
1223
1232
  }
1224
- var ormType = fieldDefaultMetaData.data.ormType[modelMetaData === null || modelMetaData === void 0 ? void 0 : modelMetaData.dataSourceType];
1225
- var availableOrmTypes = ormType[e];
1233
+ var ormTypeByDataSource = (_b = (_a = fieldDefaultMetaData === null || fieldDefaultMetaData === void 0 ? void 0 : fieldDefaultMetaData.data) === null || _a === void 0 ? void 0 : _a.ormType) === null || _b === void 0 ? void 0 : _b[modelMetaData === null || modelMetaData === void 0 ? void 0 : modelMetaData.dataSourceType];
1234
+ var availableOrmTypes = ormTypeByDataSource === null || ormTypeByDataSource === void 0 ? void 0 : ormTypeByDataSource[e];
1226
1235
  // setFilteredOrmTypes(availableOrmTypes.ormTypes.map((e: any) => ({
1227
1236
  // label: e,
1228
1237
  // value: e,
1229
1238
  // })));
1230
1239
  // setSelectedOrmType({ label: availableOrmTypes.ormTypes[0], value: availableOrmTypes.ormTypes[0] });
1231
- setOrmTypeOptions(availableOrmTypes.ormTypes);
1232
- formik.setFieldValue("ormType", availableOrmTypes.ormTypes[0].label);
1233
- setSelectedOrmType(availableOrmTypes.ormTypes[0].label);
1240
+ var nextOrmTypes = (_c = availableOrmTypes === null || availableOrmTypes === void 0 ? void 0 : availableOrmTypes.ormTypes) !== null && _c !== void 0 ? _c : [];
1241
+ var nextOrmTypeLabel = (_e = (_d = nextOrmTypes[0]) === null || _d === void 0 ? void 0 : _d.label) !== null && _e !== void 0 ? _e : null;
1242
+ setOrmTypeOptions(nextOrmTypes);
1243
+ formik.setFieldValue("ormType", nextOrmTypeLabel);
1244
+ setSelectedOrmType(nextOrmTypeLabel);
1234
1245
  setCurrentFields(fetchCurrentFields(e, fieldDefaultMetaData));
1235
1246
  // setTypeSelected(true);
1236
1247
  };
@@ -1421,211 +1432,211 @@ var FieldMetaDataForm = function (_a) {
1421
1432
  searchData: searchSelectionDecryptWhen,
1422
1433
  existingData: decryptWhenExisting,
1423
1434
  });
1424
- return (_jsxs("div", { children: [_jsx("div", { children: _jsx("form", { onSubmit: formik.handleSubmit, onReset: function (event) {
1435
+ return (_jsxs("div", { className: "solid-field-form-shell", children: [_jsx("div", { children: _jsx("form", { onSubmit: formik.handleSubmit, onReset: function (event) {
1425
1436
  event.preventDefault();
1426
1437
  resetFormStateForTypeSelection();
1427
1438
  }, children: showTypeFilter === true ?
1428
- _jsx(FieldSelector, { handleTypeSelect: handleTypeSelect, modelMetaData: modelMetaData, availableFieldTypes: availableFieldTypes, initialSelectedValue: (_q = selectedType === null || selectedType === void 0 ? void 0 : selectedType.value) !== null && _q !== void 0 ? _q : selectorInitialFieldType, requireExplicitContinue: selectorRequireContinue, continueLabel: selectorContinueLabel })
1439
+ _jsx("div", { className: "solid-field-form-scroll", children: _jsx(FieldSelector, { handleTypeSelect: handleTypeSelect, modelMetaData: modelMetaData, availableFieldTypes: availableFieldTypes, initialSelectedValue: (_t = selectedType === null || selectedType === void 0 ? void 0 : selectedType.value) !== null && _t !== void 0 ? _t : selectorInitialFieldType, requireExplicitContinue: selectorRequireContinue, continueLabel: selectorContinueLabel }) })
1429
1440
  :
1430
- _jsx("div", { className: "p-3", style: { maxHeight: '80vh', overflowY: 'auto', overflowX: 'hidden' }, children: _jsx("div", { className: "flex justify-center creat-field-for form-dem", children: _jsxs("div", { className: "solid-fluid", style: { position: 'relative' }, children: [_jsxs(TabView, { panelContainerClassName: "px-0", children: [_jsx(TabPanel, { header: "Basic Info", className: (formik.touched.hasOwnProperty("name") && formik.errors.hasOwnProperty("name")) || (formik.touched.hasOwnProperty("displayName") && formik.errors.hasOwnProperty("displayName")) || (formik.touched.hasOwnProperty("displayName") && formik.errors.hasOwnProperty("ormType")) ? "tab-error-heading" : "", children: _jsxs("div", { className: "flex flex-wrap -mx-2 -mt-2", children: [currentFields.includes("displayName") && (_jsxs("div", { className: "field mt-2 w-full px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "displayName", className: classNames("form-field-label", styles.fieldLabel), children: "Display Name" }), _jsx(SolidInput, { type: "text", disabled: isExistingFieldReadOnly, id: "displayName", name: "displayName", onChange: function (e) {
1431
- formik.setFieldValue("displayName", e.target.value);
1432
- var _a = getSingularAndPlural(e.target.value), toCamelCase = _a.toCamelCase, toSnakeCase = _a.toSnakeCase;
1433
- formik.setFieldValue("name", toCamelCase);
1434
- if (showColumnName) {
1435
- formik.setFieldValue("columnName", toSnakeCase);
1436
- }
1437
- }, value: formik.values.displayName, className: classNames(styles.fieldInput, {
1438
- "p-invalid": isFormFieldValid(formik, "displayName"),
1439
- }) }), isFormFieldValid(formik, "displayName") && (_jsx("p", { className: styles.fieldError, children: (_s = (_r = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _r === void 0 ? void 0 : _r.displayName) === null || _s === void 0 ? void 0 : _s.toString() }))] })), currentFields.includes("name") && (_jsxs("div", { className: "field mt-1 w-full px-2 pt-2 md:mt-0 md:w-1/2", children: [_jsx("label", { htmlFor: "name", className: classNames("form-field-label", styles.fieldLabel), children: "Name" }), _jsx(SolidInput, { disabled: isExistingFieldReadOnly, type: "text", id: "name", name: "name", onChange: formik.handleChange, value: formik.values.name, className: classNames(styles.fieldInput, {
1440
- "p-invalid": isFormFieldValid(formik, "name"),
1441
- }) }), isFormFieldValid(formik, "name") && (_jsx("p", { className: styles.fieldError, children: (_u = (_t = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _t === void 0 ? void 0 : _t.name) === null || _u === void 0 ? void 0 : _u.toString() }))] })), currentFields.includes("description") && (_jsxs("div", { className: "field mt-1 w-full px-2 pt-2 md:mt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "description", className: classNames("form-field-label", styles.fieldLabel), children: "Description" }), _jsx(SolidTextarea, { "aria-describedby": "Description of your field", id: "description", name: "description", onChange: formik.handleChange, value: formik.values.description, rows: 5, cols: 30, className: classNames(styles.fieldTextarea, {
1442
- "p-invalid": isFormFieldValid(formik, "description"),
1443
- }) }), isFormFieldValid(formik, "description") && (_jsx("p", { className: styles.fieldError, children: (_w = (_v = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _v === void 0 ? void 0 : _v.description) === null || _w === void 0 ? void 0 : _w.toString() }))] })), currentFields.includes("columnName") && (_jsxs("div", { className: "field mt-2 w-full px-2 pt-2 md:w-1/2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SolidCheckbox, { onChange: function (event) {
1444
- var checked = event.currentTarget.checked;
1445
- setShowColumnName(checked);
1446
- if (checked === true) {
1447
- var toSnakeCase = getSingularAndPlural(formik.values.displayName).toSnakeCase;
1448
- if (pathname.includes('create')) {
1449
- formik.setFieldValue("columnName", toSnakeCase);
1441
+ _jsx("div", { className: "solid-field-form-scroll", children: _jsx("div", { className: "flex justify-center creat-field-form form-demo", children: _jsxs("div", { className: "solid-fluid solid-field-form-frame", children: [_jsxs("div", { className: "solid-field-form-header", children: [_jsx("p", { className: "form-wrapper-title m-0", children: fieldEditorTitle }), _jsx("p", { className: "solid-field-form-subtitle", children: "Review the basic info and advanced configuration for this field." })] }), _jsx("div", { className: "solid-field-form-tabs", children: _jsxs(TabView, { panelContainerClassName: "px-0", children: [_jsx(TabPanel, { header: "Basic Info", className: (formik.touched.hasOwnProperty("name") && formik.errors.hasOwnProperty("name")) || (formik.touched.hasOwnProperty("displayName") && formik.errors.hasOwnProperty("displayName")) || (formik.touched.hasOwnProperty("displayName") && formik.errors.hasOwnProperty("ormType")) ? "tab-error-heading" : "", children: _jsxs("div", { className: "flex flex-wrap -mx-2 -mt-2", children: [currentFields.includes("displayName") && (_jsxs("div", { className: "field mt-2 w-full px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "displayName", className: classNames("form-field-label", styles.fieldLabel), children: "Display Name" }), _jsx(SolidInput, { type: "text", disabled: isExistingFieldReadOnly, id: "displayName", name: "displayName", onChange: function (e) {
1442
+ formik.setFieldValue("displayName", e.target.value);
1443
+ var _a = getSingularAndPlural(e.target.value), toCamelCase = _a.toCamelCase, toSnakeCase = _a.toSnakeCase;
1444
+ formik.setFieldValue("name", toCamelCase);
1445
+ if (showColumnName) {
1446
+ formik.setFieldValue("columnName", toSnakeCase);
1447
+ }
1448
+ }, value: formik.values.displayName, className: classNames(styles.fieldInput, {
1449
+ "p-invalid": isFormFieldValid(formik, "displayName"),
1450
+ }) }), isFormFieldValid(formik, "displayName") && (_jsx("p", { className: styles.fieldError, children: (_v = (_u = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _u === void 0 ? void 0 : _u.displayName) === null || _v === void 0 ? void 0 : _v.toString() }))] })), currentFields.includes("name") && (_jsxs("div", { className: "field mt-1 w-full px-2 pt-2 md:mt-0 md:w-1/2", children: [_jsx("label", { htmlFor: "name", className: classNames("form-field-label", styles.fieldLabel), children: "Name" }), _jsx(SolidInput, { disabled: isExistingFieldReadOnly, type: "text", id: "name", name: "name", onChange: formik.handleChange, value: formik.values.name, className: classNames(styles.fieldInput, {
1451
+ "p-invalid": isFormFieldValid(formik, "name"),
1452
+ }) }), isFormFieldValid(formik, "name") && (_jsx("p", { className: styles.fieldError, children: (_x = (_w = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _w === void 0 ? void 0 : _w.name) === null || _x === void 0 ? void 0 : _x.toString() }))] })), currentFields.includes("description") && (_jsxs("div", { className: "field mt-1 w-full px-2 pt-2 md:mt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "description", className: classNames("form-field-label", styles.fieldLabel), children: "Description" }), _jsx(SolidTextarea, { "aria-describedby": "Description of your field", id: "description", name: "description", onChange: formik.handleChange, value: formik.values.description, rows: 5, className: classNames(styles.fieldTextarea, {
1453
+ "p-invalid": isFormFieldValid(formik, "description"),
1454
+ }) }), isFormFieldValid(formik, "description") && (_jsx("p", { className: styles.fieldError, children: (_z = (_y = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _y === void 0 ? void 0 : _y.description) === null || _z === void 0 ? void 0 : _z.toString() }))] })), currentFields.includes("columnName") && (_jsxs("div", { className: "field mt-2 w-full px-2 pt-2 md:w-1/2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SolidCheckbox, { onChange: function (event) {
1455
+ var checked = event.currentTarget.checked;
1456
+ setShowColumnName(checked);
1457
+ if (checked === true) {
1458
+ var toSnakeCase = getSingularAndPlural(formik.values.displayName).toSnakeCase;
1459
+ if (pathname.includes('create')) {
1460
+ formik.setFieldValue("columnName", toSnakeCase);
1461
+ }
1450
1462
  }
1451
- }
1452
- else {
1453
- formik.setFieldValue("columnName", null);
1454
- }
1455
- }, checked: showColumnName, disabled: isExistingFieldReadOnly }), _jsx("label", { htmlFor: "ingredient1", className: "form-field-label", children: "Set Column Name" })] }), showColumnName && (_jsxs("div", { className: "field mt-4 w-full gap-2", children: [_jsx("label", { htmlFor: "columnName", className: classNames("form-field-label", styles.fieldLabel), children: "Column Name" }), _jsx(SolidInput, { disabled: isExistingFieldReadOnly, type: "text", id: "columnName", name: "columnName", onChange: formik.handleChange, value: formik.values.columnName, className: classNames(styles.fieldInput, {
1456
- "p-invalid": isFormFieldValid(formik, "columnName"),
1457
- }) }), isFormFieldValid(formik, "columnName") && (_jsx("p", { className: styles.fieldError, children: (_y = (_x = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _x === void 0 ? void 0 : _x.columnName) === null || _y === void 0 ? void 0 : _y.toString() }))] }))] }))] }) }), _jsxs(TabPanel, { header: "Advanced Config", children: [((_0 = (_z = formik === null || formik === void 0 ? void 0 : formik.values) === null || _z === void 0 ? void 0 : _z.type) === null || _0 === void 0 ? void 0 : _0.length) > 0 && (_jsxs("div", { className: "flex flex-wrap -mx-2 -mt-2", children: [currentFields.includes("length") && (_jsxs("div", { className: "field flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsx("label", { htmlFor: "length", className: classNames("form-field-label", styles.fieldLabel), children: "Length" }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "length", name: "length", value: formik.values.length, onChange: function (event) { return formik.setFieldValue("length", event.value); }, className: classNames({
1458
- "p-invalid": isFormFieldValid(formik, "length"),
1459
- }) }) }), isFormFieldValid(formik, "length") && (_jsx("p", { className: styles.fieldError, children: (_2 = (_1 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _1 === void 0 ? void 0 : _1.length) === null || _2 === void 0 ? void 0 : _2.toString() }))] })), currentFields.includes("defaultValue") && selectedTypeValue === "boolean" &&
1460
- _jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { style: { marginBottom: "0px" }, htmlFor: "defaultValue", className: classNames("form-field-label", styles.fieldLabel), children: "Default Value" }), _jsx(SolidSegmentedControl, { value: resolveBooleanOptionValue(formik.values.defaultValue), onChange: function (value) { return formik.setFieldValue("defaultValue", value); }, options: booleanSegmentedOptions, className: classNames("", {
1461
- "p-invalid": isFormFieldValid(formik, "defaultValue"),
1462
- }) })] }), currentFields.includes("defaultValue") && selectedTypeValue !== "boolean" && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { style: { marginBottom: "0px" }, htmlFor: "defaultValue", className: classNames("form-field-label", styles.fieldLabel), children: "Default Value" }), (selectedTypeValue === "shortText" || selectedTypeValue === "longText" || selectedTypeValue === "richText" || selectedTypeValue === "json" || selectedTypeValue === "password" || selectedTypeValue === "selectionStatic") &&
1463
- _jsx(SolidInput, { type: "text", id: "defaultValue", name: "defaultValue", onChange: formik.handleChange, value: formik.values.defaultValue, className: classNames(styles.fieldInput, {
1464
- "p-invalid": isFormFieldValid(formik, "defaultValue"),
1465
- }) }), (selectedTypeValue === "float" || selectedTypeValue === "decimal") &&
1466
- _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "defaultValue", name: "defaultValue", step: "0.00001", value: formik.values.defaultValue, onChange: function (event) { return formik.setFieldValue("defaultValue", event.value); }, className: classNames({
1463
+ else {
1464
+ formik.setFieldValue("columnName", null);
1465
+ }
1466
+ }, checked: showColumnName, disabled: isExistingFieldReadOnly }), _jsx("label", { htmlFor: "ingredient1", className: "form-field-label", children: "Set Column Name" })] }), showColumnName && (_jsxs("div", { className: "field mt-4 w-full gap-2", children: [_jsx("label", { htmlFor: "columnName", className: classNames("form-field-label", styles.fieldLabel), children: "Column Name" }), _jsx(SolidInput, { disabled: isExistingFieldReadOnly, type: "text", id: "columnName", name: "columnName", onChange: formik.handleChange, value: formik.values.columnName, className: classNames(styles.fieldInput, {
1467
+ "p-invalid": isFormFieldValid(formik, "columnName"),
1468
+ }) }), isFormFieldValid(formik, "columnName") && (_jsx("p", { className: styles.fieldError, children: (_1 = (_0 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _0 === void 0 ? void 0 : _0.columnName) === null || _1 === void 0 ? void 0 : _1.toString() }))] }))] }))] }) }), _jsxs(TabPanel, { header: "Advanced Config", children: [((_3 = (_2 = formik === null || formik === void 0 ? void 0 : formik.values) === null || _2 === void 0 ? void 0 : _2.type) === null || _3 === void 0 ? void 0 : _3.length) > 0 && (_jsxs("div", { className: "flex flex-wrap -mx-2 -mt-2", children: [currentFields.includes("length") && (_jsxs("div", { className: "field flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsx("label", { htmlFor: "length", className: classNames("form-field-label", styles.fieldLabel), children: "Length" }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "length", name: "length", value: formik.values.length, onChange: function (event) { return formik.setFieldValue("length", event.value); }, className: classNames({
1469
+ "p-invalid": isFormFieldValid(formik, "length"),
1470
+ }) }) }), isFormFieldValid(formik, "length") && (_jsx("p", { className: styles.fieldError, children: (_5 = (_4 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _4 === void 0 ? void 0 : _4.length) === null || _5 === void 0 ? void 0 : _5.toString() }))] })), currentFields.includes("defaultValue") && selectedTypeValue === "boolean" &&
1471
+ _jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { style: { marginBottom: "0px" }, htmlFor: "defaultValue", className: classNames("form-field-label", styles.fieldLabel), children: "Default Value" }), _jsx(SolidSegmentedControl, { value: resolveBooleanOptionValue(formik.values.defaultValue), onChange: function (value) { return formik.setFieldValue("defaultValue", value); }, options: booleanSegmentedOptions, className: classNames("", {
1472
+ "p-invalid": isFormFieldValid(formik, "defaultValue"),
1473
+ }) })] }), currentFields.includes("defaultValue") && selectedTypeValue !== "boolean" && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { style: { marginBottom: "0px" }, htmlFor: "defaultValue", className: classNames("form-field-label", styles.fieldLabel), children: "Default Value" }), (selectedTypeValue === "shortText" || selectedTypeValue === "longText" || selectedTypeValue === "richText" || selectedTypeValue === "json" || selectedTypeValue === "password" || selectedTypeValue === "selectionStatic") &&
1474
+ _jsx(SolidInput, { type: "text", id: "defaultValue", name: "defaultValue", onChange: formik.handleChange, value: formik.values.defaultValue, className: classNames(styles.fieldInput, {
1467
1475
  "p-invalid": isFormFieldValid(formik, "defaultValue"),
1468
- }) }) }), (selectedTypeValue === "int" || selectedTypeValue === "bigint") &&
1469
- _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "defaultValue", name: "defaultValue", step: "1", value: formik.values.defaultValue, onChange: function (event) { return formik.setFieldValue("defaultValue", event.value); }, className: classNames({
1476
+ }) }), (selectedTypeValue === "float" || selectedTypeValue === "decimal") &&
1477
+ _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "defaultValue", name: "defaultValue", step: "0.00001", value: formik.values.defaultValue, onChange: function (event) { return formik.setFieldValue("defaultValue", event.value); }, className: classNames({
1478
+ "p-invalid": isFormFieldValid(formik, "defaultValue"),
1479
+ }) }) }), (selectedTypeValue === "int" || selectedTypeValue === "bigint") &&
1480
+ _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "defaultValue", name: "defaultValue", step: "1", value: formik.values.defaultValue, onChange: function (event) { return formik.setFieldValue("defaultValue", event.value); }, className: classNames({
1481
+ "p-invalid": isFormFieldValid(formik, "defaultValue"),
1482
+ }) }) }), (selectedTypeValue === "date" || selectedTypeValue === "datetime" || selectedTypeValue === "time") && (function () {
1483
+ var showTimeSelect = selectedTypeValue === "datetime" || selectedTypeValue === "time";
1484
+ var timeOnly = selectedTypeValue === "time";
1485
+ var dateFormat = selectedTypeValue === "datetime"
1486
+ ? "yyyy-MM-dd HH:mm"
1487
+ : timeOnly
1488
+ ? "HH:mm"
1489
+ : "yyyy-MM-dd";
1490
+ var timeFormat = "HH:mm";
1491
+ return (_jsx(SolidDatePicker, { id: "defaultValue", selected: formik.values.defaultValue ? new Date(formik.values.defaultValue) : undefined, onChange: function (date) { return formik.setFieldValue("defaultValue", date); }, showTimeSelect: showTimeSelect, timeOnly: timeOnly, dateFormat: dateFormat, timeFormat: timeFormat, inputClassName: classNames({
1470
1492
  "p-invalid": isFormFieldValid(formik, "defaultValue"),
1471
- }) }) }), (selectedTypeValue === "date" || selectedTypeValue === "datetime" || selectedTypeValue === "time") && (function () {
1472
- var showTimeSelect = selectedTypeValue === "datetime" || selectedTypeValue === "time";
1473
- var timeOnly = selectedTypeValue === "time";
1474
- var dateFormat = selectedTypeValue === "datetime"
1475
- ? "yyyy-MM-dd HH:mm"
1476
- : timeOnly
1477
- ? "HH:mm"
1478
- : "yyyy-MM-dd";
1479
- var timeFormat = "HH:mm";
1480
- return (_jsx(SolidDatePicker, { id: "defaultValue", selected: formik.values.defaultValue ? new Date(formik.values.defaultValue) : undefined, onChange: function (date) { return formik.setFieldValue("defaultValue", date); }, showTimeSelect: showTimeSelect, timeOnly: timeOnly, dateFormat: dateFormat, timeFormat: timeFormat, inputClassName: classNames({
1481
- "p-invalid": isFormFieldValid(formik, "defaultValue"),
1482
- }) }));
1483
- })(), isFormFieldValid(formik, "defaultValue") && (_jsx("p", { className: styles.fieldError, children: (_4 = (_3 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _3 === void 0 ? void 0 : _3.defaultValue) === null || _4 === void 0 ? void 0 : _4.toString() }))] })), currentFields.includes("mediaTypes") && (_jsxs("div", { className: "field flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaTypes", className: classNames("form-field-label", styles.fieldLabel), children: "Media Type" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_b = {},
1484
- _b[styles.fieldInvalidControl] = isFormFieldValid(formik, "mediaTypes"),
1485
- _b)), children: _jsx(SolidAutocomplete, { multiple: true, dropdown: true, field: "label", value: mediaTypeSelectedItems, suggestions: filteredMediaTypes, completeMethod: handleMediaTypesSearch, maxVisibleChips: 3, onChange: function (_a) {
1493
+ }) }));
1494
+ })(), isFormFieldValid(formik, "defaultValue") && (_jsx("p", { className: styles.fieldError, children: (_7 = (_6 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _6 === void 0 ? void 0 : _6.defaultValue) === null || _7 === void 0 ? void 0 : _7.toString() }))] })), currentFields.includes("mediaTypes") && (_jsxs("div", { className: "field flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaTypes", className: classNames("form-field-label", styles.fieldLabel), children: "Media Type" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_b = {},
1495
+ _b[styles.fieldInvalidControl] = isFormFieldValid(formik, "mediaTypes"),
1496
+ _b)), children: _jsx(SolidAutocomplete, { multiple: true, dropdown: true, field: "label", value: mediaTypeSelectedItems, suggestions: filteredMediaTypes, completeMethod: handleMediaTypesSearch, maxVisibleChips: 3, onChange: function (_a) {
1497
+ var value = _a.value;
1498
+ var selection = Array.isArray(value) ? value : [];
1499
+ var normalizedValues = selection
1500
+ .map(function (item) {
1501
+ if (item && typeof item === "object") {
1502
+ if (item.value)
1503
+ return item.value;
1504
+ if (item.label)
1505
+ return item.label;
1506
+ }
1507
+ return item !== null && item !== void 0 ? item : null;
1508
+ })
1509
+ .filter(Boolean);
1510
+ formik.setFieldValue("mediaTypes", normalizedValues);
1511
+ }, placeholder: "Select media types", className: "w-full" }) }), isFormFieldValid(formik, "mediaTypes") && (_jsx("p", { className: styles.fieldError, children: (_9 = (_8 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _8 === void 0 ? void 0 : _8.mediaTypes) === null || _9 === void 0 ? void 0 : _9.toString() }))] })), currentFields.includes("mediaMaxSizeKb") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:mt-0 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaMaxSizeKb", className: classNames("form-field-label", styles.fieldLabel), children: "Media Max Size (Mb)" }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "mediaMaxSizeKb", name: "mediaMaxSizeKb", value: formik.values.mediaMaxSizeKb, onChange: function (event) { return formik.setFieldValue("mediaMaxSizeKb", event.value); }, className: classNames({
1512
+ "p-invalid": isFormFieldValid(formik, "mediaMaxSizeKb"),
1513
+ }) }) }), isFormFieldValid(formik, "mediaMaxSizeKb") && (_jsx("p", { className: styles.fieldError, children: (_11 = (_10 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _10 === void 0 ? void 0 : _10.mediaMaxSizeKb) === null || _11 === void 0 ? void 0 : _11.toString() }))] })), currentFields.includes("mediaStorageProviderId") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaStorageProviderId", className: classNames("form-field-label", styles.fieldLabel), children: "Media Storage Provider" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_c = {},
1514
+ _c[styles.fieldInvalidControl] = isFormFieldValid(formik, "mediaStorageProvider"),
1515
+ _c)), children: _jsx(SolidAutocomplete, { value: mediaStorageProviderField.selectedItem, suggestions: mediaStorageProviderField.filteredItems, completeMethod: mediaStorageProviderField.searchItems, onChange: mediaStorageProviderField.handleChange, dropdown: true, field: "name", className: "w-full" }) }), isFormFieldValid(formik, "mediaStorageProvider") && (_jsx("p", { className: styles.fieldError, children: (_13 = (_12 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _12 === void 0 ? void 0 : _12.mediaStorageProviderId) === null || _13 === void 0 ? void 0 : _13.toString() }))] })), currentFields.includes("mediaEmbedded") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaEmbedded", className: classNames("form-field-label", styles.fieldLabel), children: "Media Embedded" }), _jsx(SolidSegmentedControl, { value: resolveBooleanOptionValue(formik.values.mediaEmbedded), onChange: function (value) {
1516
+ formik.setFieldValue("mediaEmbedded", value);
1517
+ }, options: booleanSegmentedOptions, className: classNames("", {
1518
+ "p-invalid": isFormFieldValid(formik, "mediaEmbedded"),
1519
+ }) }), isFormFieldValid(formik, "mediaEmbedded") && (_jsx("p", { className: styles.fieldError, children: (_15 = (_14 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _14 === void 0 ? void 0 : _14.mediaEmbedded) === null || _15 === void 0 ? void 0 : _15.toString() }))] })), currentFields.includes("relationType") && (_jsxs("div", { className: "field mt-1 flex w-full items-center gap-2 px-2 pt-2", children: [_jsx("label", { style: { marginBottom: "0px" }, htmlFor: "relationType", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Type" }), _jsx(SolidSegmentedControl, { value: formik.values.relationType, options: fieldDefaultMetaData.data.relationTypes, onChange: function (value) {
1520
+ formik.setFieldValue("relationType", value);
1521
+ if (value === "one-to-many") {
1522
+ formik.setFieldValue("relationCreateInverse", true);
1523
+ }
1524
+ }, className: classNames("", {
1525
+ "p-invalid": isFormFieldValid(formik, "relationType"),
1526
+ }) }), isFormFieldValid(formik, "relationType") && (_jsx("p", { className: styles.fieldError, children: (_17 = (_16 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _16 === void 0 ? void 0 : _16.relationType) === null || _17 === void 0 ? void 0 : _17.toString() }))] })), currentFields.includes("relationType") && (formik.values.relationType === "many-to-one" || formik.values.relationType === "one-to-many") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationCascade", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Cascade" }), _jsx(SolidSelect, { value: formik.values.relationCascade, options: fieldDefaultMetaData.data.cascadeTypes, optionLabel: "label", optionValue: "value", onChange: function (_a) {
1486
1527
  var value = _a.value;
1487
- var selection = Array.isArray(value) ? value : [];
1488
- var normalizedValues = selection
1489
- .map(function (item) {
1490
- if (item && typeof item === "object") {
1491
- if (item.value)
1492
- return item.value;
1493
- if (item.label)
1494
- return item.label;
1495
- }
1496
- return item !== null && item !== void 0 ? item : null;
1497
- })
1498
- .filter(Boolean);
1499
- formik.setFieldValue("mediaTypes", normalizedValues);
1500
- }, placeholder: "Select media types", className: "w-full" }) }), isFormFieldValid(formik, "mediaTypes") && (_jsx("p", { className: styles.fieldError, children: (_6 = (_5 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _5 === void 0 ? void 0 : _5.mediaTypes) === null || _6 === void 0 ? void 0 : _6.toString() }))] })), currentFields.includes("mediaMaxSizeKb") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:mt-0 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaMaxSizeKb", className: classNames("form-field-label", styles.fieldLabel), children: "Media Max Size (Mb)" }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "mediaMaxSizeKb", name: "mediaMaxSizeKb", value: formik.values.mediaMaxSizeKb, onChange: function (event) { return formik.setFieldValue("mediaMaxSizeKb", event.value); }, className: classNames({
1501
- "p-invalid": isFormFieldValid(formik, "mediaMaxSizeKb"),
1502
- }) }) }), isFormFieldValid(formik, "mediaMaxSizeKb") && (_jsx("p", { className: styles.fieldError, children: (_8 = (_7 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _7 === void 0 ? void 0 : _7.mediaMaxSizeKb) === null || _8 === void 0 ? void 0 : _8.toString() }))] })), currentFields.includes("mediaStorageProviderId") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaStorageProviderId", className: classNames("form-field-label", styles.fieldLabel), children: "Media Storage Provider" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_c = {},
1503
- _c[styles.fieldInvalidControl] = isFormFieldValid(formik, "mediaStorageProvider"),
1504
- _c)), children: _jsx(SolidAutocomplete, { value: mediaStorageProviderField.selectedItem, suggestions: mediaStorageProviderField.filteredItems, completeMethod: mediaStorageProviderField.searchItems, onChange: mediaStorageProviderField.handleChange, dropdown: true, field: "name", className: "w-full" }) }), isFormFieldValid(formik, "mediaStorageProvider") && (_jsx("p", { className: styles.fieldError, children: (_10 = (_9 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _9 === void 0 ? void 0 : _9.mediaStorageProviderId) === null || _10 === void 0 ? void 0 : _10.toString() }))] })), currentFields.includes("mediaEmbedded") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaEmbedded", className: classNames("form-field-label", styles.fieldLabel), children: "Media Embedded" }), _jsx(SolidSegmentedControl, { value: resolveBooleanOptionValue(formik.values.mediaEmbedded), onChange: function (value) {
1505
- formik.setFieldValue("mediaEmbedded", value);
1506
- }, options: booleanSegmentedOptions, className: classNames("", {
1507
- "p-invalid": isFormFieldValid(formik, "mediaEmbedded"),
1508
- }) }), isFormFieldValid(formik, "mediaEmbedded") && (_jsx("p", { className: styles.fieldError, children: (_12 = (_11 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _11 === void 0 ? void 0 : _11.mediaEmbedded) === null || _12 === void 0 ? void 0 : _12.toString() }))] })), currentFields.includes("relationType") && (_jsxs("div", { className: "field mt-1 flex w-full items-center gap-2 px-2 pt-2", children: [_jsx("label", { style: { marginBottom: "0px" }, htmlFor: "relationType", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Type" }), _jsx(SolidSegmentedControl, { value: formik.values.relationType, options: fieldDefaultMetaData.data.relationTypes, onChange: function (value) {
1509
- formik.setFieldValue("relationType", value);
1510
- if (value === "one-to-many") {
1511
- formik.setFieldValue("relationCreateInverse", true);
1512
- }
1513
- }, className: classNames("", {
1514
- "p-invalid": isFormFieldValid(formik, "relationType"),
1515
- }) }), isFormFieldValid(formik, "relationType") && (_jsx("p", { className: styles.fieldError, children: (_14 = (_13 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _13 === void 0 ? void 0 : _13.relationType) === null || _14 === void 0 ? void 0 : _14.toString() }))] })), currentFields.includes("relationType") && (formik.values.relationType === "many-to-one" || formik.values.relationType === "one-to-many") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationCascade", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Cascade" }), _jsx(SolidSelect, { value: formik.values.relationCascade, options: fieldDefaultMetaData.data.cascadeTypes, optionLabel: "label", optionValue: "value", onChange: function (_a) {
1516
- var value = _a.value;
1517
- return formik.setFieldValue("relationCascade", value);
1518
- }, placeholder: "Cascade", className: classNames("w-full", {
1519
- "p-invalid": isFormFieldValid(formik, "relationCascade"),
1520
- }) }), isFormFieldValid(formik, "relationCascade") && (_jsx("p", { className: styles.fieldError, children: (_16 = (_15 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _15 === void 0 ? void 0 : _15.relationCascade) === null || _16 === void 0 ? void 0 : _16.toString() }))] })), currentFields.includes("relationModelModuleName") && (_jsxs("div", { className: "field mt-1 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationModelModuleName", className: classNames("form-field-label", styles.fieldLabel), children: "Co-Module Name" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_d = {},
1521
- _d[styles.fieldInvalidControl] = isFormFieldValid(formik, "relationModelModuleName"),
1522
- _d)), children: _jsx(SolidAutocomplete, { value: relationModelModuleField.selectedItem, suggestions: relationModelModuleField.filteredItems, completeMethod: relationModelModuleField.searchItems, onChange: relationModelModuleField.handleChange, dropdown: true, field: "name", className: "w-full" }) }), isFormFieldValid(formik, "relationModelModuleName") && (_jsx("p", { className: styles.fieldError, children: (_18 = (_17 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _17 === void 0 ? void 0 : _17.relationModelModuleName) === null || _18 === void 0 ? void 0 : _18.toString() }))] })), currentFields.includes("relationCoModelSingularName") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationCoModelSingularName", className: classNames("form-field-label", styles.fieldLabel), children: "Co-Model Name" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_e = {},
1523
- _e[styles.fieldInvalidControl] = isFormFieldValid(formik, "relationCoModelSingularName"),
1524
- _e)), children: _jsx(SolidAutocomplete, { value: relationCoModelField.selectedItem, suggestions: relationCoModelField.filteredItems, completeMethod: relationCoModelField.searchItems, onChange: relationCoModelField.handleChange, dropdown: true, field: "displayName", className: "w-full" }) }), isFormFieldValid(formik, "relationCoModelSingularName") && (_jsx("p", { className: styles.fieldError, children: (_20 = (_19 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _19 === void 0 ? void 0 : _19.relationCoModelSingularName) === null || _20 === void 0 ? void 0 : _20.toString() })), formik.values.relationType === "one-to-many" &&
1525
- _jsx("p", { className: "fieldSubTitle", children: "This is the child model." }), formik.values.relationType === "many-to-one" &&
1526
- _jsx("p", { className: "fieldSubTitle", children: "This is the parent model." })] })), currentFields.includes("relationCoModelColumnName") && (formik.values.relationType === "many-to-many" || formik.values.relationType === "many-to-one") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationCoModelColumnName", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Co-Model Column Name" }), _jsx(SolidInput, { type: "text", id: "relationCoModelColumnName", name: "relationCoModelColumnName", onChange: formik.handleChange, disabled: isExistingFieldReadOnly, value: formik.values.relationCoModelColumnName, className: classNames(styles.fieldInput, {
1527
- "p-invalid": isFormFieldValid(formik, "relationCoModelColumnName"),
1528
- }) }), isFormFieldValid(formik, "relationCoModelColumnName") && (_jsx("p", { className: styles.fieldError, children: (_22 = (_21 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _21 === void 0 ? void 0 : _21.relationCoModelColumnName) === null || _22 === void 0 ? void 0 : _22.toString() })), _jsx("p", { className: "fieldSubTitle", children: "Allows you to control the column name of the foreign key. Eg. when adding a country field to state model, by default foreign key column in the state table will be called country_id, use this field to create a foreign key with a different name. " })] })), askForUserKeyField && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "userKey", className: classNames("form-field-label", styles.fieldLabel), children: "Set User Key" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_f = {},
1529
- _f[styles.fieldInvalidControl] = isFormFieldValid(formik, "userKey"),
1530
- _f)), children: _jsx(SolidAutocomplete, { value: userKeyField.selectedItem, suggestions: userKeyField.filteredItems, completeMethod: userKeyField.searchItems, onChange: userKeyField.handleChange, dropdown: true, field: "displayName", className: "w-full" }) }), _jsx("p", { className: "fieldSubTitle", children: "The co-model you have selected does not have a user key specified. Use the above dropdown to choose from one of the \"unique\" fields in this co-model to be set as its userkey. User keys are required in co-models being used in many-to-one or one-to-many relations as in SolidX when a many-to-one field is rendered it uses an autocomplete dropdown, and the user key value is what is displayed as the label in the dropdown." }), isFormFieldValid(formik, "userKey") && (_jsx("p", { className: styles.fieldError, children: (_24 = (_23 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _23 === void 0 ? void 0 : _23.userKey) === null || _24 === void 0 ? void 0 : _24.toString() }))] })), currentFields.includes("relationFieldFixedFilter") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2", children: [_jsx("label", { htmlFor: "relationFieldFixedFilter", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Field Fixed Filter" }), _jsx(SolidTextarea, { "aria-describedby": "Fixed Filter", id: "relationFieldFixedFilter", name: "relationFieldFixedFilter", onChange: formik.handleChange, value: formik.values.relationFieldFixedFilter, rows: 5, cols: 30, className: classNames(styles.fieldTextarea, {
1531
- "p-invalid": isFormFieldValid(formik, "relationFieldFixedFilter"),
1532
- }) }), isFormFieldValid(formik, "relationFieldFixedFilter") && (_jsx("p", { className: styles.fieldError, children: (_26 = (_25 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _25 === void 0 ? void 0 : _25.relationFieldFixedFilter) === null || _26 === void 0 ? void 0 : _26.toString() })), _jsx("p", { className: "fieldSubTitle", children: "Many to one fields are rendered as autocomplete dropdown on the SolidX ui. Use the fixed filter to load a pre-filtered set of records from the co-model. Please note user input entered in the autocomplete is used to apply a dynamic filter." })] })), currentFields.includes("relationCreateInverse") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationCreateInverse", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Create Inverse" }), _jsxs("div", { className: "flex items-center", children: [_jsx(SolidCheckbox, { id: "relationCreateInverse", name: "relationCreateInverse", checked: formik.values.relationCreateInverse, disabled: formik.values.relationType === "one-to-many", onChange: function (event) { return formik.setFieldValue("relationCreateInverse", event.currentTarget.checked); } }), _jsx("label", { htmlFor: "relationCreateInverse", className: classNames("ml-2", "form-field-label", styles.fieldLabel), children: "Create Inverse" })] }), isFormFieldValid(formik, "relationCreateInverse") && (_jsx("p", { className: styles.fieldError, children: (_28 = (_27 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _27 === void 0 ? void 0 : _27.relationCreateInverse) === null || _28 === void 0 ? void 0 : _28.toString() }))] })), currentFields.includes("relationCoModelFieldName") && formik.values.relationCreateInverse && !formik.values.relationCoModelSingularName && (_jsx("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: _jsx(SolidMessage, { text: "Please select Co-model" }) })), currentFields.includes("relationCoModelFieldName") && formik.values.relationCreateInverse && formik.values.relationCoModelSingularName && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsxs("label", { htmlFor: "relationCoModelFieldName", className: classNames("form-field-label", styles.fieldLabel), children: ["Field Name In ", formik.values.relationCoModelSingularName, " Model"] }), _jsx(SolidInput, { type: "text", id: "relationCoModelFieldName", name: "relationCoModelFieldName", onChange: formik.handleChange, disabled: isExistingFieldReadOnly, value: formik.values.relationCoModelFieldName, className: classNames(styles.fieldInput, {
1533
- "p-invalid": isFormFieldValid(formik, "relationCoModelFieldName"),
1534
- }) }), formik.values.relationType === "one-to-many" &&
1535
- _jsxs("p", { className: "fieldSubTitle", children: ["This is a field that is created in the child model. In this case a ", _jsx("span", { style: { fontWeight: "700" }, children: (_29 = formik.values.relationCoModelFieldName) !== null && _29 !== void 0 ? _29 : formik.values.relationCoModelSingularName }), " field will be created in the ", formik.values.relationCoModelSingularName, " when setting create inverse true."] }), formik.values.relationType === "many-to-one" &&
1536
- _jsxs("p", { className: "fieldSubTitle", children: ["This is a field that is created in the parent model. In this case a ", _jsx("span", { style: { fontWeight: "700" }, children: (_30 = formik.values.relationCoModelFieldName) !== null && _30 !== void 0 ? _30 : "".concat(formik.values.relationCoModelSingularName, "s") }), " field will be created in the ", formik.values.relationCoModelSingularName, " when setting create inverse true."] }), formik.values.relationType === "many-to-many" &&
1537
- _jsxs("p", { className: "fieldSubTitle", children: ["In this case a ", formik.values.relationCoModelFieldName, " field will be created in the ", _jsx("span", { style: { fontWeight: "700" }, children: (_31 = formik.values.relationCoModelSingularName) !== null && _31 !== void 0 ? _31 : '{{}}' }), " when setting create inverse true."] }), isFormFieldValid(formik, "relationCoModelFieldName") && (_jsx("p", { className: styles.fieldError, children: (_33 = (_32 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _32 === void 0 ? void 0 : _32.relationCoModelFieldName) === null || _33 === void 0 ? void 0 : _33.toString() }))] })), currentFields.includes("relationJoinTableName") && formik.values.relationType === "many-to-many" && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationJoinTableName", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Join Table Name" }), _jsx(SolidInput, { type: "text", id: "relationJoinTableName", name: "relationJoinTableName", onChange: formik.handleChange, disabled: isExistingFieldReadOnly, value: formik.values.relationJoinTableName, className: classNames(styles.fieldInput, {
1538
- "p-invalid": isFormFieldValid(formik, "relationJoinTableName"),
1539
- }) }), isFormFieldValid(formik, "relationJoinTableName") && (_jsx("p", { className: styles.fieldError, children: (_35 = (_34 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _34 === void 0 ? void 0 : _34.relationJoinTableName) === null || _35 === void 0 ? void 0 : _35.toString() }))] })), currentFields.includes("selectionDynamicProvider") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "selectionDynamicProvider", className: classNames("form-field-label", styles.fieldLabel), children: "Selection Dynamic Provider" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_g = {},
1540
- _g[styles.fieldInvalidControl] = isFormFieldValid(formik, "selectionDynamicProvider"),
1541
- _g)), children: _jsx(SolidAutocomplete, { value: selectionDynamicProviderField.selectedItem, suggestions: selectionDynamicProviderField.filteredItems, completeMethod: selectionDynamicProviderField.searchItems, onChange: selectionDynamicProviderField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "selectionDynamicProvider") && (_jsx("p", { className: styles.fieldError, children: (_37 = (_36 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _36 === void 0 ? void 0 : _36.selectionDynamicProvider) === null || _37 === void 0 ? void 0 : _37.toString() }))] })), currentFields.includes("selectionValueType") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "selectionValueType", className: classNames("form-field-label", styles.fieldLabel), children: "Select Value Type" }), _jsx(SolidSelect, { value: formik.values.selectionValueType, options: selctionValueTypes, optionLabel: "label", optionValue: "value", onChange: function (_a) {
1542
- var value = _a.value;
1543
- return formik.setFieldValue("selectionValueType", value);
1544
- }, placeholder: "Select Value Type", className: classNames("w-full", {
1545
- "p-invalid": isFormFieldValid(formik, "selectionValueType"),
1546
- }) }), isFormFieldValid(formik, "selectionValueType") && (_jsx("p", { className: styles.fieldError, children: (_39 = (_38 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _38 === void 0 ? void 0 : _38.selectionValueType) === null || _39 === void 0 ? void 0 : _39.toString() }))] })), currentFields.includes("selectionStaticValues") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "selectionStaticValues", className: classNames("form-field-label", styles.fieldLabel), children: "Selection Static Values" }), formik.values.selectionStaticValues.map(function (enumValue, index) { return (_jsx(SelectionStaticValues, { enumValue: enumValue, onUpdate: function (updatedString) { return updateEnumValues(index, updatedString); }, onDelete: function () { return deleteEnumValue(index); }, onAdd: addEnumValue }, index)); }), isFormFieldValid(formik, "selectionStaticValues") && (_jsx("p", { className: styles.fieldError, children: (_41 = (_40 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _40 === void 0 ? void 0 : _40.selectionStaticValues) === null || _41 === void 0 ? void 0 : _41.toString() }))] })), currentFields.includes("computedFieldValueType") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "computedFieldValueType", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Value Type" }), _jsx(SolidAutocomplete, { value: selectedComputedFieldValueType, suggestions: filteredComputedFieldValueTypes, completeMethod: searchComputedFieldValueType, field: "label", dropdown: true, className: classNames("solid-standard-autocomplete", (_h = {},
1547
- _h[styles.fieldInvalidControl] = isFormFieldValid(formik, "computedFieldValueType"),
1548
- _h)), onChange: function (e) {
1549
- setSelectedComputedFieldValueType(e.value);
1550
- formik.setFieldValue("computedFieldValueType", e.value.value);
1551
- } }), isFormFieldValid(formik, "computedFieldValueType") && (_jsx("p", { className: styles.fieldError, children: (_43 = (_42 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _42 === void 0 ? void 0 : _42.computedFieldValueType) === null || _43 === void 0 ? void 0 : _43.toString() }))] })), currentFields.includes("computedFieldValueProvider") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "computedFieldValueProvider", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Provider" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_j = {},
1552
- _j[styles.fieldInvalidControl] = isFormFieldValid(formik, "computedFieldValueProvider"),
1553
- _j)), children: _jsx(SolidAutocomplete, { value: computedFieldValueProviderField.selectedItem, suggestions: computedFieldValueProviderField.filteredItems, completeMethod: computedFieldValueProviderField.searchItems, onChange: computedFieldValueProviderField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "computedFieldValueProvider") && (_jsx("p", { className: styles.fieldError, children: (_45 = (_44 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _44 === void 0 ? void 0 : _44.computedFieldValueProvider) === null || _45 === void 0 ? void 0 : _45.toString() }))] })), currentFields.includes("computedFieldTriggerConfig") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2", children: [(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.computedFieldTriggerConfig) === null
1554
- &&
1555
- _jsx("div", { className: "mb-3", children: _jsx(SolidMessage, { severity: "error", text: "You seem to be using an old configuration of ComputedFieldProvider. Please change your current computed field provider i.e ".concat(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.computedFieldValueProvider, " to implement IEntityComputedFieldProvider before continuing.") }) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("label", { htmlFor: "computedFieldTriggerConfig", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Trigger Config" }), _jsx("div", { children: _jsx(SolidButton, { icon: "si si-plus", size: "small", onClick: handleAdd, type: "button", className: "ml-2" }) })] }), formik.values.computedFieldTriggerConfig.map(function (row, index) {
1556
- var _a;
1557
- return (_jsx(SelectComputedFieldTriggerValues, { index: index, row: row, onChange: handleChange, onDelete: handleDelete, isLastRow: index === formik.values.computedFieldTriggerConfig.length - 1, disableDelete: formik.values.computedFieldTriggerConfig.length === 1, formik: formik, isFormFieldValid: isFormFieldValid, searchModuleName: searchModuleName, searchModelName: computedFieldSearchHandlers[index], modelMetaData: modelMetaData, errors: (_a = formik.errors.computedFieldTriggerConfig) === null || _a === void 0 ? void 0 : _a[index] }, index));
1558
- }), typeof formik.errors.computedFieldTriggerConfig === 'string' && (_jsx("p", { className: styles.fieldError, children: formik.errors.computedFieldTriggerConfig }))] })), currentFields.includes("selectionDynamicProviderCtxt") && (_jsxs("div", { className: "field mt-4 flex w-full flex-col gap-2 px-2 pt-2", children: [_jsx("label", { htmlFor: "selectionDynamicProviderCtxt", className: classNames("form-field-label", styles.fieldLabel), children: "Selection Dynamic Provider Context" }), _jsx(SolidCodeEditor, { value: (_46 = formik.values.selectionDynamicProviderCtxt) !== null && _46 !== void 0 ? _46 : "", onChange: function (value) {
1559
- formik.setFieldValue("selectionDynamicProviderCtxt", value !== null && value !== void 0 ? value : "");
1560
- }, language: "json", height: "300px" }), _jsx("div", { className: " form-field-label mt-2", children: markdownText }), isFormFieldValid(formik, "selectionDynamicProviderCtxt") && (_jsx("p", { className: styles.fieldError, children: (_48 = (_47 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _47 === void 0 ? void 0 : _47.selectionDynamicProviderCtxt) === null || _48 === void 0 ? void 0 : _48.toString() }))] })), currentFields.includes("computedFieldValueProviderCtxt") && (_jsxs("div", { className: "field mt-4 flex w-full flex-col gap-2 px-2 pt-2", children: [_jsx("label", { htmlFor: "computedFieldValueProviderCtxt", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Value Provider Context" }), _jsx(SolidCodeEditor, { value: (_49 = formik.values.computedFieldValueProviderCtxt) !== null && _49 !== void 0 ? _49 : "", onChange: function (value) {
1561
- formik.setFieldValue("computedFieldValueProviderCtxt", value !== null && value !== void 0 ? value : "");
1562
- }, language: "json", height: "300px" }), _jsx("div", { className: "form-field-label mt-4", children: markdownText }), isFormFieldValid(formik, "computedFieldValueProviderCtxt") && (_jsx("p", { className: styles.fieldError, children: (_51 = (_50 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _50 === void 0 ? void 0 : _50.computedFieldValueProviderCtxt) === null || _51 === void 0 ? void 0 : _51.toString() }))] }))] })), showValidationSection && (_jsxs(_Fragment, { children: [_jsx("p", { className: "form-wrapper-heading", children: "Validations" }), _jsxs("div", { className: "flex flex-wrap -mx-2 -mt-2", children: [(showRegexFields && selectedTypeValue === "password") &&
1563
- _jsx(_Fragment, { children: _jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "regexPattern", className: classNames("form-field-label", styles.fieldLabel), children: "Password Policy" }), _jsx(SolidSelect, { value: selectedPasswordPolicy, options: passwordPolicyOptions, optionLabel: "label", optionValue: "value", onChange: function (_a) {
1564
- var value = _a.value;
1565
- setSelectedPasswordPolicy(value);
1566
- if (value !== "custom") {
1567
- formik.setFieldValue("regexPattern", value);
1528
+ return formik.setFieldValue("relationCascade", value);
1529
+ }, placeholder: "Cascade", className: classNames("w-full", {
1530
+ "p-invalid": isFormFieldValid(formik, "relationCascade"),
1531
+ }) }), isFormFieldValid(formik, "relationCascade") && (_jsx("p", { className: styles.fieldError, children: (_19 = (_18 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _18 === void 0 ? void 0 : _18.relationCascade) === null || _19 === void 0 ? void 0 : _19.toString() }))] })), currentFields.includes("relationModelModuleName") && (_jsxs("div", { className: "field mt-1 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationModelModuleName", className: classNames("form-field-label", styles.fieldLabel), children: "Co-Module Name" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_d = {},
1532
+ _d[styles.fieldInvalidControl] = isFormFieldValid(formik, "relationModelModuleName"),
1533
+ _d)), children: _jsx(SolidAutocomplete, { value: relationModelModuleField.selectedItem, suggestions: relationModelModuleField.filteredItems, completeMethod: relationModelModuleField.searchItems, onChange: relationModelModuleField.handleChange, dropdown: true, field: "name", className: "w-full" }) }), isFormFieldValid(formik, "relationModelModuleName") && (_jsx("p", { className: styles.fieldError, children: (_21 = (_20 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _20 === void 0 ? void 0 : _20.relationModelModuleName) === null || _21 === void 0 ? void 0 : _21.toString() }))] })), currentFields.includes("relationCoModelSingularName") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationCoModelSingularName", className: classNames("form-field-label", styles.fieldLabel), children: "Co-Model Name" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_e = {},
1534
+ _e[styles.fieldInvalidControl] = isFormFieldValid(formik, "relationCoModelSingularName"),
1535
+ _e)), children: _jsx(SolidAutocomplete, { value: relationCoModelField.selectedItem, suggestions: relationCoModelField.filteredItems, completeMethod: relationCoModelField.searchItems, onChange: relationCoModelField.handleChange, dropdown: true, field: "displayName", className: "w-full" }) }), isFormFieldValid(formik, "relationCoModelSingularName") && (_jsx("p", { className: styles.fieldError, children: (_23 = (_22 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _22 === void 0 ? void 0 : _22.relationCoModelSingularName) === null || _23 === void 0 ? void 0 : _23.toString() })), formik.values.relationType === "one-to-many" &&
1536
+ _jsx("p", { className: "fieldSubTitle", children: "This is the child model." }), formik.values.relationType === "many-to-one" &&
1537
+ _jsx("p", { className: "fieldSubTitle", children: "This is the parent model." })] })), currentFields.includes("relationCoModelColumnName") && (formik.values.relationType === "many-to-many" || formik.values.relationType === "many-to-one") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationCoModelColumnName", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Co-Model Column Name" }), _jsx(SolidInput, { type: "text", id: "relationCoModelColumnName", name: "relationCoModelColumnName", onChange: formik.handleChange, disabled: isExistingFieldReadOnly, value: formik.values.relationCoModelColumnName, className: classNames(styles.fieldInput, {
1538
+ "p-invalid": isFormFieldValid(formik, "relationCoModelColumnName"),
1539
+ }) }), isFormFieldValid(formik, "relationCoModelColumnName") && (_jsx("p", { className: styles.fieldError, children: (_25 = (_24 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _24 === void 0 ? void 0 : _24.relationCoModelColumnName) === null || _25 === void 0 ? void 0 : _25.toString() })), _jsx("p", { className: "fieldSubTitle", children: "Allows you to control the column name of the foreign key. Eg. when adding a country field to state model, by default foreign key column in the state table will be called country_id, use this field to create a foreign key with a different name. " })] })), askForUserKeyField && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "userKey", className: classNames("form-field-label", styles.fieldLabel), children: "Set User Key" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_f = {},
1540
+ _f[styles.fieldInvalidControl] = isFormFieldValid(formik, "userKey"),
1541
+ _f)), children: _jsx(SolidAutocomplete, { value: userKeyField.selectedItem, suggestions: userKeyField.filteredItems, completeMethod: userKeyField.searchItems, onChange: userKeyField.handleChange, dropdown: true, field: "displayName", className: "w-full" }) }), _jsx("p", { className: "fieldSubTitle", children: "The co-model you have selected does not have a user key specified. Use the above dropdown to choose from one of the \"unique\" fields in this co-model to be set as its userkey. User keys are required in co-models being used in many-to-one or one-to-many relations as in SolidX when a many-to-one field is rendered it uses an autocomplete dropdown, and the user key value is what is displayed as the label in the dropdown." }), isFormFieldValid(formik, "userKey") && (_jsx("p", { className: styles.fieldError, children: (_27 = (_26 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _26 === void 0 ? void 0 : _26.userKey) === null || _27 === void 0 ? void 0 : _27.toString() }))] })), currentFields.includes("relationFieldFixedFilter") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2", children: [_jsx("label", { htmlFor: "relationFieldFixedFilter", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Field Fixed Filter" }), _jsx(SolidTextarea, { "aria-describedby": "Fixed Filter", id: "relationFieldFixedFilter", name: "relationFieldFixedFilter", onChange: formik.handleChange, value: formik.values.relationFieldFixedFilter, rows: 5, className: classNames(styles.fieldTextarea, {
1542
+ "p-invalid": isFormFieldValid(formik, "relationFieldFixedFilter"),
1543
+ }) }), isFormFieldValid(formik, "relationFieldFixedFilter") && (_jsx("p", { className: styles.fieldError, children: (_29 = (_28 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _28 === void 0 ? void 0 : _28.relationFieldFixedFilter) === null || _29 === void 0 ? void 0 : _29.toString() })), _jsx("p", { className: "fieldSubTitle", children: "Many to one fields are rendered as autocomplete dropdown on the SolidX ui. Use the fixed filter to load a pre-filtered set of records from the co-model. Please note user input entered in the autocomplete is used to apply a dynamic filter." })] })), currentFields.includes("relationCreateInverse") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationCreateInverse", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Create Inverse" }), _jsxs("div", { className: "flex items-center", children: [_jsx(SolidCheckbox, { id: "relationCreateInverse", name: "relationCreateInverse", checked: formik.values.relationCreateInverse, disabled: formik.values.relationType === "one-to-many", onChange: function (event) { return formik.setFieldValue("relationCreateInverse", event.currentTarget.checked); } }), _jsx("label", { htmlFor: "relationCreateInverse", className: classNames("ml-2", "form-field-label", styles.fieldLabel), children: "Create Inverse" })] }), isFormFieldValid(formik, "relationCreateInverse") && (_jsx("p", { className: styles.fieldError, children: (_31 = (_30 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _30 === void 0 ? void 0 : _30.relationCreateInverse) === null || _31 === void 0 ? void 0 : _31.toString() }))] })), currentFields.includes("relationCoModelFieldName") && formik.values.relationCreateInverse && !formik.values.relationCoModelSingularName && (_jsx("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: _jsx(SolidMessage, { text: "Please select Co-model" }) })), currentFields.includes("relationCoModelFieldName") && formik.values.relationCreateInverse && formik.values.relationCoModelSingularName && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsxs("label", { htmlFor: "relationCoModelFieldName", className: classNames("form-field-label", styles.fieldLabel), children: ["Field Name In ", formik.values.relationCoModelSingularName, " Model"] }), _jsx(SolidInput, { type: "text", id: "relationCoModelFieldName", name: "relationCoModelFieldName", onChange: formik.handleChange, disabled: isExistingFieldReadOnly, value: formik.values.relationCoModelFieldName, className: classNames(styles.fieldInput, {
1544
+ "p-invalid": isFormFieldValid(formik, "relationCoModelFieldName"),
1545
+ }) }), formik.values.relationType === "one-to-many" &&
1546
+ _jsxs("p", { className: "fieldSubTitle", children: ["This is a field that is created in the child model. In this case a ", _jsx("span", { style: { fontWeight: "700" }, children: (_32 = formik.values.relationCoModelFieldName) !== null && _32 !== void 0 ? _32 : formik.values.relationCoModelSingularName }), " field will be created in the ", formik.values.relationCoModelSingularName, " when setting create inverse true."] }), formik.values.relationType === "many-to-one" &&
1547
+ _jsxs("p", { className: "fieldSubTitle", children: ["This is a field that is created in the parent model. In this case a ", _jsx("span", { style: { fontWeight: "700" }, children: (_33 = formik.values.relationCoModelFieldName) !== null && _33 !== void 0 ? _33 : "".concat(formik.values.relationCoModelSingularName, "s") }), " field will be created in the ", formik.values.relationCoModelSingularName, " when setting create inverse true."] }), formik.values.relationType === "many-to-many" &&
1548
+ _jsxs("p", { className: "fieldSubTitle", children: ["In this case a ", formik.values.relationCoModelFieldName, " field will be created in the ", _jsx("span", { style: { fontWeight: "700" }, children: (_34 = formik.values.relationCoModelSingularName) !== null && _34 !== void 0 ? _34 : '{{}}' }), " when setting create inverse true."] }), isFormFieldValid(formik, "relationCoModelFieldName") && (_jsx("p", { className: styles.fieldError, children: (_36 = (_35 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _35 === void 0 ? void 0 : _35.relationCoModelFieldName) === null || _36 === void 0 ? void 0 : _36.toString() }))] })), currentFields.includes("relationJoinTableName") && formik.values.relationType === "many-to-many" && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationJoinTableName", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Join Table Name" }), _jsx(SolidInput, { type: "text", id: "relationJoinTableName", name: "relationJoinTableName", onChange: formik.handleChange, disabled: isExistingFieldReadOnly, value: formik.values.relationJoinTableName, className: classNames(styles.fieldInput, {
1549
+ "p-invalid": isFormFieldValid(formik, "relationJoinTableName"),
1550
+ }) }), isFormFieldValid(formik, "relationJoinTableName") && (_jsx("p", { className: styles.fieldError, children: (_38 = (_37 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _37 === void 0 ? void 0 : _37.relationJoinTableName) === null || _38 === void 0 ? void 0 : _38.toString() }))] })), currentFields.includes("selectionDynamicProvider") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "selectionDynamicProvider", className: classNames("form-field-label", styles.fieldLabel), children: "Selection Dynamic Provider" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_g = {},
1551
+ _g[styles.fieldInvalidControl] = isFormFieldValid(formik, "selectionDynamicProvider"),
1552
+ _g)), children: _jsx(SolidAutocomplete, { value: selectionDynamicProviderField.selectedItem, suggestions: selectionDynamicProviderField.filteredItems, completeMethod: selectionDynamicProviderField.searchItems, onChange: selectionDynamicProviderField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "selectionDynamicProvider") && (_jsx("p", { className: styles.fieldError, children: (_40 = (_39 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _39 === void 0 ? void 0 : _39.selectionDynamicProvider) === null || _40 === void 0 ? void 0 : _40.toString() }))] })), currentFields.includes("selectionValueType") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "selectionValueType", className: classNames("form-field-label", styles.fieldLabel), children: "Select Value Type" }), _jsx(SolidSelect, { value: formik.values.selectionValueType, options: selctionValueTypes, optionLabel: "label", optionValue: "value", onChange: function (_a) {
1553
+ var value = _a.value;
1554
+ return formik.setFieldValue("selectionValueType", value);
1555
+ }, placeholder: "Select Value Type", className: classNames("w-full", {
1556
+ "p-invalid": isFormFieldValid(formik, "selectionValueType"),
1557
+ }) }), isFormFieldValid(formik, "selectionValueType") && (_jsx("p", { className: styles.fieldError, children: (_42 = (_41 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _41 === void 0 ? void 0 : _41.selectionValueType) === null || _42 === void 0 ? void 0 : _42.toString() }))] })), currentFields.includes("selectionStaticValues") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "selectionStaticValues", className: classNames("form-field-label", styles.fieldLabel), children: "Selection Static Values" }), formik.values.selectionStaticValues.map(function (enumValue, index) { return (_jsx(SelectionStaticValues, { enumValue: enumValue, onUpdate: function (updatedString) { return updateEnumValues(index, updatedString); }, onDelete: function () { return deleteEnumValue(index); }, onAdd: addEnumValue }, index)); }), isFormFieldValid(formik, "selectionStaticValues") && (_jsx("p", { className: styles.fieldError, children: (_44 = (_43 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _43 === void 0 ? void 0 : _43.selectionStaticValues) === null || _44 === void 0 ? void 0 : _44.toString() }))] })), currentFields.includes("computedFieldValueType") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "computedFieldValueType", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Value Type" }), _jsx(SolidAutocomplete, { value: selectedComputedFieldValueType, suggestions: filteredComputedFieldValueTypes, completeMethod: searchComputedFieldValueType, field: "label", dropdown: true, className: classNames("solid-standard-autocomplete", (_h = {},
1558
+ _h[styles.fieldInvalidControl] = isFormFieldValid(formik, "computedFieldValueType"),
1559
+ _h)), onChange: function (e) {
1560
+ setSelectedComputedFieldValueType(e.value);
1561
+ formik.setFieldValue("computedFieldValueType", e.value.value);
1562
+ } }), isFormFieldValid(formik, "computedFieldValueType") && (_jsx("p", { className: styles.fieldError, children: (_46 = (_45 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _45 === void 0 ? void 0 : _45.computedFieldValueType) === null || _46 === void 0 ? void 0 : _46.toString() }))] })), currentFields.includes("computedFieldValueProvider") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "computedFieldValueProvider", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Provider" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_j = {},
1563
+ _j[styles.fieldInvalidControl] = isFormFieldValid(formik, "computedFieldValueProvider"),
1564
+ _j)), children: _jsx(SolidAutocomplete, { value: computedFieldValueProviderField.selectedItem, suggestions: computedFieldValueProviderField.filteredItems, completeMethod: computedFieldValueProviderField.searchItems, onChange: computedFieldValueProviderField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "computedFieldValueProvider") && (_jsx("p", { className: styles.fieldError, children: (_48 = (_47 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _47 === void 0 ? void 0 : _47.computedFieldValueProvider) === null || _48 === void 0 ? void 0 : _48.toString() }))] })), currentFields.includes("computedFieldTriggerConfig") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2", children: [(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.computedFieldTriggerConfig) === null
1565
+ &&
1566
+ _jsx("div", { className: "mb-3", children: _jsx(SolidMessage, { severity: "error", text: "You seem to be using an old configuration of ComputedFieldProvider. Please change your current computed field provider i.e ".concat(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.computedFieldValueProvider, " to implement IEntityComputedFieldProvider before continuing.") }) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("label", { htmlFor: "computedFieldTriggerConfig", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Trigger Config" }), _jsx("div", { children: _jsx(SolidButton, { icon: "si si-plus", size: "small", onClick: handleAdd, type: "button", className: "ml-2" }) })] }), formik.values.computedFieldTriggerConfig.map(function (row, index) {
1567
+ var _a;
1568
+ return (_jsx(SelectComputedFieldTriggerValues, { index: index, row: row, onChange: handleChange, onDelete: handleDelete, isLastRow: index === formik.values.computedFieldTriggerConfig.length - 1, disableDelete: formik.values.computedFieldTriggerConfig.length === 1, formik: formik, isFormFieldValid: isFormFieldValid, searchModuleName: searchModuleName, searchModelName: computedFieldSearchHandlers[index], modelMetaData: modelMetaData, errors: (_a = formik.errors.computedFieldTriggerConfig) === null || _a === void 0 ? void 0 : _a[index] }, index));
1569
+ }), typeof formik.errors.computedFieldTriggerConfig === 'string' && (_jsx("p", { className: styles.fieldError, children: formik.errors.computedFieldTriggerConfig }))] })), currentFields.includes("selectionDynamicProviderCtxt") && (_jsxs("div", { className: "field mt-4 flex w-full flex-col gap-2 px-2 pt-2", children: [_jsx("label", { htmlFor: "selectionDynamicProviderCtxt", className: classNames("form-field-label", styles.fieldLabel), children: "Selection Dynamic Provider Context" }), _jsx(SolidCodeEditor, { value: (_49 = formik.values.selectionDynamicProviderCtxt) !== null && _49 !== void 0 ? _49 : "", onChange: function (value) {
1570
+ formik.setFieldValue("selectionDynamicProviderCtxt", value !== null && value !== void 0 ? value : "");
1571
+ }, language: "json", height: "300px" }), _jsx("div", { className: " form-field-label mt-2", children: markdownText }), isFormFieldValid(formik, "selectionDynamicProviderCtxt") && (_jsx("p", { className: styles.fieldError, children: (_51 = (_50 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _50 === void 0 ? void 0 : _50.selectionDynamicProviderCtxt) === null || _51 === void 0 ? void 0 : _51.toString() }))] })), currentFields.includes("computedFieldValueProviderCtxt") && (_jsxs("div", { className: "field mt-4 flex w-full flex-col gap-2 px-2 pt-2", children: [_jsx("label", { htmlFor: "computedFieldValueProviderCtxt", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Value Provider Context" }), _jsx(SolidCodeEditor, { value: (_52 = formik.values.computedFieldValueProviderCtxt) !== null && _52 !== void 0 ? _52 : "", onChange: function (value) {
1572
+ formik.setFieldValue("computedFieldValueProviderCtxt", value !== null && value !== void 0 ? value : "");
1573
+ }, language: "json", height: "300px" }), _jsx("div", { className: "form-field-label mt-4", children: markdownText }), isFormFieldValid(formik, "computedFieldValueProviderCtxt") && (_jsx("p", { className: styles.fieldError, children: (_54 = (_53 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _53 === void 0 ? void 0 : _53.computedFieldValueProviderCtxt) === null || _54 === void 0 ? void 0 : _54.toString() }))] }))] })), showValidationSection && (_jsxs(_Fragment, { children: [_jsx("p", { className: "form-wrapper-heading", children: "Validations" }), _jsxs("div", { className: "flex flex-wrap -mx-2 -mt-2", children: [(showRegexFields && selectedTypeValue === "password") &&
1574
+ _jsx(_Fragment, { children: _jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "regexPattern", className: classNames("form-field-label", styles.fieldLabel), children: "Password Policy" }), _jsx(SolidSelect, { value: selectedPasswordPolicy, options: passwordPolicyOptions, optionLabel: "label", optionValue: "value", onChange: function (_a) {
1575
+ var value = _a.value;
1576
+ setSelectedPasswordPolicy(value);
1577
+ if (value !== "custom") {
1578
+ formik.setFieldValue("regexPattern", value);
1579
+ }
1580
+ }, placeholder: "Select a Password Policy", className: "w-full" })] }) }), showRegexFields && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "regexPattern", className: classNames("form-field-label", styles.fieldLabel), children: "Regex Pattern" }), _jsx(SolidInput, { type: "text", id: "regexPattern", name: "regexPattern", onChange: formik.handleChange, value: formik.values.regexPattern, className: classNames(styles.fieldInput, {
1581
+ "p-invalid": isFormFieldValid(formik, "regexPattern"),
1582
+ }) }), isFormFieldValid(formik, "regexPattern") && (_jsx("p", { className: styles.fieldError, children: (_56 = (_55 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _55 === void 0 ? void 0 : _55.regexPattern) === null || _56 === void 0 ? void 0 : _56.toString() }))] }), showRegexFields && (_jsxs("div", { className: "field mt-2 mb-3 flex w-full flex-col gap-2 px-2 pt-2 md:mb-3 md:w-1/2", children: [_jsx("label", { htmlFor: "regexPatternNotMatchingErrorMsg", className: classNames("form-field-label", styles.fieldLabel), children: "Regex Pattern Not Matching Error Msg" }), _jsx(SolidInput, { type: "text", id: "regexPatternNotMatchingErrorMsg", name: "regexPatternNotMatchingErrorMsg", onChange: formik.handleChange, value: formik.values.regexPatternNotMatchingErrorMsg, className: classNames(styles.fieldInput, {
1583
+ "p-invalid": isFormFieldValid(formik, "regexPatternNotMatchingErrorMsg"),
1584
+ }) }), isFormFieldValid(formik, "regexPatternNotMatchingErrorMsg") && (_jsx("p", { className: styles.fieldError, children: (_58 = (_57 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _57 === void 0 ? void 0 : _57.regexPatternNotMatchingErrorMsg) === null || _58 === void 0 ? void 0 : _58.toString() }))] }))] })), (showMinFields || showMaxFields) &&
1585
+ _jsxs(_Fragment, { children: [showMinFields && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsxs("label", { htmlFor: "min", className: classNames("form-field-label", styles.fieldLabel), children: ["Min ", (selectedTypeValue !== "int" && selectedTypeValue !== "decimal") && "(Characters Allowed)"] }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "min", name: "min", step: "0.00001", value: formik.values.min, onChange: function (event) { return formik.setFieldValue("min", event.value); }, className: classNames({
1586
+ "p-invalid": isFormFieldValid(formik, "min"),
1587
+ }), disabled: isExistingFieldReadOnly }) }), isFormFieldValid(formik, "min") && (_jsx("p", { className: styles.fieldError, children: (_60 = (_59 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _59 === void 0 ? void 0 : _59.min) === null || _60 === void 0 ? void 0 : _60.toString() }))] })), showMaxFields && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsxs("label", { htmlFor: "max", className: classNames("form-field-label", styles.fieldLabel), children: ["Max ", (selectedTypeValue !== "int" &&
1588
+ selectedTypeValue !== "decimal") && "(Characters allowed)"] }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "max", name: "max", step: "0.00001", value: formik.values.max, onChange: function (event) { return formik.setFieldValue("max", event.value); }, className: classNames({
1589
+ "p-invalid": isFormFieldValid(formik, "max"),
1590
+ }), disabled: isExistingFieldReadOnly }) }), isFormFieldValid(formik, "max") && (_jsx("p", { className: styles.fieldError, children: (_62 = (_61 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _61 === void 0 ? void 0 : _61.max) === null || _62 === void 0 ? void 0 : _62.toString() }))] }))] }), showOrmOptions && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "ormType", className: classNames("form-field-label", styles.fieldLabel), children: "Type" }), _jsx(SolidRadioGroup, { name: "ormType", value: selectedOrmType, onChange: function (value) {
1591
+ formik.setFieldValue("ormType", value);
1592
+ setSelectedOrmType(value);
1593
+ }, options: (ormTypeOptions || []).map(function (ormType) { return ({
1594
+ value: ormType.label,
1595
+ label: (_jsxs("span", { className: classNames("ml-2", "form-field-label"), children: [ormType.label, _jsx("br", {}), _jsx("span", { className: "fieldSubTitle mt-0", children: "(".concat(ormType.description, ")") })] })),
1596
+ }); }), className: "ormTypeflex", itemClassName: "mr-4 items-center" }), isFormFieldValid(formik, "ormType") && (_jsx("p", { className: styles.fieldError, children: (_64 = (_63 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _63 === void 0 ? void 0 : _63.ormType) === null || _64 === void 0 ? void 0 : _64.toString() }))] }))] })] })), (formik.values.relationType !== "many-to-many" && formik.values.relationType !== "one-to-many") && _jsx("p", { className: "form-wrapper-heading", children: "Settings" }), _jsxs("div", { className: "mt-1 flex flex-wrap -mx-2 -mt-2 md:mt-0", children: [currentFields.includes("required") && (formik.values.relationType !== "many-to-many" && formik.values.relationType !== "one-to-many") && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(SolidCheckbox, { id: "required", name: "required", onChange: function (event) {
1597
+ if (!formik.values.isPrimaryKey && !formik.values.unique) {
1598
+ formik.setFieldValue("required", event.currentTarget.checked);
1599
+ }
1600
+ }, checked: formik.values.required, disabled: formik.values.isPrimaryKey || formik.values.unique }), _jsxs("label", { htmlFor: "required", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: ["Required ", formik.values.isPrimaryKey && "(Auto-enabled for Primary Key)", !formik.values.isPrimaryKey && formik.values.unique && "(Auto-enabled for Unique)"] })] }), _jsx("p", { className: "text-xs mt-2", children: "You won't be able to create an entry if this field is empty" }), isFormFieldValid(formik, "required") && (_jsx("p", { className: styles.fieldError, children: (_66 = (_65 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _65 === void 0 ? void 0 : _65.required) === null || _66 === void 0 ? void 0 : _66.toString() }))] })), currentFields.includes("unique") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(SolidCheckbox, { id: "unique", name: "unique", onChange: function (event) {
1601
+ // Prevent unchecking if isPrimaryKey is true
1602
+ if (!formik.values.isPrimaryKey) {
1603
+ var nextValue = event.currentTarget.checked;
1604
+ formik.setFieldValue("unique", nextValue);
1605
+ formik.setFieldValue("isUserKey", false);
1606
+ // Auto-enable required when unique is checked
1607
+ if (nextValue) {
1608
+ formik.setFieldValue("required", true);
1609
+ }
1610
+ else {
1611
+ formik.setFieldValue("required", false);
1568
1612
  }
1569
- }, placeholder: "Select a Password Policy", className: "w-full" })] }) }), showRegexFields && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "regexPattern", className: classNames("form-field-label", styles.fieldLabel), children: "Regex Pattern" }), _jsx(SolidInput, { type: "text", id: "regexPattern", name: "regexPattern", onChange: formik.handleChange, value: formik.values.regexPattern, className: classNames(styles.fieldInput, {
1570
- "p-invalid": isFormFieldValid(formik, "regexPattern"),
1571
- }) }), isFormFieldValid(formik, "regexPattern") && (_jsx("p", { className: styles.fieldError, children: (_53 = (_52 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _52 === void 0 ? void 0 : _52.regexPattern) === null || _53 === void 0 ? void 0 : _53.toString() }))] }), showRegexFields && (_jsxs("div", { className: "field mt-2 mb-3 flex w-full flex-col gap-2 px-2 pt-2 md:mb-3 md:w-1/2", children: [_jsx("label", { htmlFor: "regexPatternNotMatchingErrorMsg", className: classNames("form-field-label", styles.fieldLabel), children: "Regex Pattern Not Matching Error Msg" }), _jsx(SolidInput, { type: "text", id: "regexPatternNotMatchingErrorMsg", name: "regexPatternNotMatchingErrorMsg", onChange: formik.handleChange, value: formik.values.regexPatternNotMatchingErrorMsg, className: classNames(styles.fieldInput, {
1572
- "p-invalid": isFormFieldValid(formik, "regexPatternNotMatchingErrorMsg"),
1573
- }) }), isFormFieldValid(formik, "regexPatternNotMatchingErrorMsg") && (_jsx("p", { className: styles.fieldError, children: (_55 = (_54 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _54 === void 0 ? void 0 : _54.regexPatternNotMatchingErrorMsg) === null || _55 === void 0 ? void 0 : _55.toString() }))] }))] })), (showMinFields || showMaxFields) &&
1574
- _jsxs(_Fragment, { children: [showMinFields && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsxs("label", { htmlFor: "min", className: classNames("form-field-label", styles.fieldLabel), children: ["Min ", (selectedTypeValue !== "int" && selectedTypeValue !== "decimal") && "(Characters Allowed)"] }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "min", name: "min", step: "0.00001", value: formik.values.min, onChange: function (event) { return formik.setFieldValue("min", event.value); }, className: classNames({
1575
- "p-invalid": isFormFieldValid(formik, "min"),
1576
- }), disabled: isExistingFieldReadOnly }) }), isFormFieldValid(formik, "min") && (_jsx("p", { className: styles.fieldError, children: (_57 = (_56 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _56 === void 0 ? void 0 : _56.min) === null || _57 === void 0 ? void 0 : _57.toString() }))] })), showMaxFields && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsxs("label", { htmlFor: "max", className: classNames("form-field-label", styles.fieldLabel), children: ["Max ", (selectedTypeValue !== "int" &&
1577
- selectedTypeValue !== "decimal") && "(Characters allowed)"] }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "max", name: "max", step: "0.00001", value: formik.values.max, onChange: function (event) { return formik.setFieldValue("max", event.value); }, className: classNames({
1578
- "p-invalid": isFormFieldValid(formik, "max"),
1579
- }), disabled: isExistingFieldReadOnly }) }), isFormFieldValid(formik, "max") && (_jsx("p", { className: styles.fieldError, children: (_59 = (_58 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _58 === void 0 ? void 0 : _58.max) === null || _59 === void 0 ? void 0 : _59.toString() }))] }))] }), showOrmOptions && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "ormType", className: classNames("form-field-label", styles.fieldLabel), children: "Type" }), _jsx(SolidRadioGroup, { name: "ormType", value: selectedOrmType, onChange: function (value) {
1580
- formik.setFieldValue("ormType", value);
1581
- setSelectedOrmType(value);
1582
- }, options: (ormTypeOptions || []).map(function (ormType) { return ({
1583
- value: ormType.label,
1584
- label: (_jsxs("span", { className: classNames("ml-2", "form-field-label"), children: [ormType.label, _jsx("br", {}), _jsx("span", { className: "fieldSubTitle mt-0", children: "(".concat(ormType.description, ")") })] })),
1585
- }); }), className: "ormTypeflex", itemClassName: "mr-4 items-center" }), isFormFieldValid(formik, "ormType") && (_jsx("p", { className: styles.fieldError, children: (_61 = (_60 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _60 === void 0 ? void 0 : _60.ormType) === null || _61 === void 0 ? void 0 : _61.toString() }))] }))] })] })), (formik.values.relationType !== "many-to-many" && formik.values.relationType !== "one-to-many") && _jsx("p", { className: "form-wrapper-heading", children: "Settings" }), _jsxs("div", { className: "mt-1 flex flex-wrap -mx-2 -mt-2 md:mt-0", children: [currentFields.includes("required") && (formik.values.relationType !== "many-to-many" && formik.values.relationType !== "one-to-many") && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(SolidCheckbox, { id: "required", name: "required", onChange: function (event) {
1586
- if (!formik.values.isPrimaryKey && !formik.values.unique) {
1587
- formik.setFieldValue("required", event.currentTarget.checked);
1588
- }
1589
- }, checked: formik.values.required, disabled: formik.values.isPrimaryKey || formik.values.unique }), _jsxs("label", { htmlFor: "required", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: ["Required ", formik.values.isPrimaryKey && "(Auto-enabled for Primary Key)", !formik.values.isPrimaryKey && formik.values.unique && "(Auto-enabled for Unique)"] })] }), _jsx("p", { className: "text-xs mt-2", children: "You won't be able to create an entry if this field is empty" }), isFormFieldValid(formik, "required") && (_jsx("p", { className: styles.fieldError, children: (_63 = (_62 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _62 === void 0 ? void 0 : _62.required) === null || _63 === void 0 ? void 0 : _63.toString() }))] })), currentFields.includes("unique") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(SolidCheckbox, { id: "unique", name: "unique", onChange: function (event) {
1590
- // Prevent unchecking if isPrimaryKey is true
1591
- if (!formik.values.isPrimaryKey) {
1592
- var nextValue = event.currentTarget.checked;
1593
- formik.setFieldValue("unique", nextValue);
1594
- formik.setFieldValue("isUserKey", false);
1595
- // Auto-enable required when unique is checked
1596
- if (nextValue) {
1597
- formik.setFieldValue("required", true);
1598
1613
  }
1599
- else {
1600
- formik.setFieldValue("required", false);
1614
+ }, checked: formik.values.unique, disabled: formik.values.isPrimaryKey }), _jsxs("label", { htmlFor: "unique", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: ["Unique ", formik.values.isPrimaryKey && "(Auto-enabled for Primary Key)"] })] }), _jsx("p", { className: "text-xs mt-2", children: "You won't be able to create an entry if there is an existing entry with identical content" }), isFormFieldValid(formik, "unique") && (_jsx("p", { className: styles.fieldError, children: (_68 = (_67 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _67 === void 0 ? void 0 : _67.unique) === null || _68 === void 0 ? void 0 : _68.toString() }))] })), currentFields.includes("index") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(SolidCheckbox, { id: "index", name: "index", onChange: function (event) {
1615
+ formik.setFieldValue("index", event.currentTarget.checked);
1616
+ }, checked: formik.values.index }), _jsx("label", { htmlFor: "index", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: "Index" })] }), isFormFieldValid(formik, "index") && (_jsx("p", { className: styles.fieldError, children: (_70 = (_69 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _69 === void 0 ? void 0 : _69.index) === null || _70 === void 0 ? void 0 : _70.toString() }))] })), currentFields.includes("private") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(SolidCheckbox, { id: "private", name: "private", onChange: function (event) {
1617
+ formik.setFieldValue("private", event.currentTarget.checked);
1618
+ }, checked: formik.values.private }), _jsx("label", { htmlFor: "private", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: "Private" })] }), _jsx("p", { className: "text-xs mt-2", children: "This field will not show up in the API response" }), isFormFieldValid(formik, "private") && (_jsx("p", { className: styles.fieldError, children: (_72 = (_71 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _71 === void 0 ? void 0 : _71.private) === null || _72 === void 0 ? void 0 : _72.toString() }))] })), currentFields.includes("encrypt") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SolidCheckbox, { id: "encrypt", name: "encrypt", onChange: function (event) {
1619
+ formik.setFieldValue("encrypt", event.currentTarget.checked);
1620
+ setEncryptState(event.currentTarget.checked);
1621
+ }, checked: formik.values.encrypt }), _jsx("label", { htmlFor: "encrypt", className: classNames("form-field-label", styles.fieldLabel), children: "Encrypt" })] }), isFormFieldValid(formik, "encrypt") && (_jsx("p", { className: styles.fieldError, children: (_74 = (_73 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _73 === void 0 ? void 0 : _73.encrypt) === null || _74 === void 0 ? void 0 : _74.toString() }))] })), currentFields.includes("isMultiSelect") && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(SolidCheckbox, { id: "isMultiSelect", name: "isMultiSelect", onChange: function (event) {
1622
+ formik.setFieldValue("isMultiSelect", event.currentTarget.checked);
1623
+ }, checked: formik.values.isMultiSelect }), _jsx("label", { htmlFor: "isMultiSelect", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: "Is MultiSelect" })] }), isFormFieldValid(formik, "isMultiSelect") && (_jsx("p", { className: styles.fieldError, children: (_76 = (_75 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _75 === void 0 ? void 0 : _75.isMultiSelect) === null || _76 === void 0 ? void 0 : _76.toString() }))] })), currentFields.includes("enableAuditTracking") && formik.values.relationType !== "one-to-many" && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SolidCheckbox, { id: "enableAuditTracking", name: "enableAuditTracking", onChange: function (event) {
1624
+ formik.setFieldValue("enableAuditTracking", event.currentTarget.checked);
1625
+ }, checked: formik.values.enableAuditTracking }), _jsx("label", { htmlFor: "enableAuditTracking", className: classNames("form-field-label", styles.fieldLabel), children: "Enable Audit Tracking" })] }), _jsx("p", { className: "fieldSubTitle", children: "By selecting this option, you are setting audit trail for this field." }), isFormFieldValid(formik, "enableAuditTracking") && (_jsx("p", { className: styles.fieldError, children: (_78 = (_77 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _77 === void 0 ? void 0 : _77.enableAuditTracking) === null || _78 === void 0 ? void 0 : _78.toString() }))] })), currentFields.includes("isUserKey") && formik.values.unique && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SolidCheckbox, { id: "isUserKey", name: "isUserKey", onChange: function (event) {
1626
+ formik.setFieldValue("isUserKey", event.currentTarget.checked);
1627
+ }, checked: formik.values.isUserKey }), _jsx("label", { htmlFor: "isUserKey", className: classNames("form-field-label", styles.fieldLabel), children: "Is Userkey" })] }), _jsx("p", { className: "fieldSubTitle", children: "By selecting this option, you are setting this field as the model's user key. Any existing user key configuration will be overwritten" }), isFormFieldValid(formik, "isUserKey") && (_jsx("p", { className: styles.fieldError, children: (_80 = (_79 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _79 === void 0 ? void 0 : _79.isUserKey) === null || _80 === void 0 ? void 0 : _80.toString() }))] })), currentFields.includes("isPrimaryKey") && (modelMetaData === null || modelMetaData === void 0 ? void 0 : modelMetaData.isLegacyTable) && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SolidCheckbox, { id: "isPrimaryKey", name: "isPrimaryKey", onChange: function (event) {
1628
+ var checked = event.currentTarget.checked;
1629
+ formik.setFieldValue("isPrimaryKey", checked);
1630
+ // Auto-set required and unique when isPrimaryKey is checked
1631
+ if (checked) {
1632
+ formik.setFieldValue("required", true);
1633
+ formik.setFieldValue("unique", true);
1601
1634
  }
1602
- }
1603
- }, checked: formik.values.unique, disabled: formik.values.isPrimaryKey }), _jsxs("label", { htmlFor: "unique", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: ["Unique ", formik.values.isPrimaryKey && "(Auto-enabled for Primary Key)"] })] }), _jsx("p", { className: "text-xs mt-2", children: "You won't be able to create an entry if there is an existing entry with identical content" }), isFormFieldValid(formik, "unique") && (_jsx("p", { className: styles.fieldError, children: (_65 = (_64 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _64 === void 0 ? void 0 : _64.unique) === null || _65 === void 0 ? void 0 : _65.toString() }))] })), currentFields.includes("index") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(SolidCheckbox, { id: "index", name: "index", onChange: function (event) {
1604
- formik.setFieldValue("index", event.currentTarget.checked);
1605
- }, checked: formik.values.index }), _jsx("label", { htmlFor: "index", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: "Index" })] }), isFormFieldValid(formik, "index") && (_jsx("p", { className: styles.fieldError, children: (_67 = (_66 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _66 === void 0 ? void 0 : _66.index) === null || _67 === void 0 ? void 0 : _67.toString() }))] })), currentFields.includes("private") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(SolidCheckbox, { id: "private", name: "private", onChange: function (event) {
1606
- formik.setFieldValue("private", event.currentTarget.checked);
1607
- }, checked: formik.values.private }), _jsx("label", { htmlFor: "private", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: "Private" })] }), _jsx("p", { className: "text-xs mt-2", children: "This field will not show up in the API response" }), isFormFieldValid(formik, "private") && (_jsx("p", { className: styles.fieldError, children: (_69 = (_68 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _68 === void 0 ? void 0 : _68.private) === null || _69 === void 0 ? void 0 : _69.toString() }))] })), currentFields.includes("encrypt") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SolidCheckbox, { id: "encrypt", name: "encrypt", onChange: function (event) {
1608
- formik.setFieldValue("encrypt", event.currentTarget.checked);
1609
- setEncryptState(event.currentTarget.checked);
1610
- }, checked: formik.values.encrypt }), _jsx("label", { htmlFor: "encrypt", className: classNames("form-field-label", styles.fieldLabel), children: "Encrypt" })] }), isFormFieldValid(formik, "encrypt") && (_jsx("p", { className: styles.fieldError, children: (_71 = (_70 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _70 === void 0 ? void 0 : _70.encrypt) === null || _71 === void 0 ? void 0 : _71.toString() }))] })), currentFields.includes("isMultiSelect") && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(SolidCheckbox, { id: "isMultiSelect", name: "isMultiSelect", onChange: function (event) {
1611
- formik.setFieldValue("isMultiSelect", event.currentTarget.checked);
1612
- }, checked: formik.values.isMultiSelect }), _jsx("label", { htmlFor: "isMultiSelect", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: "Is MultiSelect" })] }), isFormFieldValid(formik, "isMultiSelect") && (_jsx("p", { className: styles.fieldError, children: (_73 = (_72 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _72 === void 0 ? void 0 : _72.isMultiSelect) === null || _73 === void 0 ? void 0 : _73.toString() }))] })), currentFields.includes("enableAuditTracking") && formik.values.relationType !== "one-to-many" && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SolidCheckbox, { id: "enableAuditTracking", name: "enableAuditTracking", onChange: function (event) {
1613
- formik.setFieldValue("enableAuditTracking", event.currentTarget.checked);
1614
- }, checked: formik.values.enableAuditTracking }), _jsx("label", { htmlFor: "enableAuditTracking", className: classNames("form-field-label", styles.fieldLabel), children: "Enable Audit Tracking" })] }), _jsx("p", { className: "fieldSubTitle", children: "By selecting this option, you are setting audit trail for this field." }), isFormFieldValid(formik, "enableAuditTracking") && (_jsx("p", { className: styles.fieldError, children: (_75 = (_74 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _74 === void 0 ? void 0 : _74.enableAuditTracking) === null || _75 === void 0 ? void 0 : _75.toString() }))] })), currentFields.includes("isUserKey") && formik.values.unique && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SolidCheckbox, { id: "isUserKey", name: "isUserKey", onChange: function (event) {
1615
- formik.setFieldValue("isUserKey", event.currentTarget.checked);
1616
- }, checked: formik.values.isUserKey }), _jsx("label", { htmlFor: "isUserKey", className: classNames("form-field-label", styles.fieldLabel), children: "Is Userkey" })] }), _jsx("p", { className: "fieldSubTitle", children: "By selecting this option, you are setting this field as the model's user key. Any existing user key configuration will be overwritten" }), isFormFieldValid(formik, "isUserKey") && (_jsx("p", { className: styles.fieldError, children: (_77 = (_76 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _76 === void 0 ? void 0 : _76.isUserKey) === null || _77 === void 0 ? void 0 : _77.toString() }))] })), currentFields.includes("isPrimaryKey") && (modelMetaData === null || modelMetaData === void 0 ? void 0 : modelMetaData.isLegacyTable) && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SolidCheckbox, { id: "isPrimaryKey", name: "isPrimaryKey", onChange: function (event) {
1617
- var checked = event.currentTarget.checked;
1618
- formik.setFieldValue("isPrimaryKey", checked);
1619
- // Auto-set required and unique when isPrimaryKey is checked
1620
- if (checked) {
1621
- formik.setFieldValue("required", true);
1622
- formik.setFieldValue("unique", true);
1623
- }
1624
- }, checked: formik.values.isPrimaryKey }), _jsx("label", { htmlFor: "isPrimaryKey", className: classNames("form-field-label", styles.fieldLabel), children: "Is Primary Key" })] }), _jsx("p", { className: "fieldSubTitle", children: "By selecting this option, you are setting this field as the primary key for this legacy table." }), isFormFieldValid(formik, "isPrimaryKey") && (_jsx("p", { className: styles.fieldError, children: (_79 = (_78 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _78 === void 0 ? void 0 : _78.isPrimaryKey) === null || _79 === void 0 ? void 0 : _79.toString() }))] }))] }), formik.values.encrypt === true && (_jsxs("div", { className: "mt-2 flex flex-wrap -mx-2 -mt-2", children: [_jsx("div", { className: "w-full px-2 pt-2 md:w-1/2", children: _jsxs("div", { className: "field flex w-full flex-col gap-2", children: [_jsx("label", { htmlFor: "encryptionType", className: classNames("form-field-label", styles.fieldLabel), children: "Encryption Type" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_k = {},
1625
- _k[styles.fieldInvalidControl] = isFormFieldValid(formik, "encryptionType"),
1626
- _k)), children: _jsx(SolidAutocomplete, { value: encryptionTypeField.selectedItem, suggestions: encryptionTypeField.filteredItems, completeMethod: encryptionTypeField.searchItems, onChange: encryptionTypeField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "encryptionType") && (_jsx("p", { className: styles.fieldError, children: (_81 = (_80 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _80 === void 0 ? void 0 : _80.encryptionType) === null || _81 === void 0 ? void 0 : _81.toString() }))] }) }), _jsx("div", { className: "w-full px-2 pt-2 md:w-1/2", children: _jsxs("div", { className: "field flex w-full flex-col gap-2", children: [_jsx("label", { htmlFor: "decryptWhen", className: classNames("form-field-label", styles.fieldLabel), children: "Decrypt When" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_l = {},
1627
- _l[styles.fieldInvalidControl] = isFormFieldValid(formik, "decryptWhen"),
1628
- _l)), children: _jsx(SolidAutocomplete, { value: decryptWhenField.selectedItem, suggestions: decryptWhenField.filteredItems, completeMethod: decryptWhenField.searchItems, onChange: decryptWhenField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "decryptWhen") && (_jsx("p", { className: styles.fieldError, children: (_83 = (_82 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _82 === void 0 ? void 0 : _82.decryptWhen) === null || _83 === void 0 ? void 0 : _83.toString() }))] }) })] }))] })] }), _jsxs("div", { className: "mt-4 flex gap-4", children: [_jsx("div", { children: _jsx(SolidButton, { label: submitLabel, size: "small", onClick: function () { return showError(); }, type: "submit" }) }), _jsx("div", { children: _jsx(SolidButton, { label: "Cancel", size: "small", severity: "secondary", type: "reset", onClick: closeForm, outlined: true }) })] })] }) }) }) }) }), _jsx(SolidDialog, { open: isBackPopupVisible, onOpenChange: function (next) {
1635
+ }, checked: formik.values.isPrimaryKey }), _jsx("label", { htmlFor: "isPrimaryKey", className: classNames("form-field-label", styles.fieldLabel), children: "Is Primary Key" })] }), _jsx("p", { className: "fieldSubTitle", children: "By selecting this option, you are setting this field as the primary key for this legacy table." }), isFormFieldValid(formik, "isPrimaryKey") && (_jsx("p", { className: styles.fieldError, children: (_82 = (_81 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _81 === void 0 ? void 0 : _81.isPrimaryKey) === null || _82 === void 0 ? void 0 : _82.toString() }))] }))] }), formik.values.encrypt === true && (_jsxs("div", { className: "mt-2 flex flex-wrap -mx-2 -mt-2", children: [_jsx("div", { className: "w-full px-2 pt-2 md:w-1/2", children: _jsxs("div", { className: "field flex w-full flex-col gap-2", children: [_jsx("label", { htmlFor: "encryptionType", className: classNames("form-field-label", styles.fieldLabel), children: "Encryption Type" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_k = {},
1636
+ _k[styles.fieldInvalidControl] = isFormFieldValid(formik, "encryptionType"),
1637
+ _k)), children: _jsx(SolidAutocomplete, { value: encryptionTypeField.selectedItem, suggestions: encryptionTypeField.filteredItems, completeMethod: encryptionTypeField.searchItems, onChange: encryptionTypeField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "encryptionType") && (_jsx("p", { className: styles.fieldError, children: (_84 = (_83 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _83 === void 0 ? void 0 : _83.encryptionType) === null || _84 === void 0 ? void 0 : _84.toString() }))] }) }), _jsx("div", { className: "w-full px-2 pt-2 md:w-1/2", children: _jsxs("div", { className: "field flex w-full flex-col gap-2", children: [_jsx("label", { htmlFor: "decryptWhen", className: classNames("form-field-label", styles.fieldLabel), children: "Decrypt When" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_l = {},
1638
+ _l[styles.fieldInvalidControl] = isFormFieldValid(formik, "decryptWhen"),
1639
+ _l)), children: _jsx(SolidAutocomplete, { value: decryptWhenField.selectedItem, suggestions: decryptWhenField.filteredItems, completeMethod: decryptWhenField.searchItems, onChange: decryptWhenField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "decryptWhen") && (_jsx("p", { className: styles.fieldError, children: (_86 = (_85 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _85 === void 0 ? void 0 : _85.decryptWhen) === null || _86 === void 0 ? void 0 : _86.toString() }))] }) })] }))] })] }) }), _jsxs("div", { className: "solid-field-form-actions", children: [_jsx(SolidButton, { label: submitLabel, size: "small", onClick: function () { return showError(); }, type: "submit" }), _jsx(SolidButton, { label: "Cancel", size: "small", severity: "secondary", type: "reset", onClick: closeForm, outlined: true })] })] }) }) }) }) }), _jsx(SolidDialog, { open: isBackPopupVisible, onOpenChange: function (next) {
1629
1640
  if (!next) {
1630
1641
  setIsBackPopupVisible(false);
1631
1642
  }