@solidxai/core-ui 0.1.12-beta.3 → 0.1.12-beta.6

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 (86) hide show
  1. package/dist/components/auth/AuthLayout.d.ts.map +1 -1
  2. package/dist/components/auth/AuthLayout.js +12 -5
  3. package/dist/components/auth/AuthLayout.js.map +1 -1
  4. package/dist/components/auth/AuthLayout.tsx +15 -4
  5. package/dist/components/auth/AuthSettingsContext.js +1 -1
  6. package/dist/components/auth/AuthSettingsContext.js.map +1 -1
  7. package/dist/components/auth/AuthSettingsContext.tsx +1 -1
  8. package/dist/components/core/chatter/SolidChatterHeader.d.ts.map +1 -1
  9. package/dist/components/core/chatter/SolidChatterHeader.js +18 -4
  10. package/dist/components/core/chatter/SolidChatterHeader.js.map +1 -1
  11. package/dist/components/core/chatter/SolidChatterHeader.tsx +17 -3
  12. package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.d.ts.map +1 -1
  13. package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.js +12 -2
  14. package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.js.map +1 -1
  15. package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.tsx +12 -1
  16. package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.d.ts +2 -0
  17. package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.d.ts.map +1 -1
  18. package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.js +4 -2
  19. package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.js.map +1 -1
  20. package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.tsx +11 -3
  21. package/dist/components/core/form/SolidFormView.js +1 -1
  22. package/dist/components/core/form/SolidFormView.js.map +1 -1
  23. package/dist/components/core/form/SolidFormView.tsx +1 -1
  24. package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.d.ts.map +1 -1
  25. package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.js +11 -1
  26. package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.js.map +1 -1
  27. package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.tsx +26 -19
  28. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
  29. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +13 -5
  30. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
  31. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +16 -9
  32. package/dist/components/core/json/SolidJsonEditor.css +7 -0
  33. package/dist/components/core/list/SolidDataTable.d.ts.map +1 -1
  34. package/dist/components/core/list/SolidDataTable.js +2 -2
  35. package/dist/components/core/list/SolidDataTable.js.map +1 -1
  36. package/dist/components/core/list/SolidDataTable.tsx +2 -1
  37. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  38. package/dist/components/core/list/SolidListView.js +58 -58
  39. package/dist/components/core/list/SolidListView.js.map +1 -1
  40. package/dist/components/core/list/SolidListView.tsx +5 -4
  41. package/dist/components/core/model/FieldMetaDataForm.d.ts +1 -1
  42. package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
  43. package/dist/components/core/model/FieldMetaDataForm.js +119 -102
  44. package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
  45. package/dist/components/core/model/FieldMetaDataForm.tsx +82 -39
  46. package/dist/components/core/model/FieldSelector.d.ts +5 -1
  47. package/dist/components/core/model/FieldSelector.d.ts.map +1 -1
  48. package/dist/components/core/model/FieldSelector.js +25 -6
  49. package/dist/components/core/model/FieldSelector.js.map +1 -1
  50. package/dist/components/core/model/FieldSelector.tsx +50 -5
  51. package/dist/components/core/module/CreateModule.css +60 -6
  52. package/dist/components/core/module/CreateModule.d.ts.map +1 -1
  53. package/dist/components/core/module/CreateModule.js +2 -2
  54. package/dist/components/core/module/CreateModule.js.map +1 -1
  55. package/dist/components/core/module/CreateModule.tsx +56 -37
  56. package/dist/components/layout/AdminTopHeader.js +1 -1
  57. package/dist/components/layout/AdminTopHeader.js.map +1 -1
  58. package/dist/components/layout/AdminTopHeader.tsx +2 -2
  59. package/dist/components/shad-cn-ui/SolidSelect.d.ts +2 -1
  60. package/dist/components/shad-cn-ui/SolidSelect.d.ts.map +1 -1
  61. package/dist/components/shad-cn-ui/SolidSelect.js +12 -4
  62. package/dist/components/shad-cn-ui/SolidSelect.js.map +1 -1
  63. package/dist/components/shad-cn-ui/SolidSelect.tsx +13 -1
  64. package/dist/helpers/modelViewPersistence.d.ts.map +1 -1
  65. package/dist/helpers/modelViewPersistence.js +3 -2
  66. package/dist/helpers/modelViewPersistence.js.map +1 -1
  67. package/dist/helpers/modelViewPersistence.ts +3 -2
  68. package/dist/redux/api/datasourceIntrospectionApi.d.ts +43 -1
  69. package/dist/redux/api/datasourceIntrospectionApi.d.ts.map +1 -1
  70. package/dist/redux/api/datasourceIntrospectionApi.js +34 -1
  71. package/dist/redux/api/datasourceIntrospectionApi.js.map +1 -1
  72. package/dist/redux/api/datasourceIntrospectionApi.ts +61 -0
  73. package/dist/redux/store/defaultStoreConfig.d.ts +11 -0
  74. package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
  75. package/dist/resources/solid-custom.css +3 -86
  76. package/dist/resources/solid-tailwind-generated.css +1 -1
  77. package/dist/resources/themes/solid-dark-purple/theme-variables.css +226 -0
  78. package/dist/resources/themes/solid-dark-purple/theme.css +1 -185
  79. package/dist/resources/themes/solid-light-purple/theme-variables.css +237 -0
  80. package/dist/resources/themes/solid-light-purple/theme.css +1 -206
  81. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.css +396 -31
  82. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts.map +1 -1
  83. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js +680 -152
  84. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js.map +1 -1
  85. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.tsx +1358 -441
  86. package/package.json +1 -1
@@ -560,8 +560,8 @@ var createValidationSchema = function (currentFields, selectedType, allFields, f
560
560
  };
561
561
  var FieldMetaDataForm = function (_a) {
562
562
  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;
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;
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;
565
565
  var booleanOptions = ["false", "true"];
566
566
  var booleanSegmentedOptions = booleanOptions.map(function (value) { return ({
567
567
  label: capitalize(value),
@@ -570,39 +570,53 @@ var FieldMetaDataForm = function (_a) {
570
570
  var resolveBooleanOptionValue = function (value) {
571
571
  return typeof value === "string" ? value : value ? "true" : "false";
572
572
  };
573
- var _83 = useState(false), isBackPopupVisible = _83[0], setIsBackPopupVisible = _83[1];
574
- var _84 = useState(false), showColumnName = _84[0], setShowColumnName = _84[1];
573
+ var _90 = useState(false), isBackPopupVisible = _90[0], setIsBackPopupVisible = _90[1];
574
+ var _91 = useState(false), showColumnName = _91[0], setShowColumnName = _91[1];
575
575
  var pathname = usePathname();
576
- var _85 = useGetFieldDefaultMetaDataQuery(null), fieldDefaultMetaData = _85.data, isLoading = _85.isLoading, error = _85.error, refetch = _85.refetch;
577
- var _86 = useState(fetchCurrentFields(fieldMetaData && fieldMetaData.type, fieldDefaultMetaData)), currentFields = _86[0], setCurrentFields = _86[1];
578
- var _87 = useLazyGetMediaStorageProvidersQuery(), triggerGetMediaStorageProvider = _87[0], _88 = _87[1], MediaStorageProviderData = _88.data, isMediaStorageProviderFetching = _88.isFetching, MediaStorageProviderError = _88.error;
579
- var _89 = useLazyGetmodulesQuery(), triggerGetModules = _89[0], _90 = _89[1], moduleData = _90.data, isModuleFetching = _90.isFetching, moduleError = _90.error;
580
- var _91 = useLazyGetModelsQuery(), triggerGetModels = _91[0], _92 = _91[1], modelData = _92.data, ismodelFetching = _92.isFetching, modelError = _92.error;
581
- var _93 = useUpdateUserKeyMutation(), updateUserKey = _93[0], _94 = _93[1], isUpdateUserKeyLoading = _94.isLoading, isUpdateUserKeySuccess = _94.isSuccess, isUpdateUserKeyError = _94.isError, UpdateUserKeyError = _94.error, newModel = _94.data;
582
- var _95 = useState(), markdownText = _95[0], setMarkdownText = _95[1];
583
- var _96 = useState(Boolean(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.encrypt)), encryptState = _96[0], setEncryptState = _96[1];
584
- var _97 = useState(fieldMetaData ? false : true), showTypeFilter = _97[0], setShowTypeFilter = _97[1];
585
- var _98 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.type) ? { label: fieldMetaData.type, value: fieldMetaData.type } : null), selectedType = _98[0], setSelectedType = _98[1];
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)
586
+ ? { label: fieldMetaData.type, value: fieldMetaData.type }
587
+ : selectorInitialFieldType
588
+ ? { label: selectorInitialFieldType, value: selectorInitialFieldType }
589
+ : null), selectedType = _105[0], setSelectedType = _105[1];
586
590
  var selectedTypeValue = (selectedType === null || selectedType === void 0 ? void 0 : selectedType.value) || "";
587
- var _99 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.computedFieldValueType) && { label: fieldMetaData.computedFieldValueType, value: fieldMetaData.computedFieldValueType }), selectedComputedFieldValueType = _99[0], setSelectedComputedFieldValueType = _99[1];
588
- var _100 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.selectionDynamicProvider) && { label: fieldMetaData.selectionDynamicProvider, value: fieldMetaData.selectionDynamicProvider }), selectionDynamicProvider = _100[0], setSelectionDynamicProvider = _100[1];
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];
589
593
  // const [externalIdProvider, setExternalIdProvider] = useState(fieldMetaData?.externalIdProvider && { label: fieldMetaData.externalIdProvider, value: fieldMetaData.externalIdProvider });
590
- var _101 = useState([]), filteredComputedFieldValueTypes = _101[0], setFilteredComputedFieldValueTypes = _101[1];
591
- var _102 = useState([]), filteredSelectionDynamicProvider = _102[0], setFilteredSelectionDynamicProvider = _102[1];
592
- var _103 = useState([]), ormTypeOptions = _103[0], setOrmTypeOptions = _103[1];
593
- var _104 = useState(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.ormType), selectedOrmType = _104[0], setSelectedOrmType = _104[1];
594
- var _105 = useState(false), askForUserKeyField = _105[0], setAskForUserKeyField = _105[1];
595
- var _106 = useState([]), userKeyFieldData = _106[0], setUserKeyFieldData = _106[1];
596
- var _107 = useState([]), filteredExternalIdProvider = _107[0], setFilteredExternalIdProvider = _107[1];
597
- var _108 = useState([]), filteredSelectionEncryptionType = _108[0], setFilteredSelectionEncryptionType = _108[1];
598
- var _109 = useState([]), filteredSelectionDecryptWhen = _109[0], setFilteredSelectionDecryptWhen = _109[1];
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];
599
603
  var validationSchema = React.useMemo(function () { return createValidationSchema(currentFields, selectedType, allFields, fieldMetaData, encryptState); }, [currentFields, encryptState]);
600
- var _110 = useState(false), typeSelected = _110[0], setTypeSelected = _110[1];
604
+ var _117 = useState(false), typeSelected = _117[0], setTypeSelected = _117[1];
601
605
  var showRegexFields = currentFields.includes("regexPattern");
602
606
  var showMinFields = currentFields.includes("min");
603
607
  var showMaxFields = currentFields.includes("max");
604
608
  var showOrmOptions = currentFields.includes("ormType") && Boolean(ormTypeOptions && ormTypeOptions.length);
605
609
  var showValidationSection = selectedTypeValue !== "relation" && (showRegexFields || showMinFields || showMaxFields || showOrmOptions);
610
+ var isExistingFieldReadOnly = disableIdentityEditingForExisting && Boolean(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id);
611
+ var closeForm = useCallback(function () {
612
+ if (typeof onClose === "function") {
613
+ onClose();
614
+ return;
615
+ }
616
+ if (typeof setVisiblePopup === "function") {
617
+ setVisiblePopup(false);
618
+ }
619
+ }, [onClose, setVisiblePopup]);
606
620
  var searchMediaStorageProvIderId = function (event) { return __awaiter(void 0, void 0, void 0, function () {
607
621
  var query, queryData, queryString, result, updatedSuggestion, error_1;
608
622
  return __generator(this, function (_a) {
@@ -970,7 +984,7 @@ var FieldMetaDataForm = function (_a) {
970
984
  { label: "False", value: "false" },
971
985
  ];
972
986
  var defaultPasswordPolicy = fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.regexPattern;
973
- var _111 = useState(defaultPasswordPolicy), selectedPasswordPolicy = _111[0], setSelectedPasswordPolicy = _111[1];
987
+ var _118 = useState(defaultPasswordPolicy), selectedPasswordPolicy = _118[0], setSelectedPasswordPolicy = _118[1];
974
988
  var passwordPolicyOptions = [
975
989
  { label: 'Lowercase and Uppercase Alphabets Required', value: '^(?=.*[a-z])(?=.*[A-Z]).*$' },
976
990
  { label: 'Lowercase and Uppercase Alphabets and Numbers Required', value: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).*$' },
@@ -984,7 +998,7 @@ var FieldMetaDataForm = function (_a) {
984
998
  { label: 'File (Supports PDF, DOCX, TXT, etc.)', value: 'file' }
985
999
  ];
986
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]);
987
- var _112 = useState(resolvedMediaTypeOptions), filteredMediaTypes = _112[0], setFilteredMediaTypes = _112[1];
1001
+ var _119 = useState(resolvedMediaTypeOptions), filteredMediaTypes = _119[0], setFilteredMediaTypes = _119[1];
988
1002
  useEffect(function () {
989
1003
  setFilteredMediaTypes(resolvedMediaTypeOptions);
990
1004
  }, [resolvedMediaTypeOptions]);
@@ -1070,37 +1084,40 @@ var FieldMetaDataForm = function (_a) {
1070
1084
  validationSchema: validationSchema,
1071
1085
  enableReinitialize: true,
1072
1086
  onSubmit: function (values) { return __awaiter(void 0, void 0, void 0, function () {
1073
- var data;
1087
+ var newFieldData, formtatedFieldPayload_1, data;
1074
1088
  return __generator(this, function (_a) {
1075
1089
  try {
1076
- setFieldMetaData(function (prevItems) {
1077
- var newFieldData = __assign(__assign({}, values), { isSystem: values.isSystem == true ? true : '' });
1078
- var formtatedFieldPayload = fieldBasedPayloadFormating(newFieldData, currentFields, fieldMetaData);
1079
- var existingIndex = prevItems.findIndex(function (item) { return item.identifier === formtatedFieldPayload.identifier; });
1080
- var updatedItems;
1081
- if (existingIndex !== -1) {
1082
- updatedItems = __spreadArray([], prevItems, true);
1083
- updatedItems[existingIndex] = formtatedFieldPayload;
1084
- return updatedItems;
1085
- }
1086
- else {
1087
- updatedItems = __spreadArray(__spreadArray([], prevItems, true), [formtatedFieldPayload], false);
1088
- if ((params === null || params === void 0 ? void 0 : params.id) !== 'new' && (formtatedFieldPayload === null || formtatedFieldPayload === void 0 ? void 0 : formtatedFieldPayload.required) && !(formtatedFieldPayload === null || formtatedFieldPayload === void 0 ? void 0 : formtatedFieldPayload.defaultValue)) {
1089
- setIsRequiredPopUp(true);
1090
+ newFieldData = __assign(__assign({}, values), { isSystem: values.isSystem == true ? true : '' });
1091
+ formtatedFieldPayload_1 = fieldBasedPayloadFormating(newFieldData, currentFields, fieldMetaData);
1092
+ if (typeof onDraftSubmit === "function") {
1093
+ onDraftSubmit(formtatedFieldPayload_1);
1094
+ }
1095
+ else {
1096
+ setFieldMetaData(function (prevItems) {
1097
+ var existingIndex = prevItems.findIndex(function (item) { return item.identifier === formtatedFieldPayload_1.identifier; });
1098
+ var updatedItems;
1099
+ if (existingIndex !== -1) {
1100
+ updatedItems = __spreadArray([], prevItems, true);
1101
+ updatedItems[existingIndex] = formtatedFieldPayload_1;
1102
+ return updatedItems;
1090
1103
  }
1091
- // return [...prevItems, formtatedFieldPayload]
1104
+ else {
1105
+ updatedItems = __spreadArray(__spreadArray([], prevItems, true), [formtatedFieldPayload_1], false);
1106
+ if ((params === null || params === void 0 ? void 0 : params.id) !== 'new' && (formtatedFieldPayload_1 === null || formtatedFieldPayload_1 === void 0 ? void 0 : formtatedFieldPayload_1.required) && !(formtatedFieldPayload_1 === null || formtatedFieldPayload_1 === void 0 ? void 0 : formtatedFieldPayload_1.defaultValue)) {
1107
+ setIsRequiredPopUp(true);
1108
+ }
1109
+ }
1110
+ return updatedItems;
1111
+ });
1112
+ if (values.userKey) {
1113
+ data = {
1114
+ modelName: values.relationCoModelSingularName,
1115
+ fieldName: values.userKey
1116
+ };
1117
+ updateUserKey(data);
1092
1118
  }
1093
- return updatedItems;
1094
- });
1095
- if (values.userKey) {
1096
- data = {
1097
- modelName: values.relationCoModelSingularName,
1098
- fieldName: values.userKey
1099
- };
1100
- updateUserKey(data);
1101
1119
  }
1102
- // nextTab()
1103
- setVisiblePopup(false);
1120
+ closeForm();
1104
1121
  }
1105
1122
  catch (err) {
1106
1123
  console.error(ERROR_MESSAGES.CREATE_MODEL, err);
@@ -1408,9 +1425,9 @@ var FieldMetaDataForm = function (_a) {
1408
1425
  event.preventDefault();
1409
1426
  resetFormStateForTypeSelection();
1410
1427
  }, children: showTypeFilter === true ?
1411
- _jsx(FieldSelector, { handleTypeSelect: handleTypeSelect, modelMetaData: modelMetaData })
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 })
1412
1429
  :
1413
- _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: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, id: "displayName", name: "displayName", onChange: function (e) {
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) {
1414
1431
  formik.setFieldValue("displayName", e.target.value);
1415
1432
  var _a = getSingularAndPlural(e.target.value), toCamelCase = _a.toCamelCase, toSnakeCase = _a.toSnakeCase;
1416
1433
  formik.setFieldValue("name", toCamelCase);
@@ -1419,11 +1436,11 @@ var FieldMetaDataForm = function (_a) {
1419
1436
  }
1420
1437
  }, value: formik.values.displayName, className: classNames(styles.fieldInput, {
1421
1438
  "p-invalid": isFormFieldValid(formik, "displayName"),
1422
- }) }), isFormFieldValid(formik, "displayName") && (_jsx("p", { className: styles.fieldError, children: (_r = (_q = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _q === void 0 ? void 0 : _q.displayName) === null || _r === void 0 ? void 0 : _r.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: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, type: "text", id: "name", name: "name", onChange: formik.handleChange, value: formik.values.name, className: classNames(styles.fieldInput, {
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, {
1423
1440
  "p-invalid": isFormFieldValid(formik, "name"),
1424
- }) }), isFormFieldValid(formik, "name") && (_jsx("p", { className: styles.fieldError, children: (_t = (_s = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _s === void 0 ? void 0 : _s.name) === null || _t === void 0 ? void 0 : _t.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, {
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, {
1425
1442
  "p-invalid": isFormFieldValid(formik, "description"),
1426
- }) }), isFormFieldValid(formik, "description") && (_jsx("p", { className: styles.fieldError, children: (_v = (_u = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _u === void 0 ? void 0 : _u.description) === null || _v === void 0 ? void 0 : _v.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) {
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) {
1427
1444
  var checked = event.currentTarget.checked;
1428
1445
  setShowColumnName(checked);
1429
1446
  if (checked === true) {
@@ -1435,11 +1452,11 @@ var FieldMetaDataForm = function (_a) {
1435
1452
  else {
1436
1453
  formik.setFieldValue("columnName", null);
1437
1454
  }
1438
- }, checked: showColumnName, disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id }), _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: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, type: "text", id: "columnName", name: "columnName", onChange: formik.handleChange, value: formik.values.columnName, className: classNames(styles.fieldInput, {
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, {
1439
1456
  "p-invalid": isFormFieldValid(formik, "columnName"),
1440
- }) }), isFormFieldValid(formik, "columnName") && (_jsx("p", { className: styles.fieldError, children: (_x = (_w = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _w === void 0 ? void 0 : _w.columnName) === null || _x === void 0 ? void 0 : _x.toString() }))] }))] }))] }) }), _jsxs(TabPanel, { header: "Advanced Config", children: [((_z = (_y = formik === null || formik === void 0 ? void 0 : formik.values) === null || _y === void 0 ? void 0 : _y.type) === null || _z === void 0 ? void 0 : _z.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({
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({
1441
1458
  "p-invalid": isFormFieldValid(formik, "length"),
1442
- }) }) }), isFormFieldValid(formik, "length") && (_jsx("p", { className: styles.fieldError, children: (_1 = (_0 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _0 === void 0 ? void 0 : _0.length) === null || _1 === void 0 ? void 0 : _1.toString() }))] })), currentFields.includes("defaultValue") && selectedTypeValue === "boolean" &&
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" &&
1443
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("", {
1444
1461
  "p-invalid": isFormFieldValid(formik, "defaultValue"),
1445
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,7 +1480,7 @@ var FieldMetaDataForm = function (_a) {
1463
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({
1464
1481
  "p-invalid": isFormFieldValid(formik, "defaultValue"),
1465
1482
  }) }));
1466
- })(), isFormFieldValid(formik, "defaultValue") && (_jsx("p", { className: styles.fieldError, children: (_3 = (_2 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _2 === void 0 ? void 0 : _2.defaultValue) === null || _3 === void 0 ? void 0 : _3.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 = {},
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 = {},
1467
1484
  _b[styles.fieldInvalidControl] = isFormFieldValid(formik, "mediaTypes"),
1468
1485
  _b)), children: _jsx(SolidAutocomplete, { multiple: true, dropdown: true, field: "label", value: mediaTypeSelectedItems, suggestions: filteredMediaTypes, completeMethod: handleMediaTypesSearch, maxVisibleChips: 3, onChange: function (_a) {
1469
1486
  var value = _a.value;
@@ -1480,69 +1497,69 @@ var FieldMetaDataForm = function (_a) {
1480
1497
  })
1481
1498
  .filter(Boolean);
1482
1499
  formik.setFieldValue("mediaTypes", normalizedValues);
1483
- }, placeholder: "Select media types", className: "w-full" }) }), isFormFieldValid(formik, "mediaTypes") && (_jsx("p", { className: styles.fieldError, children: (_5 = (_4 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _4 === void 0 ? void 0 : _4.mediaTypes) === null || _5 === void 0 ? void 0 : _5.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({
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({
1484
1501
  "p-invalid": isFormFieldValid(formik, "mediaMaxSizeKb"),
1485
- }) }) }), isFormFieldValid(formik, "mediaMaxSizeKb") && (_jsx("p", { className: styles.fieldError, children: (_7 = (_6 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _6 === void 0 ? void 0 : _6.mediaMaxSizeKb) === null || _7 === void 0 ? void 0 : _7.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 = {},
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 = {},
1486
1503
  _c[styles.fieldInvalidControl] = isFormFieldValid(formik, "mediaStorageProvider"),
1487
- _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: (_9 = (_8 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _8 === void 0 ? void 0 : _8.mediaStorageProviderId) === null || _9 === void 0 ? void 0 : _9.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) {
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) {
1488
1505
  formik.setFieldValue("mediaEmbedded", value);
1489
1506
  }, options: booleanSegmentedOptions, className: classNames("", {
1490
1507
  "p-invalid": isFormFieldValid(formik, "mediaEmbedded"),
1491
- }) }), isFormFieldValid(formik, "mediaEmbedded") && (_jsx("p", { className: styles.fieldError, children: (_11 = (_10 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _10 === void 0 ? void 0 : _10.mediaEmbedded) === null || _11 === void 0 ? void 0 : _11.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) {
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) {
1492
1509
  formik.setFieldValue("relationType", value);
1493
1510
  if (value === "one-to-many") {
1494
1511
  formik.setFieldValue("relationCreateInverse", true);
1495
1512
  }
1496
1513
  }, className: classNames("", {
1497
1514
  "p-invalid": isFormFieldValid(formik, "relationType"),
1498
- }) }), isFormFieldValid(formik, "relationType") && (_jsx("p", { className: styles.fieldError, children: (_13 = (_12 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _12 === void 0 ? void 0 : _12.relationType) === null || _13 === void 0 ? void 0 : _13.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) {
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) {
1499
1516
  var value = _a.value;
1500
1517
  return formik.setFieldValue("relationCascade", value);
1501
1518
  }, placeholder: "Cascade", className: classNames("w-full", {
1502
1519
  "p-invalid": isFormFieldValid(formik, "relationCascade"),
1503
- }) }), isFormFieldValid(formik, "relationCascade") && (_jsx("p", { className: styles.fieldError, children: (_15 = (_14 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _14 === void 0 ? void 0 : _14.relationCascade) === null || _15 === void 0 ? void 0 : _15.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 = {},
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 = {},
1504
1521
  _d[styles.fieldInvalidControl] = isFormFieldValid(formik, "relationModelModuleName"),
1505
- _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: (_17 = (_16 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _16 === void 0 ? void 0 : _16.relationModelModuleName) === null || _17 === void 0 ? void 0 : _17.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 = {},
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 = {},
1506
1523
  _e[styles.fieldInvalidControl] = isFormFieldValid(formik, "relationCoModelSingularName"),
1507
- _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: (_19 = (_18 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _18 === void 0 ? void 0 : _18.relationCoModelSingularName) === null || _19 === void 0 ? void 0 : _19.toString() })), formik.values.relationType === "one-to-many" &&
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" &&
1508
1525
  _jsx("p", { className: "fieldSubTitle", children: "This is the child model." }), formik.values.relationType === "many-to-one" &&
1509
- _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: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, value: formik.values.relationCoModelColumnName, className: classNames(styles.fieldInput, {
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, {
1510
1527
  "p-invalid": isFormFieldValid(formik, "relationCoModelColumnName"),
1511
- }) }), isFormFieldValid(formik, "relationCoModelColumnName") && (_jsx("p", { className: styles.fieldError, children: (_21 = (_20 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _20 === void 0 ? void 0 : _20.relationCoModelColumnName) === null || _21 === void 0 ? void 0 : _21.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 = {},
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 = {},
1512
1529
  _f[styles.fieldInvalidControl] = isFormFieldValid(formik, "userKey"),
1513
- _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: (_23 = (_22 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _22 === void 0 ? void 0 : _22.userKey) === null || _23 === void 0 ? void 0 : _23.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, {
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, {
1514
1531
  "p-invalid": isFormFieldValid(formik, "relationFieldFixedFilter"),
1515
- }) }), isFormFieldValid(formik, "relationFieldFixedFilter") && (_jsx("p", { className: styles.fieldError, children: (_25 = (_24 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _24 === void 0 ? void 0 : _24.relationFieldFixedFilter) === null || _25 === void 0 ? void 0 : _25.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: (_27 = (_26 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _26 === void 0 ? void 0 : _26.relationCreateInverse) === null || _27 === void 0 ? void 0 : _27.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: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, value: formik.values.relationCoModelFieldName, className: classNames(styles.fieldInput, {
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, {
1516
1533
  "p-invalid": isFormFieldValid(formik, "relationCoModelFieldName"),
1517
1534
  }) }), formik.values.relationType === "one-to-many" &&
1518
- _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: (_28 = formik.values.relationCoModelFieldName) !== null && _28 !== void 0 ? _28 : formik.values.relationCoModelSingularName }), " field will be created in the ", formik.values.relationCoModelSingularName, " when setting create inverse true."] }), formik.values.relationType === "many-to-one" &&
1519
- _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: (_29 = formik.values.relationCoModelFieldName) !== null && _29 !== void 0 ? _29 : "".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" &&
1520
- _jsxs("p", { className: "fieldSubTitle", children: ["In this case a ", formik.values.relationCoModelFieldName, " field will be created in the ", _jsx("span", { style: { fontWeight: "700" }, children: (_30 = formik.values.relationCoModelSingularName) !== null && _30 !== void 0 ? _30 : '{{}}' }), " when setting create inverse true."] }), isFormFieldValid(formik, "relationCoModelFieldName") && (_jsx("p", { className: styles.fieldError, children: (_32 = (_31 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _31 === void 0 ? void 0 : _31.relationCoModelFieldName) === null || _32 === void 0 ? void 0 : _32.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: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, value: formik.values.relationJoinTableName, className: classNames(styles.fieldInput, {
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, {
1521
1538
  "p-invalid": isFormFieldValid(formik, "relationJoinTableName"),
1522
- }) }), isFormFieldValid(formik, "relationJoinTableName") && (_jsx("p", { className: styles.fieldError, children: (_34 = (_33 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _33 === void 0 ? void 0 : _33.relationJoinTableName) === null || _34 === void 0 ? void 0 : _34.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 = {},
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 = {},
1523
1540
  _g[styles.fieldInvalidControl] = isFormFieldValid(formik, "selectionDynamicProvider"),
1524
- _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: (_36 = (_35 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _35 === void 0 ? void 0 : _35.selectionDynamicProvider) === null || _36 === void 0 ? void 0 : _36.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) {
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) {
1525
1542
  var value = _a.value;
1526
1543
  return formik.setFieldValue("selectionValueType", value);
1527
1544
  }, placeholder: "Select Value Type", className: classNames("w-full", {
1528
1545
  "p-invalid": isFormFieldValid(formik, "selectionValueType"),
1529
- }) }), isFormFieldValid(formik, "selectionValueType") && (_jsx("p", { className: styles.fieldError, children: (_38 = (_37 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _37 === void 0 ? void 0 : _37.selectionValueType) === null || _38 === void 0 ? void 0 : _38.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: (_40 = (_39 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _39 === void 0 ? void 0 : _39.selectionStaticValues) === null || _40 === void 0 ? void 0 : _40.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 = {},
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 = {},
1530
1547
  _h[styles.fieldInvalidControl] = isFormFieldValid(formik, "computedFieldValueType"),
1531
1548
  _h)), onChange: function (e) {
1532
1549
  setSelectedComputedFieldValueType(e.value);
1533
1550
  formik.setFieldValue("computedFieldValueType", e.value.value);
1534
- } }), isFormFieldValid(formik, "computedFieldValueType") && (_jsx("p", { className: styles.fieldError, children: (_42 = (_41 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _41 === void 0 ? void 0 : _41.computedFieldValueType) === null || _42 === void 0 ? void 0 : _42.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 = {},
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 = {},
1535
1552
  _j[styles.fieldInvalidControl] = isFormFieldValid(formik, "computedFieldValueProvider"),
1536
- _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: (_44 = (_43 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _43 === void 0 ? void 0 : _43.computedFieldValueProvider) === null || _44 === void 0 ? void 0 : _44.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
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
1537
1554
  &&
1538
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) {
1539
1556
  var _a;
1540
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));
1541
- }), 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: (_45 = formik.values.selectionDynamicProviderCtxt) !== null && _45 !== void 0 ? _45 : "", onChange: function (value) {
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) {
1542
1559
  formik.setFieldValue("selectionDynamicProviderCtxt", value !== null && value !== void 0 ? value : "");
1543
- }, language: "json", height: "300px" }), _jsx("div", { className: " form-field-label mt-2", children: markdownText }), isFormFieldValid(formik, "selectionDynamicProviderCtxt") && (_jsx("p", { className: styles.fieldError, children: (_47 = (_46 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _46 === void 0 ? void 0 : _46.selectionDynamicProviderCtxt) === null || _47 === void 0 ? void 0 : _47.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: (_48 = formik.values.computedFieldValueProviderCtxt) !== null && _48 !== void 0 ? _48 : "", onChange: function (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) {
1544
1561
  formik.setFieldValue("computedFieldValueProviderCtxt", value !== null && value !== void 0 ? value : "");
1545
- }, language: "json", height: "300px" }), _jsx("div", { className: "form-field-label mt-4", children: markdownText }), isFormFieldValid(formik, "computedFieldValueProviderCtxt") && (_jsx("p", { className: styles.fieldError, children: (_50 = (_49 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _49 === void 0 ? void 0 : _49.computedFieldValueProviderCtxt) === null || _50 === void 0 ? void 0 : _50.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") &&
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") &&
1546
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) {
1547
1564
  var value = _a.value;
1548
1565
  setSelectedPasswordPolicy(value);
@@ -1551,25 +1568,25 @@ var FieldMetaDataForm = function (_a) {
1551
1568
  }
1552
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, {
1553
1570
  "p-invalid": isFormFieldValid(formik, "regexPattern"),
1554
- }) }), isFormFieldValid(formik, "regexPattern") && (_jsx("p", { className: styles.fieldError, children: (_52 = (_51 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _51 === void 0 ? void 0 : _51.regexPattern) === null || _52 === void 0 ? void 0 : _52.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, {
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, {
1555
1572
  "p-invalid": isFormFieldValid(formik, "regexPatternNotMatchingErrorMsg"),
1556
- }) }), isFormFieldValid(formik, "regexPatternNotMatchingErrorMsg") && (_jsx("p", { className: styles.fieldError, children: (_54 = (_53 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _53 === void 0 ? void 0 : _53.regexPatternNotMatchingErrorMsg) === null || _54 === void 0 ? void 0 : _54.toString() }))] }))] })), (showMinFields || showMaxFields) &&
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) &&
1557
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({
1558
1575
  "p-invalid": isFormFieldValid(formik, "min"),
1559
- }), disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id }) }), isFormFieldValid(formik, "min") && (_jsx("p", { className: styles.fieldError, children: (_56 = (_55 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _55 === void 0 ? void 0 : _55.min) === null || _56 === void 0 ? void 0 : _56.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" &&
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" &&
1560
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({
1561
1578
  "p-invalid": isFormFieldValid(formik, "max"),
1562
- }), disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id }) }), isFormFieldValid(formik, "max") && (_jsx("p", { className: styles.fieldError, children: (_58 = (_57 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _57 === void 0 ? void 0 : _57.max) === null || _58 === void 0 ? void 0 : _58.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) {
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) {
1563
1580
  formik.setFieldValue("ormType", value);
1564
1581
  setSelectedOrmType(value);
1565
1582
  }, options: (ormTypeOptions || []).map(function (ormType) { return ({
1566
1583
  value: ormType.label,
1567
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, ")") })] })),
1568
- }); }), className: "ormTypeflex", itemClassName: "mr-4 items-center" }), isFormFieldValid(formik, "ormType") && (_jsx("p", { className: styles.fieldError, children: (_60 = (_59 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _59 === void 0 ? void 0 : _59.ormType) === null || _60 === void 0 ? void 0 : _60.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) {
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) {
1569
1586
  if (!formik.values.isPrimaryKey && !formik.values.unique) {
1570
1587
  formik.setFieldValue("required", event.currentTarget.checked);
1571
1588
  }
1572
- }, 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: (_62 = (_61 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _61 === void 0 ? void 0 : _61.required) === null || _62 === void 0 ? void 0 : _62.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) {
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) {
1573
1590
  // Prevent unchecking if isPrimaryKey is true
1574
1591
  if (!formik.values.isPrimaryKey) {
1575
1592
  var nextValue = event.currentTarget.checked;
@@ -1583,20 +1600,20 @@ var FieldMetaDataForm = function (_a) {
1583
1600
  formik.setFieldValue("required", false);
1584
1601
  }
1585
1602
  }
1586
- }, 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: (_64 = (_63 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _63 === void 0 ? void 0 : _63.unique) === null || _64 === void 0 ? void 0 : _64.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) {
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) {
1587
1604
  formik.setFieldValue("index", event.currentTarget.checked);
1588
- }, 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: (_66 = (_65 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _65 === void 0 ? void 0 : _65.index) === null || _66 === void 0 ? void 0 : _66.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) {
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) {
1589
1606
  formik.setFieldValue("private", event.currentTarget.checked);
1590
- }, 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: (_68 = (_67 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _67 === void 0 ? void 0 : _67.private) === null || _68 === void 0 ? void 0 : _68.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) {
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) {
1591
1608
  formik.setFieldValue("encrypt", event.currentTarget.checked);
1592
1609
  setEncryptState(event.currentTarget.checked);
1593
- }, 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: (_70 = (_69 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _69 === void 0 ? void 0 : _69.encrypt) === null || _70 === void 0 ? void 0 : _70.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) {
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) {
1594
1611
  formik.setFieldValue("isMultiSelect", event.currentTarget.checked);
1595
- }, 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: (_72 = (_71 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _71 === void 0 ? void 0 : _71.isMultiSelect) === null || _72 === void 0 ? void 0 : _72.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) {
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) {
1596
1613
  formik.setFieldValue("enableAuditTracking", event.currentTarget.checked);
1597
- }, 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: (_74 = (_73 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _73 === void 0 ? void 0 : _73.enableAuditTracking) === null || _74 === void 0 ? void 0 : _74.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) {
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) {
1598
1615
  formik.setFieldValue("isUserKey", event.currentTarget.checked);
1599
- }, 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: (_76 = (_75 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _75 === void 0 ? void 0 : _75.isUserKey) === null || _76 === void 0 ? void 0 : _76.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) {
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) {
1600
1617
  var checked = event.currentTarget.checked;
1601
1618
  formik.setFieldValue("isPrimaryKey", checked);
1602
1619
  // Auto-set required and unique when isPrimaryKey is checked
@@ -1604,11 +1621,11 @@ var FieldMetaDataForm = function (_a) {
1604
1621
  formik.setFieldValue("required", true);
1605
1622
  formik.setFieldValue("unique", true);
1606
1623
  }
1607
- }, 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: (_78 = (_77 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _77 === void 0 ? void 0 : _77.isPrimaryKey) === null || _78 === void 0 ? void 0 : _78.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 = {},
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 = {},
1608
1625
  _k[styles.fieldInvalidControl] = isFormFieldValid(formik, "encryptionType"),
1609
- _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: (_80 = (_79 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _79 === void 0 ? void 0 : _79.encryptionType) === null || _80 === void 0 ? void 0 : _80.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 = {},
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 = {},
1610
1627
  _l[styles.fieldInvalidControl] = isFormFieldValid(formik, "decryptWhen"),
1611
- _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: (_82 = (_81 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _81 === void 0 ? void 0 : _81.decryptWhen) === null || _82 === void 0 ? void 0 : _82.toString() }))] }) })] }))] })] }), _jsxs("div", { className: "mt-4 flex gap-4", children: [_jsx("div", { children: _jsx(SolidButton, { label: "Finish", size: "small", onClick: function () { return showError(); }, type: "submit" }) }), _jsx("div", { children: _jsx(SolidButton, { label: "Cancel", size: "small", severity: "secondary", type: "reset", onClick: function () { return setVisiblePopup(false); }, outlined: true }) })] })] }) }) }) }) }), _jsx(SolidDialog, { open: isBackPopupVisible, onOpenChange: function (next) {
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) {
1612
1629
  if (!next) {
1613
1630
  setIsBackPopupVisible(false);
1614
1631
  }