@solidxai/core-ui 0.1.14-beta.9 → 0.1.15-beta.0

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 (90) hide show
  1. package/dist/components/common/DropzonePlaceholder.d.ts +2 -1
  2. package/dist/components/common/DropzonePlaceholder.d.ts.map +1 -1
  3. package/dist/components/common/DropzonePlaceholder.js +10 -7
  4. package/dist/components/common/DropzonePlaceholder.js.map +1 -1
  5. package/dist/components/common/DropzonePlaceholder.tsx +14 -9
  6. package/dist/components/core/card/CardItem.js +1 -1
  7. package/dist/components/core/card/CardItem.js.map +1 -1
  8. package/dist/components/core/card/CardItem.tsx +1 -1
  9. package/dist/components/core/card/SolidCardView.d.ts.map +1 -1
  10. package/dist/components/core/card/SolidCardView.js +2 -2
  11. package/dist/components/core/card/SolidCardView.js.map +1 -1
  12. package/dist/components/core/card/SolidCardView.tsx +7 -12
  13. package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
  14. package/dist/components/core/common/SolidGlobalSearchElement.js +101 -86
  15. package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
  16. package/dist/components/core/common/SolidGlobalSearchElement.tsx +161 -98
  17. package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
  18. package/dist/components/core/form/SolidFormView.js +96 -72
  19. package/dist/components/core/form/SolidFormView.js.map +1 -1
  20. package/dist/components/core/form/SolidFormView.tsx +39 -17
  21. package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
  22. package/dist/components/core/form/fields/SolidMediaMultipleField.js +3 -2
  23. package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
  24. package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +3 -1
  25. package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
  26. package/dist/components/core/form/fields/SolidMediaSingleField.js +3 -2
  27. package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
  28. package/dist/components/core/form/fields/SolidMediaSingleField.tsx +3 -1
  29. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts +1 -0
  30. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
  31. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +20 -2
  32. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
  33. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +29 -2
  34. package/dist/components/core/form/fields/solidFields.module.css +7 -0
  35. package/dist/components/core/kanban/KanbanCard.js +1 -1
  36. package/dist/components/core/kanban/KanbanCard.js.map +1 -1
  37. package/dist/components/core/kanban/KanbanCard.tsx +1 -1
  38. package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
  39. package/dist/components/core/kanban/SolidKanbanView.js +7 -1
  40. package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
  41. package/dist/components/core/kanban/SolidKanbanView.tsx +10 -5
  42. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  43. package/dist/components/core/list/SolidListView.js +44 -88
  44. package/dist/components/core/list/SolidListView.js.map +1 -1
  45. package/dist/components/core/list/SolidListView.tsx +19 -93
  46. package/dist/components/core/list/SolidListViewColumn.d.ts +2 -1
  47. package/dist/components/core/list/SolidListViewColumn.d.ts.map +1 -1
  48. package/dist/components/core/list/SolidListViewColumn.js +2 -2
  49. package/dist/components/core/list/SolidListViewColumn.js.map +1 -1
  50. package/dist/components/core/list/SolidListViewColumn.tsx +4 -3
  51. package/dist/components/core/list/columns/SolidRelationColumn.d.ts +1 -1
  52. package/dist/components/core/list/columns/SolidRelationColumn.d.ts.map +1 -1
  53. package/dist/components/core/list/columns/SolidRelationColumn.js +2 -2
  54. package/dist/components/core/list/columns/SolidRelationColumn.js.map +1 -1
  55. package/dist/components/core/list/columns/SolidRelationColumn.tsx +2 -2
  56. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts +2 -2
  57. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts.map +1 -1
  58. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +5 -4
  59. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
  60. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +5 -4
  61. package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
  62. package/dist/components/core/model/FieldMetaDataForm.js +147 -97
  63. package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
  64. package/dist/components/core/model/FieldMetaDataForm.tsx +123 -31
  65. package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
  66. package/dist/components/core/tree/SolidTreeView.js +1 -1
  67. package/dist/components/core/tree/SolidTreeView.js.map +1 -1
  68. package/dist/components/core/tree/SolidTreeView.tsx +4 -12
  69. package/dist/components/layout/AdminHeaderActions.js +1 -1
  70. package/dist/components/layout/AdminHeaderActions.js.map +1 -1
  71. package/dist/components/layout/AdminHeaderActions.tsx +1 -1
  72. package/dist/helpers/getAcceptedFileTypes.d.ts +12 -2
  73. package/dist/helpers/getAcceptedFileTypes.d.ts.map +1 -1
  74. package/dist/helpers/getAcceptedFileTypes.js +72 -16
  75. package/dist/helpers/getAcceptedFileTypes.js.map +1 -1
  76. package/dist/helpers/getAcceptedFileTypes.tsx +101 -18
  77. package/dist/helpers/registry.js +2 -1
  78. package/dist/helpers/registry.js.map +1 -1
  79. package/dist/helpers/registry.ts +3 -1
  80. package/dist/index.d.ts +1 -1
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js.map +1 -1
  83. package/dist/index.ts +1 -2
  84. package/dist/resources/globals.css +259 -109
  85. package/dist/resources/solid-responsive.css +1 -5
  86. package/dist/resources/solid-tailwind-generated.css +1 -1
  87. package/dist/resources/themes/solid-light-modern/theme.css +3 -4
  88. package/dist/types/index.d.ts +2 -4
  89. package/dist/types/solid-core.d.ts +4 -13
  90. package/package.json +1 -1
@@ -69,6 +69,7 @@ import * as Yup from "yup";
69
69
  import FieldSelector from "./FieldSelector";
70
70
  import { ERROR_MESSAGES } from "../../../constants/error-messages";
71
71
  import { useSolidAutocompleteField } from "../../../hooks/useSolidAutocompleteField";
72
+ import { getAvailableMediaExtensionOptions } from "../../../helpers/getAcceptedFileTypes";
72
73
  import { SolidAutocomplete, SolidButton, SolidCheckbox, SolidDatePicker, SolidDialog, SolidDialogBody, SolidInput, SolidTextarea, SolidNumberInput, SolidSelect, SolidSegmentedControl, SolidRadioGroup, SolidTabGroup, SolidMessage, SolidCodeEditor, } from "../../shad-cn-ui";
73
74
  import styles from "../form/fields/solidFields.module.css";
74
75
  import "./FieldMetaDataForm.css";
@@ -145,6 +146,20 @@ function createRelationAutocompleteValue(value, labelKey, valueKey) {
145
146
  return value;
146
147
  return _a = {}, _a[labelKey] = value, _a[valueKey] = value, _a;
147
148
  }
149
+ function normalizeMediaAllowedExtensionsInput(value) {
150
+ if (Array.isArray(value)) {
151
+ return Array.from(new Set(value
152
+ .map(function (entry) { return String(entry || "").trim().toLowerCase().replace(/^\./, ""); })
153
+ .filter(Boolean)));
154
+ }
155
+ if (typeof value !== "string") {
156
+ return [];
157
+ }
158
+ return Array.from(new Set(value
159
+ .split(",")
160
+ .map(function (entry) { return entry.trim().toLowerCase().replace(/^\./, ""); })
161
+ .filter(Boolean)));
162
+ }
148
163
  function TabPanel(_props) {
149
164
  return null;
150
165
  }
@@ -296,6 +311,9 @@ var fieldBasedPayloadFormating = function (values, currentFields, fieldMetaData)
296
311
  if (currentFields.includes("mediaStorageProviderId")) {
297
312
  transformedPayload.mediaStorageProvider = values.mediaStorageProvider;
298
313
  }
314
+ if (currentFields.includes("mediaAllowedExtensions")) {
315
+ transformedPayload.mediaAllowedExtensions = normalizeMediaAllowedExtensionsInput(values.mediaAllowedExtensions);
316
+ }
299
317
  if (currentFields.includes("selectionDynamicProviderCtxt")) {
300
318
  var prettified = JSON.stringify(JSON.parse(values.selectionDynamicProviderCtxt), null, 2);
301
319
  transformedPayload.selectionDynamicProviderCtxt = prettified;
@@ -352,7 +370,7 @@ var createValidationSchema = function (currentFields, selectedType, allFields, f
352
370
  reservedNames = allFields.length > 0 ? allFields.map(function (f) { return f.name; }) : [];
353
371
  }
354
372
  var selectedTypeValue = selectedType === null || selectedType === void 0 ? void 0 : selectedType.value;
355
- var schema = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ name: Yup.string()
373
+ var schema = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ name: Yup.string()
356
374
  // .matches(/^[a-z]+(-[a-z]+)*$/,"Invalid format. Use lowercase letters and hyphens only")
357
375
  .notOneOf(reservedNames, ERROR_MESSAGES.FIELD_ALREADY_USE('Name', 'name'))
358
376
  .required(ERROR_MESSAGES.FIELD_REUQIRED('Name')), displayName: Yup.string().required(ERROR_MESSAGES.FIELD_REUQIRED('Display Name')), description: Yup.string().nullable(), type: Yup.string().required(ERROR_MESSAGES.FIELD_REUQIRED('Type')), isSystem: Yup.boolean() }, (currentFields.includes("ormType") && {
@@ -462,6 +480,10 @@ var createValidationSchema = function (currentFields, selectedType, allFields, f
462
480
  .required(ERROR_MESSAGES.FIELD_MUST_BE_AN('Media Types', 'array')),
463
481
  })), (currentFields.includes("mediaMaxSizeKb") && {
464
482
  mediaMaxSizeKb: Yup.number().required(ERROR_MESSAGES.FIELD_REUQIRED('Media Max Size')),
483
+ })), (currentFields.includes("mediaAllowedExtensions") && {
484
+ mediaAllowedExtensions: Yup.array()
485
+ .of(Yup.string().matches(/^[a-z0-9]+$/i, "Use comma-separated file extensions only"))
486
+ .nullable(),
465
487
  })), (currentFields.includes("mediaStorageProviderId") && {
466
488
  mediaStorageProviderId: Yup.number().required(ERROR_MESSAGES.FIELD_REUQIRED('Media Storage Provider')),
467
489
  })), (currentFields.includes("mediaStorageProviderId") && {
@@ -563,9 +585,9 @@ var createValidationSchema = function (currentFields, selectedType, allFields, f
563
585
  return Yup.object(schema);
564
586
  };
565
587
  var FieldMetaDataForm = function (_a) {
566
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
567
- var _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86;
568
- var setIsDirty = _a.setIsDirty, modelMetaData = _a.modelMetaData, fieldMetaData = _a.fieldMetaData, setFieldMetaData = _a.setFieldMetaData, allFields = _a.allFields, deleteModelFunction = _a.deleteModelFunction, setVisiblePopup = _a.setVisiblePopup, params = _a.params, setIsRequiredPopUp = _a.setIsRequiredPopUp, showToaster = _a.showToaster, onDraftSubmit = _a.onDraftSubmit, onClose = _a.onClose, availableFieldTypes = _a.availableFieldTypes, _87 = _a.forceShowTypeSelector, forceShowTypeSelector = _87 === void 0 ? false : _87, _88 = _a.selectorRequireContinue, selectorRequireContinue = _88 === void 0 ? false : _88, _89 = _a.selectorContinueLabel, selectorContinueLabel = _89 === void 0 ? "Next" : _89, _90 = _a.selectorInitialFieldType, selectorInitialFieldType = _90 === void 0 ? null : _90, _91 = _a.disableIdentityEditingForExisting, disableIdentityEditingForExisting = _91 === void 0 ? true : _91, _92 = _a.submitLabel, submitLabel = _92 === void 0 ? "Finish" : _92;
588
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
589
+ var _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89;
590
+ 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, _90 = _a.forceShowTypeSelector, forceShowTypeSelector = _90 === void 0 ? false : _90, _91 = _a.selectorRequireContinue, selectorRequireContinue = _91 === void 0 ? false : _91, _92 = _a.selectorContinueLabel, selectorContinueLabel = _92 === void 0 ? "Next" : _92, _93 = _a.selectorInitialFieldType, selectorInitialFieldType = _93 === void 0 ? null : _93, _94 = _a.disableIdentityEditingForExisting, disableIdentityEditingForExisting = _94 === void 0 ? true : _94, _95 = _a.submitLabel, submitLabel = _95 === void 0 ? "Finish" : _95;
569
591
  var booleanOptions = ["false", "true"];
570
592
  var booleanSegmentedOptions = booleanOptions.map(function (value) { return ({
571
593
  label: capitalize(value),
@@ -574,45 +596,45 @@ var FieldMetaDataForm = function (_a) {
574
596
  var resolveBooleanOptionValue = function (value) {
575
597
  return typeof value === "string" ? value : value ? "true" : "false";
576
598
  };
577
- var _93 = useState(false), isBackPopupVisible = _93[0], setIsBackPopupVisible = _93[1];
578
- var _94 = useState(false), showColumnName = _94[0], setShowColumnName = _94[1];
599
+ var _96 = useState(false), isBackPopupVisible = _96[0], setIsBackPopupVisible = _96[1];
600
+ var _97 = useState(false), showColumnName = _97[0], setShowColumnName = _97[1];
579
601
  var pathname = usePathname();
580
- var _95 = useGetFieldDefaultMetaDataQuery(null), fieldDefaultMetaData = _95.data, isLoading = _95.isLoading, error = _95.error, refetch = _95.refetch;
581
- var _96 = useState(fetchCurrentFields(fieldMetaData && fieldMetaData.type, fieldDefaultMetaData)), currentFields = _96[0], setCurrentFields = _96[1];
582
- var _97 = useLazyGetMediaStorageProvidersQuery(), triggerGetMediaStorageProvider = _97[0], _98 = _97[1], MediaStorageProviderData = _98.data, isMediaStorageProviderFetching = _98.isFetching, MediaStorageProviderError = _98.error;
583
- var _99 = useLazyGetmodulesQuery(), triggerGetModules = _99[0], _100 = _99[1], moduleData = _100.data, isModuleFetching = _100.isFetching, moduleError = _100.error;
584
- var _101 = useLazyGetModelsQuery(), triggerGetModels = _101[0], _102 = _101[1], modelData = _102.data, ismodelFetching = _102.isFetching, modelError = _102.error;
585
- var _103 = useUpdateUserKeyMutation(), updateUserKey = _103[0], _104 = _103[1], isUpdateUserKeyLoading = _104.isLoading, isUpdateUserKeySuccess = _104.isSuccess, isUpdateUserKeyError = _104.isError, UpdateUserKeyError = _104.error, newModel = _104.data;
586
- var _105 = useState(), markdownText = _105[0], setMarkdownText = _105[1];
587
- var _106 = useState(Boolean(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.encrypt)), encryptState = _106[0], setEncryptState = _106[1];
588
- var _107 = useState(forceShowTypeSelector || !fieldMetaData), showTypeFilter = _107[0], setShowTypeFilter = _107[1];
589
- var _108 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.type)
602
+ var _98 = useGetFieldDefaultMetaDataQuery(null), fieldDefaultMetaData = _98.data, isLoading = _98.isLoading, error = _98.error, refetch = _98.refetch;
603
+ var _99 = useState(fetchCurrentFields(fieldMetaData && fieldMetaData.type, fieldDefaultMetaData)), currentFields = _99[0], setCurrentFields = _99[1];
604
+ var _100 = useLazyGetMediaStorageProvidersQuery(), triggerGetMediaStorageProvider = _100[0], _101 = _100[1], MediaStorageProviderData = _101.data, isMediaStorageProviderFetching = _101.isFetching, MediaStorageProviderError = _101.error;
605
+ var _102 = useLazyGetmodulesQuery(), triggerGetModules = _102[0], _103 = _102[1], moduleData = _103.data, isModuleFetching = _103.isFetching, moduleError = _103.error;
606
+ var _104 = useLazyGetModelsQuery(), triggerGetModels = _104[0], _105 = _104[1], modelData = _105.data, ismodelFetching = _105.isFetching, modelError = _105.error;
607
+ var _106 = useUpdateUserKeyMutation(), updateUserKey = _106[0], _107 = _106[1], isUpdateUserKeyLoading = _107.isLoading, isUpdateUserKeySuccess = _107.isSuccess, isUpdateUserKeyError = _107.isError, UpdateUserKeyError = _107.error, newModel = _107.data;
608
+ var _108 = useState(), markdownText = _108[0], setMarkdownText = _108[1];
609
+ var _109 = useState(Boolean(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.encrypt)), encryptState = _109[0], setEncryptState = _109[1];
610
+ var _110 = useState(forceShowTypeSelector || !fieldMetaData), showTypeFilter = _110[0], setShowTypeFilter = _110[1];
611
+ var _111 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.type)
590
612
  ? { label: fieldMetaData.type, value: fieldMetaData.type }
591
613
  : selectorInitialFieldType
592
614
  ? { label: selectorInitialFieldType, value: selectorInitialFieldType }
593
- : null), selectedType = _108[0], setSelectedType = _108[1];
615
+ : null), selectedType = _111[0], setSelectedType = _111[1];
594
616
  var selectedTypeValue = (selectedType === null || selectedType === void 0 ? void 0 : selectedType.value) || "";
595
- var _109 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.computedFieldValueType) && { label: fieldMetaData.computedFieldValueType, value: fieldMetaData.computedFieldValueType }), selectedComputedFieldValueType = _109[0], setSelectedComputedFieldValueType = _109[1];
596
- var _110 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.selectionDynamicProvider) && { label: fieldMetaData.selectionDynamicProvider, value: fieldMetaData.selectionDynamicProvider }), selectionDynamicProvider = _110[0], setSelectionDynamicProvider = _110[1];
617
+ var _112 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.computedFieldValueType) && { label: fieldMetaData.computedFieldValueType, value: fieldMetaData.computedFieldValueType }), selectedComputedFieldValueType = _112[0], setSelectedComputedFieldValueType = _112[1];
618
+ var _113 = useState((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.selectionDynamicProvider) && { label: fieldMetaData.selectionDynamicProvider, value: fieldMetaData.selectionDynamicProvider }), selectionDynamicProvider = _113[0], setSelectionDynamicProvider = _113[1];
597
619
  // const [externalIdProvider, setExternalIdProvider] = useState(fieldMetaData?.externalIdProvider && { label: fieldMetaData.externalIdProvider, value: fieldMetaData.externalIdProvider });
598
- var _111 = useState([]), filteredComputedFieldValueTypes = _111[0], setFilteredComputedFieldValueTypes = _111[1];
599
- var _112 = useState([]), filteredSelectionDynamicProvider = _112[0], setFilteredSelectionDynamicProvider = _112[1];
600
- var _113 = useState([]), ormTypeOptions = _113[0], setOrmTypeOptions = _113[1];
601
- var _114 = useState(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.ormType), selectedOrmType = _114[0], setSelectedOrmType = _114[1];
602
- var _115 = useState(false), askForUserKeyField = _115[0], setAskForUserKeyField = _115[1];
603
- var _116 = useState([]), userKeyFieldData = _116[0], setUserKeyFieldData = _116[1];
604
- var _117 = useState([]), filteredExternalIdProvider = _117[0], setFilteredExternalIdProvider = _117[1];
605
- var _118 = useState([]), filteredSelectionEncryptionType = _118[0], setFilteredSelectionEncryptionType = _118[1];
606
- var _119 = useState([]), filteredSelectionDecryptWhen = _119[0], setFilteredSelectionDecryptWhen = _119[1];
620
+ var _114 = useState([]), filteredComputedFieldValueTypes = _114[0], setFilteredComputedFieldValueTypes = _114[1];
621
+ var _115 = useState([]), filteredSelectionDynamicProvider = _115[0], setFilteredSelectionDynamicProvider = _115[1];
622
+ var _116 = useState([]), ormTypeOptions = _116[0], setOrmTypeOptions = _116[1];
623
+ var _117 = useState(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.ormType), selectedOrmType = _117[0], setSelectedOrmType = _117[1];
624
+ var _118 = useState(false), askForUserKeyField = _118[0], setAskForUserKeyField = _118[1];
625
+ var _119 = useState([]), userKeyFieldData = _119[0], setUserKeyFieldData = _119[1];
626
+ var _120 = useState([]), filteredExternalIdProvider = _120[0], setFilteredExternalIdProvider = _120[1];
627
+ var _121 = useState([]), filteredSelectionEncryptionType = _121[0], setFilteredSelectionEncryptionType = _121[1];
628
+ var _122 = useState([]), filteredSelectionDecryptWhen = _122[0], setFilteredSelectionDecryptWhen = _122[1];
607
629
  var validationSchema = React.useMemo(function () { return createValidationSchema(currentFields, selectedType, allFields, fieldMetaData, encryptState); }, [currentFields, encryptState]);
608
- var _120 = useState(false), typeSelected = _120[0], setTypeSelected = _120[1];
630
+ var _123 = useState(false), typeSelected = _123[0], setTypeSelected = _123[1];
609
631
  var showRegexFields = currentFields.includes("regexPattern");
610
632
  var showMinFields = currentFields.includes("min");
611
633
  var showMaxFields = currentFields.includes("max");
612
634
  var showOrmOptions = currentFields.includes("ormType") && Boolean(ormTypeOptions && ormTypeOptions.length);
613
635
  var showValidationSection = selectedTypeValue !== "relation" && (showRegexFields || showMinFields || showMaxFields || showOrmOptions);
614
636
  var isExistingFieldReadOnly = disableIdentityEditingForExisting && Boolean(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id);
615
- var fieldTypeLabel = capitalize(String((_o = (_m = selectedType === null || selectedType === void 0 ? void 0 : selectedType.label) !== null && _m !== void 0 ? _m : selectedTypeValue) !== null && _o !== void 0 ? _o : "field"));
637
+ var fieldTypeLabel = capitalize(String((_p = (_o = selectedType === null || selectedType === void 0 ? void 0 : selectedType.label) !== null && _o !== void 0 ? _o : selectedTypeValue) !== null && _p !== void 0 ? _p : "field"));
616
638
  var closeForm = useCallback(function () {
617
639
  if (typeof onClose === "function") {
618
640
  onClose();
@@ -989,7 +1011,7 @@ var FieldMetaDataForm = function (_a) {
989
1011
  { label: "False", value: "false" },
990
1012
  ];
991
1013
  var defaultPasswordPolicy = fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.regexPattern;
992
- var _121 = useState(defaultPasswordPolicy), selectedPasswordPolicy = _121[0], setSelectedPasswordPolicy = _121[1];
1014
+ var _124 = useState(defaultPasswordPolicy), selectedPasswordPolicy = _124[0], setSelectedPasswordPolicy = _124[1];
993
1015
  var passwordPolicyOptions = [
994
1016
  { label: 'Lowercase and Uppercase Alphabets Required', value: '^(?=.*[a-z])(?=.*[A-Z]).*$' },
995
1017
  { label: 'Lowercase and Uppercase Alphabets and Numbers Required', value: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).*$' },
@@ -1000,10 +1022,11 @@ var FieldMetaDataForm = function (_a) {
1000
1022
  { label: 'Image (Supports JPEG, PNG, WEBP, etc.)', value: 'image' },
1001
1023
  { label: 'Audio (Supports MP3, WAV, AAC, etc.)', value: 'audio' },
1002
1024
  { label: 'Video (Supports MP4, AVI, MKV, etc.)', value: 'video' },
1003
- { label: 'File (Supports PDF, DOCX, TXT, etc.)', value: 'file' }
1025
+ { label: 'File (Supports DOCX, TXT, XLSX, ZIP, etc.)', value: 'file' },
1026
+ { label: 'PDF (Supports .pdf files)', value: 'pdf' }
1004
1027
  ];
1005
- var resolvedMediaTypeOptions = useMemo(function () { var _a, _b; return (_b = (_a = fieldDefaultMetaData === null || fieldDefaultMetaData === void 0 ? void 0 : fieldDefaultMetaData.data) === null || _a === void 0 ? void 0 : _a.mediaTypes) !== null && _b !== void 0 ? _b : mediaTypesOptions; }, [(_p = fieldDefaultMetaData === null || fieldDefaultMetaData === void 0 ? void 0 : fieldDefaultMetaData.data) === null || _p === void 0 ? void 0 : _p.mediaTypes]);
1006
- var _122 = useState(resolvedMediaTypeOptions), filteredMediaTypes = _122[0], setFilteredMediaTypes = _122[1];
1028
+ 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; }, [(_q = fieldDefaultMetaData === null || fieldDefaultMetaData === void 0 ? void 0 : fieldDefaultMetaData.data) === null || _q === void 0 ? void 0 : _q.mediaTypes]);
1029
+ var _125 = useState(resolvedMediaTypeOptions), filteredMediaTypes = _125[0], setFilteredMediaTypes = _125[1];
1007
1030
  useEffect(function () {
1008
1031
  setFilteredMediaTypes(resolvedMediaTypeOptions);
1009
1032
  }, [resolvedMediaTypeOptions]);
@@ -1052,9 +1075,10 @@ var FieldMetaDataForm = function (_a) {
1052
1075
  min: fieldMetaData ? fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.min : null,
1053
1076
  max: fieldMetaData ? fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.max : null,
1054
1077
  private: fieldMetaData ? fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.private : false,
1055
- mediaTypes: (_q = fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaTypes) !== null && _q !== void 0 ? _q : [],
1078
+ mediaTypes: (_r = fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaTypes) !== null && _r !== void 0 ? _r : [],
1079
+ mediaAllowedExtensions: Array.isArray(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaAllowedExtensions) ? fieldMetaData.mediaAllowedExtensions : [],
1056
1080
  mediaMaxSizeKb: fieldMetaData ? fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaMaxSizeKb : null,
1057
- mediaStorageProviderId: fieldMetaData ? (_r = fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaStorageProvider) === null || _r === void 0 ? void 0 : _r.id : null,
1081
+ mediaStorageProviderId: fieldMetaData ? (_s = fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaStorageProvider) === null || _s === void 0 ? void 0 : _s.id : null,
1058
1082
  mediaStorageProvider: fieldMetaData ? fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaStorageProvider : null,
1059
1083
  mediaEmbedded: fieldMetaData ? ((fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaEmbedded) && (fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.mediaEmbedded.toString())) : "true",
1060
1084
  relationType: fieldMetaData ? fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.relationType : null,
@@ -1133,7 +1157,7 @@ var FieldMetaDataForm = function (_a) {
1133
1157
  validateOnBlur: false // Disable validation on blur
1134
1158
  });
1135
1159
  var fieldEditorTitle = fieldMetaData
1136
- ? "Edit ".concat(((_s = formik === null || formik === void 0 ? void 0 : formik.values) === null || _s === void 0 ? void 0 : _s.displayName) || fieldTypeLabel, " Field")
1160
+ ? "Edit ".concat(((_t = formik === null || formik === void 0 ? void 0 : formik.values) === null || _t === void 0 ? void 0 : _t.displayName) || fieldTypeLabel, " Field")
1137
1161
  : "Add ".concat(fieldTypeLabel, " Field");
1138
1162
  var mediaTypeSelectedItems = useMemo(function () {
1139
1163
  if (!Array.isArray(formik.values.mediaTypes))
@@ -1152,6 +1176,25 @@ var FieldMetaDataForm = function (_a) {
1152
1176
  return fromOptions || { label: String(entry), value: entry };
1153
1177
  });
1154
1178
  }, [formik.values.mediaTypes, resolvedMediaTypeOptions]);
1179
+ var mediaExtensionOptions = useMemo(function () { var _a; return getAvailableMediaExtensionOptions(formik.values.mediaTypes, (_a = fieldDefaultMetaData === null || fieldDefaultMetaData === void 0 ? void 0 : fieldDefaultMetaData.data) === null || _a === void 0 ? void 0 : _a.mediaFileTypeDefinitions); }, [formik.values.mediaTypes, fieldDefaultMetaData === null || fieldDefaultMetaData === void 0 ? void 0 : fieldDefaultMetaData.data]);
1180
+ var mediaExtensionSelectedItems = useMemo(function () {
1181
+ if (!Array.isArray(formik.values.mediaAllowedExtensions))
1182
+ return [];
1183
+ return formik.values.mediaAllowedExtensions.map(function (entry) {
1184
+ if (entry && typeof entry === "object") {
1185
+ if (entry.label && entry.value) {
1186
+ return entry;
1187
+ }
1188
+ if (entry.value) {
1189
+ var fromOptions_2 = mediaExtensionOptions.find(function (option) { return option.value === entry.value; });
1190
+ return fromOptions_2 || { label: ".".concat(entry.value), value: entry.value };
1191
+ }
1192
+ }
1193
+ var normalized = String(entry || "").trim().toLowerCase().replace(/^\./, "");
1194
+ var fromOptions = mediaExtensionOptions.find(function (option) { return option.value === normalized; });
1195
+ return fromOptions || { label: ".".concat(normalized), value: normalized };
1196
+ }).filter(function (item) { return item === null || item === void 0 ? void 0 : item.value; });
1197
+ }, [formik.values.mediaAllowedExtensions, mediaExtensionOptions]);
1155
1198
  var resetFormStateForTypeSelection = useCallback(function (options) {
1156
1199
  formik.resetForm();
1157
1200
  var baseValues = formik.initialValues;
@@ -1436,9 +1479,9 @@ var FieldMetaDataForm = function (_a) {
1436
1479
  event.preventDefault();
1437
1480
  resetFormStateForTypeSelection();
1438
1481
  }, children: showTypeFilter === true ?
1439
- _jsx("div", { className: "solid-field-form-scroll", children: _jsx(FieldSelector, { handleTypeSelect: handleTypeSelect, modelMetaData: modelMetaData, availableFieldTypes: availableFieldTypes, initialSelectedValue: (_t = selectedType === null || selectedType === void 0 ? void 0 : selectedType.value) !== null && _t !== void 0 ? _t : selectorInitialFieldType, requireExplicitContinue: selectorRequireContinue, continueLabel: selectorContinueLabel }) })
1482
+ _jsx("div", { className: "solid-field-form-scroll", children: _jsx(FieldSelector, { handleTypeSelect: handleTypeSelect, modelMetaData: modelMetaData, availableFieldTypes: availableFieldTypes, initialSelectedValue: (_u = selectedType === null || selectedType === void 0 ? void 0 : selectedType.value) !== null && _u !== void 0 ? _u : selectorInitialFieldType, requireExplicitContinue: selectorRequireContinue, continueLabel: selectorContinueLabel }) })
1440
1483
  :
1441
- _jsx("div", { className: "solid-field-form-scroll", children: _jsx("div", { className: "flex justify-center creat-field-form form-demo", children: _jsxs("div", { className: "solid-fluid solid-field-form-frame", children: [_jsxs("div", { className: "solid-field-form-header", children: [_jsx("p", { className: "form-wrapper-title m-0", children: fieldEditorTitle }), _jsx("p", { className: "solid-field-form-subtitle", children: "Review the basic info and advanced configuration for this field." })] }), _jsx("div", { className: "solid-field-form-tabs", children: _jsxs(TabView, { panelContainerClassName: "px-0", children: [_jsx(TabPanel, { header: "Basic Info", className: (formik.touched.hasOwnProperty("name") && formik.errors.hasOwnProperty("name")) || (formik.touched.hasOwnProperty("displayName") && formik.errors.hasOwnProperty("displayName")) || (formik.touched.hasOwnProperty("displayName") && formik.errors.hasOwnProperty("ormType")) ? "tab-error-heading" : "", children: _jsxs("div", { className: "flex flex-wrap -mx-2 -mt-2", children: [currentFields.includes("displayName") && (_jsxs("div", { className: "field mt-2 w-full px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "displayName", className: classNames("form-field-label", styles.fieldLabel), children: "Display Name" }), _jsx(SolidInput, { type: "text", disabled: isExistingFieldReadOnly, id: "displayName", name: "displayName", onChange: function (e) {
1484
+ _jsx("div", { className: "solid-field-form-scroll", children: _jsx("div", { className: "flex justify-center creat-field-form form-demo", children: _jsxs("div", { className: "solid-fluid solid-field-form-frame", children: [_jsxs("div", { className: "solid-field-form-header", children: [_jsx("p", { className: "form-wrapper-title m-0", children: fieldEditorTitle }), _jsx("p", { className: "solid-field-form-subtitle", children: "Review the basic info and advanced configuration for this field." })] }), _jsx("div", { className: "solid-field-form-tabs", children: _jsxs(TabView, { panelContainerClassName: "px-0", children: [_jsx(TabPanel, { header: "Basic Info", className: (formik.touched.hasOwnProperty("name") && formik.errors.hasOwnProperty("name")) || (formik.touched.hasOwnProperty("displayName") && formik.errors.hasOwnProperty("displayName")) || (formik.touched.hasOwnProperty("displayName") && formik.errors.hasOwnProperty("ormType")) ? "tab-error-heading" : "", children: _jsxs("div", { className: "flex flex-wrap -mx-2 -mt-2", children: [currentFields.includes("displayName") && (_jsxs("div", { className: "field mt-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "displayName", className: classNames("form-field-label", styles.fieldLabel), children: "Display Name" }), _jsx(SolidInput, { type: "text", disabled: isExistingFieldReadOnly, id: "displayName", name: "displayName", onChange: function (e) {
1442
1485
  formik.setFieldValue("displayName", e.target.value);
1443
1486
  var _a = getSingularAndPlural(e.target.value), toCamelCase = _a.toCamelCase, toSnakeCase = _a.toSnakeCase;
1444
1487
  formik.setFieldValue("name", toCamelCase);
@@ -1447,11 +1490,11 @@ var FieldMetaDataForm = function (_a) {
1447
1490
  }
1448
1491
  }, value: formik.values.displayName, className: classNames(styles.fieldInput, {
1449
1492
  "p-invalid": isFormFieldValid(formik, "displayName"),
1450
- }) }), isFormFieldValid(formik, "displayName") && (_jsx("p", { className: styles.fieldError, children: (_v = (_u = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _u === void 0 ? void 0 : _u.displayName) === null || _v === void 0 ? void 0 : _v.toString() }))] })), currentFields.includes("name") && (_jsxs("div", { className: "field mt-1 w-full px-2 pt-2 md:mt-0 md:w-1/2", children: [_jsx("label", { htmlFor: "name", className: classNames("form-field-label", styles.fieldLabel), children: "Name" }), _jsx(SolidInput, { disabled: isExistingFieldReadOnly, type: "text", id: "name", name: "name", onChange: formik.handleChange, value: formik.values.name, className: classNames(styles.fieldInput, {
1493
+ }) }), isFormFieldValid(formik, "displayName") && (_jsx("p", { className: styles.fieldError, children: (_w = (_v = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _v === void 0 ? void 0 : _v.displayName) === null || _w === void 0 ? void 0 : _w.toString() }))] })), currentFields.includes("name") && (_jsxs("div", { className: "field mt-2 px-2 pt-2 md:mt-0 md:w-1/2", children: [_jsx("label", { htmlFor: "name", className: classNames("form-field-label", styles.fieldLabel), children: "Name" }), _jsx(SolidInput, { disabled: isExistingFieldReadOnly, type: "text", id: "name", name: "name", onChange: formik.handleChange, value: formik.values.name, className: classNames(styles.fieldInput, {
1451
1494
  "p-invalid": isFormFieldValid(formik, "name"),
1452
- }) }), isFormFieldValid(formik, "name") && (_jsx("p", { className: styles.fieldError, children: (_x = (_w = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _w === void 0 ? void 0 : _w.name) === null || _x === void 0 ? void 0 : _x.toString() }))] })), currentFields.includes("description") && (_jsxs("div", { className: "field mt-1 w-full px-2 pt-2 md:mt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "description", className: classNames("form-field-label", styles.fieldLabel), children: "Description" }), _jsx(SolidTextarea, { "aria-describedby": "Description of your field", id: "description", name: "description", onChange: formik.handleChange, value: formik.values.description, rows: 5, className: classNames(styles.fieldTextarea, {
1495
+ }) }), isFormFieldValid(formik, "name") && (_jsx("p", { className: styles.fieldError, children: (_y = (_x = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _x === void 0 ? void 0 : _x.name) === null || _y === void 0 ? void 0 : _y.toString() }))] })), currentFields.includes("description") && (_jsxs("div", { className: "field mt-2 w-full px-2 pt-2 md:mt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "description", className: classNames("form-field-label", styles.fieldLabel), children: "Description" }), _jsx(SolidTextarea, { "aria-describedby": "Description of your field", id: "description", name: "description", onChange: formik.handleChange, value: formik.values.description, rows: 5, className: classNames(styles.fieldTextarea, {
1453
1496
  "p-invalid": isFormFieldValid(formik, "description"),
1454
- }) }), isFormFieldValid(formik, "description") && (_jsx("p", { className: styles.fieldError, children: (_z = (_y = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _y === void 0 ? void 0 : _y.description) === null || _z === void 0 ? void 0 : _z.toString() }))] })), currentFields.includes("columnName") && (_jsxs("div", { className: "field mt-2 w-full px-2 pt-2 md:w-1/2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SolidCheckbox, { onChange: function (event) {
1497
+ }) }), isFormFieldValid(formik, "description") && (_jsx("p", { className: styles.fieldError, children: (_0 = (_z = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _z === void 0 ? void 0 : _z.description) === null || _0 === void 0 ? void 0 : _0.toString() }))] })), currentFields.includes("columnName") && (_jsxs("div", { className: "field mt-2 w-full px-2 pt-2 md:w-1/2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SolidCheckbox, { onChange: function (event) {
1455
1498
  var checked = event.currentTarget.checked;
1456
1499
  setShowColumnName(checked);
1457
1500
  if (checked === true) {
@@ -1465,9 +1508,9 @@ var FieldMetaDataForm = function (_a) {
1465
1508
  }
1466
1509
  }, checked: showColumnName, disabled: isExistingFieldReadOnly }), _jsx("label", { htmlFor: "ingredient1", className: "form-field-label", children: "Set Column Name" })] }), showColumnName && (_jsxs("div", { className: "field mt-4 w-full gap-2", children: [_jsx("label", { htmlFor: "columnName", className: classNames("form-field-label", styles.fieldLabel), children: "Column Name" }), _jsx(SolidInput, { disabled: isExistingFieldReadOnly, type: "text", id: "columnName", name: "columnName", onChange: formik.handleChange, value: formik.values.columnName, className: classNames(styles.fieldInput, {
1467
1510
  "p-invalid": isFormFieldValid(formik, "columnName"),
1468
- }) }), isFormFieldValid(formik, "columnName") && (_jsx("p", { className: styles.fieldError, children: (_1 = (_0 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _0 === void 0 ? void 0 : _0.columnName) === null || _1 === void 0 ? void 0 : _1.toString() }))] }))] }))] }) }), _jsxs(TabPanel, { header: "Advanced Config", children: [((_3 = (_2 = formik === null || formik === void 0 ? void 0 : formik.values) === null || _2 === void 0 ? void 0 : _2.type) === null || _3 === void 0 ? void 0 : _3.length) > 0 && (_jsxs("div", { className: "flex flex-wrap -mx-2 -mt-2", children: [currentFields.includes("length") && (_jsxs("div", { className: "field flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsx("label", { htmlFor: "length", className: classNames("form-field-label", styles.fieldLabel), children: "Length" }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "length", name: "length", value: formik.values.length, onChange: function (event) { return formik.setFieldValue("length", event.value); }, className: classNames({
1511
+ }) }), isFormFieldValid(formik, "columnName") && (_jsx("p", { className: styles.fieldError, children: (_2 = (_1 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _1 === void 0 ? void 0 : _1.columnName) === null || _2 === void 0 ? void 0 : _2.toString() }))] }))] }))] }) }), _jsxs(TabPanel, { header: "Advanced Config", children: [((_4 = (_3 = formik === null || formik === void 0 ? void 0 : formik.values) === null || _3 === void 0 ? void 0 : _3.type) === null || _4 === void 0 ? void 0 : _4.length) > 0 && (_jsxs("div", { className: "flex flex-wrap -mx-2 -mt-2", children: [currentFields.includes("length") && (_jsxs("div", { className: "field flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsx("label", { htmlFor: "length", className: classNames("form-field-label", styles.fieldLabel), children: "Length" }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "length", name: "length", value: formik.values.length, onChange: function (event) { return formik.setFieldValue("length", event.value); }, className: classNames({
1469
1512
  "p-invalid": isFormFieldValid(formik, "length"),
1470
- }) }) }), isFormFieldValid(formik, "length") && (_jsx("p", { className: styles.fieldError, children: (_5 = (_4 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _4 === void 0 ? void 0 : _4.length) === null || _5 === void 0 ? void 0 : _5.toString() }))] })), currentFields.includes("defaultValue") && selectedTypeValue === "boolean" &&
1513
+ }) }) }), isFormFieldValid(formik, "length") && (_jsx("p", { className: styles.fieldError, children: (_6 = (_5 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _5 === void 0 ? void 0 : _5.length) === null || _6 === void 0 ? void 0 : _6.toString() }))] })), currentFields.includes("defaultValue") && selectedTypeValue === "boolean" &&
1471
1514
  _jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { style: { marginBottom: "0px" }, htmlFor: "defaultValue", className: classNames("form-field-label", styles.fieldLabel), children: "Default Value" }), _jsx(SolidSegmentedControl, { value: resolveBooleanOptionValue(formik.values.defaultValue), onChange: function (value) { return formik.setFieldValue("defaultValue", value); }, options: booleanSegmentedOptions, className: classNames("", {
1472
1515
  "p-invalid": isFormFieldValid(formik, "defaultValue"),
1473
1516
  }) })] }), 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") &&
@@ -1491,7 +1534,7 @@ var FieldMetaDataForm = function (_a) {
1491
1534
  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({
1492
1535
  "p-invalid": isFormFieldValid(formik, "defaultValue"),
1493
1536
  }) }));
1494
- })(), isFormFieldValid(formik, "defaultValue") && (_jsx("p", { className: styles.fieldError, children: (_7 = (_6 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _6 === void 0 ? void 0 : _6.defaultValue) === null || _7 === void 0 ? void 0 : _7.toString() }))] })), currentFields.includes("mediaTypes") && (_jsxs("div", { className: "field flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaTypes", className: classNames("form-field-label", styles.fieldLabel), children: "Media Type" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_b = {},
1537
+ })(), isFormFieldValid(formik, "defaultValue") && (_jsx("p", { className: styles.fieldError, children: (_8 = (_7 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _7 === void 0 ? void 0 : _7.defaultValue) === null || _8 === void 0 ? void 0 : _8.toString() }))] })), currentFields.includes("mediaTypes") && (_jsxs("div", { className: "field flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaTypes", className: classNames("form-field-label", styles.fieldLabel), children: "Media Type" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_b = {},
1495
1538
  _b[styles.fieldInvalidControl] = isFormFieldValid(formik, "mediaTypes"),
1496
1539
  _b)), children: _jsx(SolidAutocomplete, { multiple: true, dropdown: true, field: "label", value: mediaTypeSelectedItems, suggestions: filteredMediaTypes, completeMethod: handleMediaTypesSearch, maxVisibleChips: 3, onChange: function (_a) {
1497
1540
  var value = _a.value;
@@ -1508,96 +1551,103 @@ var FieldMetaDataForm = function (_a) {
1508
1551
  })
1509
1552
  .filter(Boolean);
1510
1553
  formik.setFieldValue("mediaTypes", normalizedValues);
1511
- }, placeholder: "Select media types", className: "w-full" }) }), isFormFieldValid(formik, "mediaTypes") && (_jsx("p", { className: styles.fieldError, children: (_9 = (_8 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _8 === void 0 ? void 0 : _8.mediaTypes) === null || _9 === void 0 ? void 0 : _9.toString() }))] })), currentFields.includes("mediaMaxSizeKb") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:mt-0 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaMaxSizeKb", className: classNames("form-field-label", styles.fieldLabel), children: "Media Max Size (Mb)" }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "mediaMaxSizeKb", name: "mediaMaxSizeKb", value: formik.values.mediaMaxSizeKb, onChange: function (event) { return formik.setFieldValue("mediaMaxSizeKb", event.value); }, className: classNames({
1554
+ }, placeholder: "Select media types", className: "w-full" }) }), isFormFieldValid(formik, "mediaTypes") && (_jsx("p", { className: styles.fieldError, children: (_10 = (_9 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _9 === void 0 ? void 0 : _9.mediaTypes) === null || _10 === void 0 ? void 0 : _10.toString() }))] })), currentFields.includes("mediaMaxSizeKb") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:mt-0 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaMaxSizeKb", className: classNames("form-field-label", styles.fieldLabel), children: "Media Max Size (Mb)" }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "mediaMaxSizeKb", name: "mediaMaxSizeKb", value: formik.values.mediaMaxSizeKb, onChange: function (event) { return formik.setFieldValue("mediaMaxSizeKb", event.value); }, className: classNames({
1512
1555
  "p-invalid": isFormFieldValid(formik, "mediaMaxSizeKb"),
1513
- }) }) }), isFormFieldValid(formik, "mediaMaxSizeKb") && (_jsx("p", { className: styles.fieldError, children: (_11 = (_10 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _10 === void 0 ? void 0 : _10.mediaMaxSizeKb) === null || _11 === void 0 ? void 0 : _11.toString() }))] })), currentFields.includes("mediaStorageProviderId") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaStorageProviderId", className: classNames("form-field-label", styles.fieldLabel), children: "Media Storage Provider" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_c = {},
1514
- _c[styles.fieldInvalidControl] = isFormFieldValid(formik, "mediaStorageProvider"),
1515
- _c)), children: _jsx(SolidAutocomplete, { value: mediaStorageProviderField.selectedItem, suggestions: mediaStorageProviderField.filteredItems, completeMethod: mediaStorageProviderField.searchItems, onChange: mediaStorageProviderField.handleChange, dropdown: true, field: "name", className: "w-full" }) }), isFormFieldValid(formik, "mediaStorageProvider") && (_jsx("p", { className: styles.fieldError, children: (_13 = (_12 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _12 === void 0 ? void 0 : _12.mediaStorageProviderId) === null || _13 === void 0 ? void 0 : _13.toString() }))] })), currentFields.includes("mediaEmbedded") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaEmbedded", className: classNames("form-field-label", styles.fieldLabel), children: "Media Embedded" }), _jsx(SolidSegmentedControl, { value: resolveBooleanOptionValue(formik.values.mediaEmbedded), onChange: function (value) {
1556
+ }) }) }), isFormFieldValid(formik, "mediaMaxSizeKb") && (_jsx("p", { className: styles.fieldError, children: (_12 = (_11 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _11 === void 0 ? void 0 : _11.mediaMaxSizeKb) === null || _12 === void 0 ? void 0 : _12.toString() }))] })), currentFields.includes("mediaAllowedExtensions") && (_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: "mediaAllowedExtensions", className: classNames("form-field-label", styles.fieldLabel), children: "Allowed Extensions" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_c = {},
1557
+ _c[styles.fieldInvalidControl] = isFormFieldValid(formik, "mediaAllowedExtensions"),
1558
+ _c)), children: _jsx(SolidAutocomplete, { multiple: true, dropdown: true, field: "label", value: mediaExtensionSelectedItems, suggestions: mediaExtensionOptions, maxVisibleChips: 4, onChange: function (_a) {
1559
+ var value = _a.value;
1560
+ var selection = Array.isArray(value) ? value : [];
1561
+ var normalizedValues = normalizeMediaAllowedExtensionsInput(selection.map(function (item) { var _a; return (item && typeof item === "object" ? (_a = item.value) !== null && _a !== void 0 ? _a : item.label : item); }));
1562
+ formik.setFieldValue("mediaAllowedExtensions", normalizedValues);
1563
+ }, placeholder: "Select allowed extensions", className: "w-full" }) }), _jsx("p", { className: styles.fieldHelper, children: "Optional. Pick specific extensions from the selected media types." }), isFormFieldValid(formik, "mediaAllowedExtensions") && (_jsx("p", { className: styles.fieldError, children: (_14 = (_13 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _13 === void 0 ? void 0 : _13.mediaAllowedExtensions) === null || _14 === void 0 ? void 0 : _14.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", (_d = {},
1564
+ _d[styles.fieldInvalidControl] = isFormFieldValid(formik, "mediaStorageProvider"),
1565
+ _d)), 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: (_16 = (_15 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _15 === void 0 ? void 0 : _15.mediaStorageProviderId) === null || _16 === void 0 ? void 0 : _16.toString() }))] })), currentFields.includes("mediaEmbedded") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "mediaEmbedded", className: classNames("form-field-label", styles.fieldLabel), children: "Media Embedded" }), _jsx(SolidSegmentedControl, { value: resolveBooleanOptionValue(formik.values.mediaEmbedded), onChange: function (value) {
1516
1566
  formik.setFieldValue("mediaEmbedded", value);
1517
1567
  }, options: booleanSegmentedOptions, className: classNames("", {
1518
1568
  "p-invalid": isFormFieldValid(formik, "mediaEmbedded"),
1519
- }) }), isFormFieldValid(formik, "mediaEmbedded") && (_jsx("p", { className: styles.fieldError, children: (_15 = (_14 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _14 === void 0 ? void 0 : _14.mediaEmbedded) === null || _15 === void 0 ? void 0 : _15.toString() }))] })), currentFields.includes("relationType") && (_jsxs("div", { className: "field mt-1 flex w-full items-center gap-2 px-2 pt-2", children: [_jsx("label", { style: { marginBottom: "0px" }, htmlFor: "relationType", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Type" }), _jsx(SolidSegmentedControl, { value: formik.values.relationType, options: fieldDefaultMetaData.data.relationTypes, onChange: function (value) {
1569
+ }) }), isFormFieldValid(formik, "mediaEmbedded") && (_jsx("p", { className: styles.fieldError, children: (_18 = (_17 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _17 === void 0 ? void 0 : _17.mediaEmbedded) === null || _18 === void 0 ? void 0 : _18.toString() }))] })), currentFields.includes("relationType") && (_jsxs("div", { className: "field mt-1 flex w-full items-center gap-2 px-2 pt-2", children: [_jsx("label", { style: { marginBottom: "0px" }, htmlFor: "relationType", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Type" }), _jsx(SolidSegmentedControl, { value: formik.values.relationType, options: fieldDefaultMetaData.data.relationTypes, onChange: function (value) {
1520
1570
  formik.setFieldValue("relationType", value);
1521
1571
  if (value === "one-to-many") {
1522
1572
  formik.setFieldValue("relationCreateInverse", true);
1523
1573
  }
1524
1574
  }, className: classNames("", {
1525
1575
  "p-invalid": isFormFieldValid(formik, "relationType"),
1526
- }) }), isFormFieldValid(formik, "relationType") && (_jsx("p", { className: styles.fieldError, children: (_17 = (_16 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _16 === void 0 ? void 0 : _16.relationType) === null || _17 === void 0 ? void 0 : _17.toString() }))] })), currentFields.includes("relationType") && (formik.values.relationType === "many-to-one" || formik.values.relationType === "one-to-many") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationCascade", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Cascade" }), _jsx(SolidSelect, { value: formik.values.relationCascade, options: fieldDefaultMetaData.data.cascadeTypes, optionLabel: "label", optionValue: "value", onChange: function (_a) {
1576
+ }) }), isFormFieldValid(formik, "relationType") && (_jsx("p", { className: styles.fieldError, children: (_20 = (_19 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _19 === void 0 ? void 0 : _19.relationType) === null || _20 === void 0 ? void 0 : _20.toString() }))] })), currentFields.includes("relationType") && (formik.values.relationType === "many-to-one" || formik.values.relationType === "one-to-many") && (_jsxs("div", { className: "field mt-2 flex 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) {
1527
1577
  var value = _a.value;
1528
1578
  return formik.setFieldValue("relationCascade", value);
1529
1579
  }, placeholder: "Cascade", className: classNames("w-full", {
1530
1580
  "p-invalid": isFormFieldValid(formik, "relationCascade"),
1531
- }) }), isFormFieldValid(formik, "relationCascade") && (_jsx("p", { className: styles.fieldError, children: (_19 = (_18 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _18 === void 0 ? void 0 : _18.relationCascade) === null || _19 === void 0 ? void 0 : _19.toString() }))] })), currentFields.includes("relationModelModuleName") && (_jsxs("div", { className: "field mt-1 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationModelModuleName", className: classNames("form-field-label", styles.fieldLabel), children: "Co-Module Name" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_d = {},
1532
- _d[styles.fieldInvalidControl] = isFormFieldValid(formik, "relationModelModuleName"),
1533
- _d)), children: _jsx(SolidAutocomplete, { value: relationModelModuleField.selectedItem, suggestions: relationModelModuleField.filteredItems, completeMethod: relationModelModuleField.searchItems, onChange: relationModelModuleField.handleChange, dropdown: true, field: "name", className: "w-full" }) }), isFormFieldValid(formik, "relationModelModuleName") && (_jsx("p", { className: styles.fieldError, children: (_21 = (_20 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _20 === void 0 ? void 0 : _20.relationModelModuleName) === null || _21 === void 0 ? void 0 : _21.toString() }))] })), currentFields.includes("relationCoModelSingularName") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationCoModelSingularName", className: classNames("form-field-label", styles.fieldLabel), children: "Co-Model Name" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_e = {},
1534
- _e[styles.fieldInvalidControl] = isFormFieldValid(formik, "relationCoModelSingularName"),
1535
- _e)), children: _jsx(SolidAutocomplete, { value: relationCoModelField.selectedItem, suggestions: relationCoModelField.filteredItems, completeMethod: relationCoModelField.searchItems, onChange: relationCoModelField.handleChange, dropdown: true, field: "displayName", className: "w-full" }) }), isFormFieldValid(formik, "relationCoModelSingularName") && (_jsx("p", { className: styles.fieldError, children: (_23 = (_22 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _22 === void 0 ? void 0 : _22.relationCoModelSingularName) === null || _23 === void 0 ? void 0 : _23.toString() })), formik.values.relationType === "one-to-many" &&
1581
+ }) }), isFormFieldValid(formik, "relationCascade") && (_jsx("p", { className: styles.fieldError, children: (_22 = (_21 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _21 === void 0 ? void 0 : _21.relationCascade) === null || _22 === void 0 ? void 0 : _22.toString() }))] })), currentFields.includes("relationModelModuleName") && (_jsxs("div", { className: "field mt-2 flex 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", (_e = {},
1582
+ _e[styles.fieldInvalidControl] = isFormFieldValid(formik, "relationModelModuleName"),
1583
+ _e)), 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: (_24 = (_23 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _23 === void 0 ? void 0 : _23.relationModelModuleName) === null || _24 === void 0 ? void 0 : _24.toString() }))] })), currentFields.includes("relationCoModelSingularName") && (_jsxs("div", { className: "field mt-2 flex 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", (_f = {},
1584
+ _f[styles.fieldInvalidControl] = isFormFieldValid(formik, "relationCoModelSingularName"),
1585
+ _f)), 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: (_26 = (_25 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _25 === void 0 ? void 0 : _25.relationCoModelSingularName) === null || _26 === void 0 ? void 0 : _26.toString() })), formik.values.relationType === "one-to-many" &&
1536
1586
  _jsx("p", { className: "fieldSubTitle", children: "This is the child model." }), formik.values.relationType === "many-to-one" &&
1537
- _jsx("p", { className: "fieldSubTitle", children: "This is the parent model." })] })), currentFields.includes("relationCoModelColumnName") && (formik.values.relationType === "many-to-many" || formik.values.relationType === "many-to-one") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationCoModelColumnName", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Co-Model Column Name" }), _jsx(SolidInput, { type: "text", id: "relationCoModelColumnName", name: "relationCoModelColumnName", onChange: formik.handleChange, disabled: isExistingFieldReadOnly, value: formik.values.relationCoModelColumnName, className: classNames(styles.fieldInput, {
1587
+ _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 flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationCoModelColumnName", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Co-Model Column Name" }), _jsx(SolidInput, { type: "text", id: "relationCoModelColumnName", name: "relationCoModelColumnName", onChange: formik.handleChange, disabled: isExistingFieldReadOnly, value: formik.values.relationCoModelColumnName, className: classNames(styles.fieldInput, {
1538
1588
  "p-invalid": isFormFieldValid(formik, "relationCoModelColumnName"),
1539
- }) }), isFormFieldValid(formik, "relationCoModelColumnName") && (_jsx("p", { className: styles.fieldError, children: (_25 = (_24 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _24 === void 0 ? void 0 : _24.relationCoModelColumnName) === null || _25 === void 0 ? void 0 : _25.toString() })), _jsx("p", { className: "fieldSubTitle", children: "Allows you to control the column name of the foreign key. Eg. when adding a country field to state model, by default foreign key column in the state table will be called country_id, use this field to create a foreign key with a different name. " })] })), askForUserKeyField && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "userKey", className: classNames("form-field-label", styles.fieldLabel), children: "Set User Key" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_f = {},
1540
- _f[styles.fieldInvalidControl] = isFormFieldValid(formik, "userKey"),
1541
- _f)), children: _jsx(SolidAutocomplete, { value: userKeyField.selectedItem, suggestions: userKeyField.filteredItems, completeMethod: userKeyField.searchItems, onChange: userKeyField.handleChange, dropdown: true, field: "displayName", className: "w-full" }) }), _jsx("p", { className: "fieldSubTitle", children: "The co-model you have selected does not have a user key specified. Use the above dropdown to choose from one of the \"unique\" fields in this co-model to be set as its userkey. User keys are required in co-models being used in many-to-one or one-to-many relations as in SolidX when a many-to-one field is rendered it uses an autocomplete dropdown, and the user key value is what is displayed as the label in the dropdown." }), isFormFieldValid(formik, "userKey") && (_jsx("p", { className: styles.fieldError, children: (_27 = (_26 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _26 === void 0 ? void 0 : _26.userKey) === null || _27 === void 0 ? void 0 : _27.toString() }))] })), currentFields.includes("relationFieldFixedFilter") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2", children: [_jsx("label", { htmlFor: "relationFieldFixedFilter", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Field Fixed Filter" }), _jsx(SolidTextarea, { "aria-describedby": "Fixed Filter", id: "relationFieldFixedFilter", name: "relationFieldFixedFilter", onChange: formik.handleChange, value: formik.values.relationFieldFixedFilter, rows: 5, className: classNames(styles.fieldTextarea, {
1589
+ }) }), isFormFieldValid(formik, "relationCoModelColumnName") && (_jsx("p", { className: styles.fieldError, children: (_28 = (_27 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _27 === void 0 ? void 0 : _27.relationCoModelColumnName) === null || _28 === void 0 ? void 0 : _28.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 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", (_g = {},
1590
+ _g[styles.fieldInvalidControl] = isFormFieldValid(formik, "userKey"),
1591
+ _g)), 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: (_30 = (_29 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _29 === void 0 ? void 0 : _29.userKey) === null || _30 === void 0 ? void 0 : _30.toString() }))] })), currentFields.includes("relationFieldFixedFilter") && (_jsxs("div", { className: "field mt-2 flex flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationFieldFixedFilter", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Field Fixed Filter" }), _jsx(SolidTextarea, { "aria-describedby": "Fixed Filter", id: "relationFieldFixedFilter", name: "relationFieldFixedFilter", onChange: formik.handleChange, value: formik.values.relationFieldFixedFilter, rows: 5, className: classNames(styles.fieldTextarea, {
1542
1592
  "p-invalid": isFormFieldValid(formik, "relationFieldFixedFilter"),
1543
- }) }), isFormFieldValid(formik, "relationFieldFixedFilter") && (_jsx("p", { className: styles.fieldError, children: (_29 = (_28 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _28 === void 0 ? void 0 : _28.relationFieldFixedFilter) === null || _29 === void 0 ? void 0 : _29.toString() })), _jsx("p", { className: "fieldSubTitle", children: "Many to one fields are rendered as autocomplete dropdown on the SolidX ui. Use the fixed filter to load a pre-filtered set of records from the co-model. Please note user input entered in the autocomplete is used to apply a dynamic filter." })] })), currentFields.includes("relationCreateInverse") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationCreateInverse", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Create Inverse" }), _jsxs("div", { className: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "relationCreateInverse", name: "relationCreateInverse", checked: formik.values.relationCreateInverse, disabled: formik.values.relationType === "one-to-many", onChange: function (event) { return formik.setFieldValue("relationCreateInverse", event.currentTarget.checked); } }), _jsx("label", { htmlFor: "relationCreateInverse", className: classNames("ml-2", "form-field-label", styles.fieldLabel), children: "Create Inverse" })] }), isFormFieldValid(formik, "relationCreateInverse") && (_jsx("p", { className: styles.fieldError, children: (_31 = (_30 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _30 === void 0 ? void 0 : _30.relationCreateInverse) === null || _31 === void 0 ? void 0 : _31.toString() }))] })), currentFields.includes("relationCoModelFieldName") && formik.values.relationCreateInverse && !formik.values.relationCoModelSingularName && (_jsx("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: _jsx(SolidMessage, { text: "Please select Co-model" }) })), currentFields.includes("relationCoModelFieldName") && formik.values.relationCreateInverse && formik.values.relationCoModelSingularName && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsxs("label", { htmlFor: "relationCoModelFieldName", className: classNames("form-field-label", styles.fieldLabel), children: ["Field Name In ", formik.values.relationCoModelSingularName, " Model"] }), _jsx(SolidInput, { type: "text", id: "relationCoModelFieldName", name: "relationCoModelFieldName", onChange: formik.handleChange, disabled: isExistingFieldReadOnly, value: formik.values.relationCoModelFieldName, className: classNames(styles.fieldInput, {
1593
+ }) }), isFormFieldValid(formik, "relationFieldFixedFilter") && (_jsx("p", { className: styles.fieldError, children: (_32 = (_31 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _31 === void 0 ? void 0 : _31.relationFieldFixedFilter) === null || _32 === void 0 ? void 0 : _32.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 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: "solid-field-checkbox-row", 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: (_34 = (_33 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _33 === void 0 ? void 0 : _33.relationCreateInverse) === null || _34 === void 0 ? void 0 : _34.toString() }))] })), currentFields.includes("relationCoModelFieldName") && formik.values.relationCreateInverse && !formik.values.relationCoModelSingularName && (_jsx("div", { className: "field mt-2 flex 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 flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsxs("label", { htmlFor: "relationCoModelFieldName", className: classNames("form-field-label", styles.fieldLabel), children: ["Field Name In ", formik.values.relationCoModelSingularName, " Model"] }), _jsx(SolidInput, { type: "text", id: "relationCoModelFieldName", name: "relationCoModelFieldName", onChange: formik.handleChange, disabled: isExistingFieldReadOnly, value: formik.values.relationCoModelFieldName, className: classNames(styles.fieldInput, {
1544
1594
  "p-invalid": isFormFieldValid(formik, "relationCoModelFieldName"),
1545
1595
  }) }), formik.values.relationType === "one-to-many" &&
1546
- _jsxs("p", { className: "fieldSubTitle", children: ["This is a field that is created in the child model. In this case a ", _jsx("span", { style: { fontWeight: "700" }, children: (_32 = formik.values.relationCoModelFieldName) !== null && _32 !== void 0 ? _32 : formik.values.relationCoModelSingularName }), " field will be created in the ", formik.values.relationCoModelSingularName, " when setting create inverse true."] }), formik.values.relationType === "many-to-one" &&
1547
- _jsxs("p", { className: "fieldSubTitle", children: ["This is a field that is created in the parent model. In this case a ", _jsx("span", { style: { fontWeight: "700" }, children: (_33 = formik.values.relationCoModelFieldName) !== null && _33 !== void 0 ? _33 : "".concat(formik.values.relationCoModelSingularName, "s") }), " field will be created in the ", formik.values.relationCoModelSingularName, " when setting create inverse true."] }), formik.values.relationType === "many-to-many" &&
1548
- _jsxs("p", { className: "fieldSubTitle", children: ["In this case a ", formik.values.relationCoModelFieldName, " field will be created in the ", _jsx("span", { style: { fontWeight: "700" }, children: (_34 = formik.values.relationCoModelSingularName) !== null && _34 !== void 0 ? _34 : '{{}}' }), " when setting create inverse true."] }), isFormFieldValid(formik, "relationCoModelFieldName") && (_jsx("p", { className: styles.fieldError, children: (_36 = (_35 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _35 === void 0 ? void 0 : _35.relationCoModelFieldName) === null || _36 === void 0 ? void 0 : _36.toString() }))] })), currentFields.includes("relationJoinTableName") && formik.values.relationType === "many-to-many" && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationJoinTableName", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Join Table Name" }), _jsx(SolidInput, { type: "text", id: "relationJoinTableName", name: "relationJoinTableName", onChange: formik.handleChange, disabled: isExistingFieldReadOnly, value: formik.values.relationJoinTableName, className: classNames(styles.fieldInput, {
1596
+ _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: (_35 = formik.values.relationCoModelFieldName) !== null && _35 !== void 0 ? _35 : formik.values.relationCoModelSingularName }), " field will be created in the ", formik.values.relationCoModelSingularName, " when setting create inverse true."] }), formik.values.relationType === "many-to-one" &&
1597
+ _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: (_36 = formik.values.relationCoModelFieldName) !== null && _36 !== void 0 ? _36 : "".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" &&
1598
+ _jsxs("p", { className: "fieldSubTitle", children: ["In this case a ", formik.values.relationCoModelFieldName, " field will be created in the ", _jsx("span", { style: { fontWeight: "700" }, children: (_37 = formik.values.relationCoModelSingularName) !== null && _37 !== void 0 ? _37 : '{{}}' }), " when setting create inverse true."] }), isFormFieldValid(formik, "relationCoModelFieldName") && (_jsx("p", { className: styles.fieldError, children: (_39 = (_38 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _38 === void 0 ? void 0 : _38.relationCoModelFieldName) === null || _39 === void 0 ? void 0 : _39.toString() }))] })), currentFields.includes("relationJoinTableName") && formik.values.relationType === "many-to-many" && (_jsxs("div", { className: "field mt-2 flex flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "relationJoinTableName", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Join Table Name" }), _jsx(SolidInput, { type: "text", id: "relationJoinTableName", name: "relationJoinTableName", onChange: formik.handleChange, disabled: isExistingFieldReadOnly, value: formik.values.relationJoinTableName, className: classNames(styles.fieldInput, {
1549
1599
  "p-invalid": isFormFieldValid(formik, "relationJoinTableName"),
1550
- }) }), isFormFieldValid(formik, "relationJoinTableName") && (_jsx("p", { className: styles.fieldError, children: (_38 = (_37 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _37 === void 0 ? void 0 : _37.relationJoinTableName) === null || _38 === void 0 ? void 0 : _38.toString() }))] })), currentFields.includes("selectionDynamicProvider") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "selectionDynamicProvider", className: classNames("form-field-label", styles.fieldLabel), children: "Selection Dynamic Provider" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_g = {},
1551
- _g[styles.fieldInvalidControl] = isFormFieldValid(formik, "selectionDynamicProvider"),
1552
- _g)), children: _jsx(SolidAutocomplete, { value: selectionDynamicProviderField.selectedItem, suggestions: selectionDynamicProviderField.filteredItems, completeMethod: selectionDynamicProviderField.searchItems, onChange: selectionDynamicProviderField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "selectionDynamicProvider") && (_jsx("p", { className: styles.fieldError, children: (_40 = (_39 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _39 === void 0 ? void 0 : _39.selectionDynamicProvider) === null || _40 === void 0 ? void 0 : _40.toString() }))] })), currentFields.includes("selectionValueType") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "selectionValueType", className: classNames("form-field-label", styles.fieldLabel), children: "Select Value Type" }), _jsx(SolidSelect, { value: formik.values.selectionValueType, options: selctionValueTypes, optionLabel: "label", optionValue: "value", onChange: function (_a) {
1600
+ }) }), isFormFieldValid(formik, "relationJoinTableName") && (_jsx("p", { className: styles.fieldError, children: (_41 = (_40 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _40 === void 0 ? void 0 : _40.relationJoinTableName) === null || _41 === void 0 ? void 0 : _41.toString() }))] })), currentFields.includes("selectionDynamicProvider") && (_jsxs("div", { className: "field mt-2 flex 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", (_h = {},
1601
+ _h[styles.fieldInvalidControl] = isFormFieldValid(formik, "selectionDynamicProvider"),
1602
+ _h)), 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: (_43 = (_42 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _42 === void 0 ? void 0 : _42.selectionDynamicProvider) === null || _43 === void 0 ? void 0 : _43.toString() }))] })), currentFields.includes("selectionValueType") && (_jsxs("div", { className: "field mt-2 flex flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "selectionValueType", className: classNames("form-field-label", styles.fieldLabel), children: "Select Value Type" }), _jsx(SolidSelect, { value: formik.values.selectionValueType, options: selctionValueTypes, optionLabel: "label", optionValue: "value", onChange: function (_a) {
1553
1603
  var value = _a.value;
1554
1604
  return formik.setFieldValue("selectionValueType", value);
1555
1605
  }, placeholder: "Select Value Type", className: classNames("w-full", {
1556
1606
  "p-invalid": isFormFieldValid(formik, "selectionValueType"),
1557
- }) }), isFormFieldValid(formik, "selectionValueType") && (_jsx("p", { className: styles.fieldError, children: (_42 = (_41 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _41 === void 0 ? void 0 : _41.selectionValueType) === null || _42 === void 0 ? void 0 : _42.toString() }))] })), currentFields.includes("selectionStaticValues") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "selectionStaticValues", className: classNames("form-field-label", styles.fieldLabel), children: "Selection Static Values" }), formik.values.selectionStaticValues.map(function (enumValue, index) { return (_jsx(SelectionStaticValues, { enumValue: enumValue, onUpdate: function (updatedString) { return updateEnumValues(index, updatedString); }, onDelete: function () { return deleteEnumValue(index); }, onAdd: addEnumValue }, index)); }), isFormFieldValid(formik, "selectionStaticValues") && (_jsx("p", { className: styles.fieldError, children: (_44 = (_43 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _43 === void 0 ? void 0 : _43.selectionStaticValues) === null || _44 === void 0 ? void 0 : _44.toString() }))] })), currentFields.includes("computedFieldValueType") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "computedFieldValueType", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Value Type" }), _jsx(SolidAutocomplete, { value: selectedComputedFieldValueType, suggestions: filteredComputedFieldValueTypes, completeMethod: searchComputedFieldValueType, field: "label", dropdown: true, className: classNames("solid-standard-autocomplete", (_h = {},
1558
- _h[styles.fieldInvalidControl] = isFormFieldValid(formik, "computedFieldValueType"),
1559
- _h)), onChange: function (e) {
1607
+ }) }), isFormFieldValid(formik, "selectionValueType") && (_jsx("p", { className: styles.fieldError, children: (_45 = (_44 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _44 === void 0 ? void 0 : _44.selectionValueType) === null || _45 === void 0 ? void 0 : _45.toString() }))] })), currentFields.includes("selectionStaticValues") && (_jsxs("div", { className: "field mt-2 flex 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: (_47 = (_46 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _46 === void 0 ? void 0 : _46.selectionStaticValues) === null || _47 === void 0 ? void 0 : _47.toString() }))] })), currentFields.includes("computedFieldValueType") && (_jsxs("div", { className: "field mt-2 flex 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", (_j = {},
1608
+ _j[styles.fieldInvalidControl] = isFormFieldValid(formik, "computedFieldValueType"),
1609
+ _j)), onChange: function (e) {
1560
1610
  setSelectedComputedFieldValueType(e.value);
1561
1611
  formik.setFieldValue("computedFieldValueType", e.value.value);
1562
- } }), isFormFieldValid(formik, "computedFieldValueType") && (_jsx("p", { className: styles.fieldError, children: (_46 = (_45 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _45 === void 0 ? void 0 : _45.computedFieldValueType) === null || _46 === void 0 ? void 0 : _46.toString() }))] })), currentFields.includes("computedFieldValueProvider") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "computedFieldValueProvider", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Provider" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_j = {},
1563
- _j[styles.fieldInvalidControl] = isFormFieldValid(formik, "computedFieldValueProvider"),
1564
- _j)), children: _jsx(SolidAutocomplete, { value: computedFieldValueProviderField.selectedItem, suggestions: computedFieldValueProviderField.filteredItems, completeMethod: computedFieldValueProviderField.searchItems, onChange: computedFieldValueProviderField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "computedFieldValueProvider") && (_jsx("p", { className: styles.fieldError, children: (_48 = (_47 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _47 === void 0 ? void 0 : _47.computedFieldValueProvider) === null || _48 === void 0 ? void 0 : _48.toString() }))] })), currentFields.includes("computedFieldTriggerConfig") && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2", children: [(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.computedFieldTriggerConfig) === null
1612
+ } }), isFormFieldValid(formik, "computedFieldValueType") && (_jsx("p", { className: styles.fieldError, children: (_49 = (_48 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _48 === void 0 ? void 0 : _48.computedFieldValueType) === null || _49 === void 0 ? void 0 : _49.toString() }))] })), currentFields.includes("computedFieldValueProvider") && (_jsxs("div", { className: "field mt-2 flex 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", (_k = {},
1613
+ _k[styles.fieldInvalidControl] = isFormFieldValid(formik, "computedFieldValueProvider"),
1614
+ _k)), 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: (_51 = (_50 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _50 === void 0 ? void 0 : _50.computedFieldValueProvider) === null || _51 === void 0 ? void 0 : _51.toString() }))] })), currentFields.includes("computedFieldTriggerConfig") && (_jsxs("div", { className: "field mt-2 flex flex-col gap-2 px-2 pt-2", children: [(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.computedFieldTriggerConfig) === null
1565
1615
  &&
1566
1616
  _jsx("div", { className: "mb-3", children: _jsx(SolidMessage, { severity: "error", text: "You seem to be using an old configuration of ComputedFieldProvider. Please change your current computed field provider i.e ".concat(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.computedFieldValueProvider, " to implement IEntityComputedFieldProvider before continuing.") }) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("label", { htmlFor: "computedFieldTriggerConfig", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Trigger Config" }), _jsx("div", { children: _jsx(SolidButton, { icon: "si si-plus", size: "small", onClick: handleAdd, type: "button", className: "ml-2" }) })] }), formik.values.computedFieldTriggerConfig.map(function (row, index) {
1567
1617
  var _a;
1568
1618
  return (_jsx(SelectComputedFieldTriggerValues, { index: index, row: row, onChange: handleChange, onDelete: handleDelete, isLastRow: index === formik.values.computedFieldTriggerConfig.length - 1, disableDelete: formik.values.computedFieldTriggerConfig.length === 1, formik: formik, isFormFieldValid: isFormFieldValid, searchModuleName: searchModuleName, searchModelName: computedFieldSearchHandlers[index], modelMetaData: modelMetaData, errors: (_a = formik.errors.computedFieldTriggerConfig) === null || _a === void 0 ? void 0 : _a[index] }, index));
1569
- }), typeof formik.errors.computedFieldTriggerConfig === 'string' && (_jsx("p", { className: styles.fieldError, children: formik.errors.computedFieldTriggerConfig }))] })), currentFields.includes("selectionDynamicProviderCtxt") && (_jsxs("div", { className: "field mt-4 flex w-full flex-col gap-2 px-2 pt-2", children: [_jsx("label", { htmlFor: "selectionDynamicProviderCtxt", className: classNames("form-field-label", styles.fieldLabel), children: "Selection Dynamic Provider Context" }), _jsx(SolidCodeEditor, { value: (_49 = formik.values.selectionDynamicProviderCtxt) !== null && _49 !== void 0 ? _49 : "", onChange: function (value) {
1619
+ }), typeof formik.errors.computedFieldTriggerConfig === 'string' && (_jsx("p", { className: styles.fieldError, children: formik.errors.computedFieldTriggerConfig }))] })), currentFields.includes("selectionDynamicProviderCtxt") && (_jsxs("div", { className: "field mt-4 flex 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: (_52 = formik.values.selectionDynamicProviderCtxt) !== null && _52 !== void 0 ? _52 : "", onChange: function (value) {
1570
1620
  formik.setFieldValue("selectionDynamicProviderCtxt", value !== null && value !== void 0 ? value : "");
1571
- }, language: "json", height: "300px" }), _jsx("div", { className: " form-field-label mt-2", children: markdownText }), isFormFieldValid(formik, "selectionDynamicProviderCtxt") && (_jsx("p", { className: styles.fieldError, children: (_51 = (_50 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _50 === void 0 ? void 0 : _50.selectionDynamicProviderCtxt) === null || _51 === void 0 ? void 0 : _51.toString() }))] })), currentFields.includes("computedFieldValueProviderCtxt") && (_jsxs("div", { className: "field mt-4 flex w-full flex-col gap-2 px-2 pt-2", children: [_jsx("label", { htmlFor: "computedFieldValueProviderCtxt", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Value Provider Context" }), _jsx(SolidCodeEditor, { value: (_52 = formik.values.computedFieldValueProviderCtxt) !== null && _52 !== void 0 ? _52 : "", onChange: function (value) {
1621
+ }, language: "json", height: "300px" }), _jsx("div", { className: " form-field-label mt-2", children: markdownText }), isFormFieldValid(formik, "selectionDynamicProviderCtxt") && (_jsx("p", { className: styles.fieldError, children: (_54 = (_53 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _53 === void 0 ? void 0 : _53.selectionDynamicProviderCtxt) === null || _54 === void 0 ? void 0 : _54.toString() }))] })), currentFields.includes("computedFieldValueProviderCtxt") && (_jsxs("div", { className: "field mt-4 flex 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: (_55 = formik.values.computedFieldValueProviderCtxt) !== null && _55 !== void 0 ? _55 : "", onChange: function (value) {
1572
1622
  formik.setFieldValue("computedFieldValueProviderCtxt", value !== null && value !== void 0 ? value : "");
1573
- }, language: "json", height: "300px" }), _jsx("div", { className: "form-field-label mt-4", children: markdownText }), isFormFieldValid(formik, "computedFieldValueProviderCtxt") && (_jsx("p", { className: styles.fieldError, children: (_54 = (_53 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _53 === void 0 ? void 0 : _53.computedFieldValueProviderCtxt) === null || _54 === void 0 ? void 0 : _54.toString() }))] }))] })), showValidationSection && (_jsxs(_Fragment, { children: [_jsx("p", { className: "form-wrapper-heading", children: "Validations" }), _jsxs("div", { className: "flex flex-wrap -mx-2 -mt-2", children: [(showRegexFields && selectedTypeValue === "password") &&
1574
- _jsx(_Fragment, { children: _jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "regexPattern", className: classNames("form-field-label", styles.fieldLabel), children: "Password Policy" }), _jsx(SolidSelect, { value: selectedPasswordPolicy, options: passwordPolicyOptions, optionLabel: "label", optionValue: "value", onChange: function (_a) {
1623
+ }, language: "json", height: "300px" }), _jsx("div", { className: "form-field-label mt-4", children: markdownText }), isFormFieldValid(formik, "computedFieldValueProviderCtxt") && (_jsx("p", { className: styles.fieldError, children: (_57 = (_56 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _56 === void 0 ? void 0 : _56.computedFieldValueProviderCtxt) === null || _57 === void 0 ? void 0 : _57.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") &&
1624
+ _jsx(_Fragment, { children: _jsxs("div", { className: "field mt-2 flex flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "regexPattern", className: classNames("form-field-label", styles.fieldLabel), children: "Password Policy" }), _jsx(SolidSelect, { value: selectedPasswordPolicy, options: passwordPolicyOptions, optionLabel: "label", optionValue: "value", onChange: function (_a) {
1575
1625
  var value = _a.value;
1576
1626
  setSelectedPasswordPolicy(value);
1577
1627
  if (value !== "custom") {
1578
1628
  formik.setFieldValue("regexPattern", value);
1579
1629
  }
1580
- }, placeholder: "Select a Password Policy", className: "w-full" })] }) }), showRegexFields && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "regexPattern", className: classNames("form-field-label", styles.fieldLabel), children: "Regex Pattern" }), _jsx(SolidInput, { type: "text", id: "regexPattern", name: "regexPattern", onChange: formik.handleChange, value: formik.values.regexPattern, className: classNames(styles.fieldInput, {
1630
+ }, placeholder: "Select a Password Policy", className: "w-full" })] }) }), showRegexFields && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "field mt-2 flex flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "regexPattern", className: classNames("form-field-label", styles.fieldLabel), children: "Regex Pattern" }), _jsx(SolidInput, { type: "text", id: "regexPattern", name: "regexPattern", onChange: formik.handleChange, value: formik.values.regexPattern, className: classNames(styles.fieldInput, {
1581
1631
  "p-invalid": isFormFieldValid(formik, "regexPattern"),
1582
- }) }), isFormFieldValid(formik, "regexPattern") && (_jsx("p", { className: styles.fieldError, children: (_56 = (_55 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _55 === void 0 ? void 0 : _55.regexPattern) === null || _56 === void 0 ? void 0 : _56.toString() }))] }), showRegexFields && (_jsxs("div", { className: "field mt-2 mb-3 flex w-full flex-col gap-2 px-2 pt-2 md:mb-3 md:w-1/2", children: [_jsx("label", { htmlFor: "regexPatternNotMatchingErrorMsg", className: classNames("form-field-label", styles.fieldLabel), children: "Regex Pattern Not Matching Error Msg" }), _jsx(SolidInput, { type: "text", id: "regexPatternNotMatchingErrorMsg", name: "regexPatternNotMatchingErrorMsg", onChange: formik.handleChange, value: formik.values.regexPatternNotMatchingErrorMsg, className: classNames(styles.fieldInput, {
1632
+ }) }), isFormFieldValid(formik, "regexPattern") && (_jsx("p", { className: styles.fieldError, children: (_59 = (_58 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _58 === void 0 ? void 0 : _58.regexPattern) === null || _59 === void 0 ? void 0 : _59.toString() }))] }), showRegexFields && (_jsxs("div", { className: "field mt-2 mb-3 flex flex-col gap-2 px-2 pt-2 md:mb-3 md:w-1/2", children: [_jsx("label", { htmlFor: "regexPatternNotMatchingErrorMsg", className: classNames("form-field-label", styles.fieldLabel), children: "Regex Pattern Not Matching Error Msg" }), _jsx(SolidInput, { type: "text", id: "regexPatternNotMatchingErrorMsg", name: "regexPatternNotMatchingErrorMsg", onChange: formik.handleChange, value: formik.values.regexPatternNotMatchingErrorMsg, className: classNames(styles.fieldInput, {
1583
1633
  "p-invalid": isFormFieldValid(formik, "regexPatternNotMatchingErrorMsg"),
1584
- }) }), isFormFieldValid(formik, "regexPatternNotMatchingErrorMsg") && (_jsx("p", { className: styles.fieldError, children: (_58 = (_57 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _57 === void 0 ? void 0 : _57.regexPatternNotMatchingErrorMsg) === null || _58 === void 0 ? void 0 : _58.toString() }))] }))] })), (showMinFields || showMaxFields) &&
1585
- _jsxs(_Fragment, { children: [showMinFields && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsxs("label", { htmlFor: "min", className: classNames("form-field-label", styles.fieldLabel), children: ["Min ", (selectedTypeValue !== "int" && selectedTypeValue !== "decimal") && "(Characters Allowed)"] }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "min", name: "min", step: "0.00001", value: formik.values.min, onChange: function (event) { return formik.setFieldValue("min", event.value); }, className: classNames({
1634
+ }) }), isFormFieldValid(formik, "regexPatternNotMatchingErrorMsg") && (_jsx("p", { className: styles.fieldError, children: (_61 = (_60 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _60 === void 0 ? void 0 : _60.regexPatternNotMatchingErrorMsg) === null || _61 === void 0 ? void 0 : _61.toString() }))] }))] })), (showMinFields || showMaxFields) &&
1635
+ _jsxs(_Fragment, { children: [showMinFields && (_jsxs("div", { className: "field mt-2 flex flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsxs("label", { htmlFor: "min", className: classNames("form-field-label", styles.fieldLabel), children: ["Min ", (selectedTypeValue !== "int" && selectedTypeValue !== "decimal") && "(Characters Allowed)"] }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "min", name: "min", step: "0.00001", value: formik.values.min, onChange: function (event) { return formik.setFieldValue("min", event.value); }, className: classNames({
1586
1636
  "p-invalid": isFormFieldValid(formik, "min"),
1587
- }), disabled: isExistingFieldReadOnly }) }), isFormFieldValid(formik, "min") && (_jsx("p", { className: styles.fieldError, children: (_60 = (_59 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _59 === void 0 ? void 0 : _59.min) === null || _60 === void 0 ? void 0 : _60.toString() }))] })), showMaxFields && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsxs("label", { htmlFor: "max", className: classNames("form-field-label", styles.fieldLabel), children: ["Max ", (selectedTypeValue !== "int" &&
1637
+ }), disabled: isExistingFieldReadOnly }) }), isFormFieldValid(formik, "min") && (_jsx("p", { className: styles.fieldError, children: (_63 = (_62 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _62 === void 0 ? void 0 : _62.min) === null || _63 === void 0 ? void 0 : _63.toString() }))] })), showMaxFields && (_jsxs("div", { className: "field mt-2 flex flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsxs("label", { htmlFor: "max", className: classNames("form-field-label", styles.fieldLabel), children: ["Max ", (selectedTypeValue !== "int" &&
1588
1638
  selectedTypeValue !== "decimal") && "(Characters allowed)"] }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "max", name: "max", step: "0.00001", value: formik.values.max, onChange: function (event) { return formik.setFieldValue("max", event.value); }, className: classNames({
1589
1639
  "p-invalid": isFormFieldValid(formik, "max"),
1590
- }), disabled: isExistingFieldReadOnly }) }), isFormFieldValid(formik, "max") && (_jsx("p", { className: styles.fieldError, children: (_62 = (_61 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _61 === void 0 ? void 0 : _61.max) === null || _62 === void 0 ? void 0 : _62.toString() }))] }))] }), showOrmOptions && (_jsxs("div", { className: "field mt-2 flex w-full flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "ormType", className: classNames("form-field-label", styles.fieldLabel), children: "Type" }), _jsx(SolidRadioGroup, { name: "ormType", value: selectedOrmType, onChange: function (value) {
1640
+ }), disabled: isExistingFieldReadOnly }) }), isFormFieldValid(formik, "max") && (_jsx("p", { className: styles.fieldError, children: (_65 = (_64 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _64 === void 0 ? void 0 : _64.max) === null || _65 === void 0 ? void 0 : _65.toString() }))] }))] }), showOrmOptions && (_jsxs("div", { className: "field mt-2 flex flex-col gap-2 px-2 pt-2 md:w-1/2", children: [_jsx("label", { htmlFor: "ormType", className: classNames("form-field-label", styles.fieldLabel), children: "Type" }), _jsx(SolidRadioGroup, { name: "ormType", value: selectedOrmType, onChange: function (value) {
1591
1641
  formik.setFieldValue("ormType", value);
1592
1642
  setSelectedOrmType(value);
1593
1643
  }, options: (ormTypeOptions || []).map(function (ormType) { return ({
1594
1644
  value: ormType.label,
1595
1645
  label: (_jsxs("span", { className: classNames("ml-2", "form-field-label"), children: [ormType.label, _jsx("br", {}), _jsx("span", { className: "fieldSubTitle mt-0", children: "(".concat(ormType.description, ")") })] })),
1596
- }); }), className: "ormTypeflex", itemClassName: "mr-4 items-center" }), isFormFieldValid(formik, "ormType") && (_jsx("p", { className: styles.fieldError, children: (_64 = (_63 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _63 === void 0 ? void 0 : _63.ormType) === null || _64 === void 0 ? void 0 : _64.toString() }))] }))] })] })), (formik.values.relationType !== "many-to-many" && formik.values.relationType !== "one-to-many") && _jsx("p", { className: "form-wrapper-heading", children: "Settings" }), _jsxs("div", { className: "mt-1 flex flex-wrap -mx-2 -mt-2 md:mt-0", children: [currentFields.includes("required") && (formik.values.relationType !== "many-to-many" && formik.values.relationType !== "one-to-many") && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "required", name: "required", onChange: function (event) {
1646
+ }); }), className: "ormTypeflex", itemClassName: "mr-4 items-center" }), isFormFieldValid(formik, "ormType") && (_jsx("p", { className: styles.fieldError, children: (_67 = (_66 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _66 === void 0 ? void 0 : _66.ormType) === null || _67 === void 0 ? void 0 : _67.toString() }))] }))] })] })), (formik.values.relationType !== "many-to-many" && formik.values.relationType !== "one-to-many") && _jsx("p", { className: "form-wrapper-heading", children: "Settings" }), _jsxs("div", { className: "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: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "required", name: "required", onChange: function (event) {
1597
1647
  if (!formik.values.isPrimaryKey && !formik.values.unique) {
1598
1648
  formik.setFieldValue("required", event.currentTarget.checked);
1599
1649
  }
1600
- }, checked: formik.values.required, disabled: formik.values.isPrimaryKey || formik.values.unique }), _jsxs("label", { htmlFor: "required", className: classNames("form-field-label", styles.fieldLabel), children: ["Required ", formik.values.isPrimaryKey && "(Auto-enabled for Primary Key)", !formik.values.isPrimaryKey && formik.values.unique && "(Auto-enabled for Unique)"] })] }), _jsx("p", { className: "text-xs mt-2", children: "You won't be able to create an entry if this field is empty" }), isFormFieldValid(formik, "required") && (_jsx("p", { className: styles.fieldError, children: (_66 = (_65 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _65 === void 0 ? void 0 : _65.required) === null || _66 === void 0 ? void 0 : _66.toString() }))] })), currentFields.includes("unique") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "unique", name: "unique", onChange: function (event) {
1650
+ }, checked: formik.values.required, disabled: formik.values.isPrimaryKey || formik.values.unique }), _jsxs("label", { htmlFor: "required", className: classNames("form-field-label", styles.fieldLabel), 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: (_69 = (_68 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _68 === void 0 ? void 0 : _68.required) === null || _69 === void 0 ? void 0 : _69.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: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "unique", name: "unique", onChange: function (event) {
1601
1651
  // Prevent unchecking if isPrimaryKey is true
1602
1652
  if (!formik.values.isPrimaryKey) {
1603
1653
  var nextValue = event.currentTarget.checked;
@@ -1611,20 +1661,20 @@ var FieldMetaDataForm = function (_a) {
1611
1661
  formik.setFieldValue("required", false);
1612
1662
  }
1613
1663
  }
1614
- }, checked: formik.values.unique, disabled: formik.values.isPrimaryKey }), _jsxs("label", { htmlFor: "unique", className: classNames("form-field-label", styles.fieldLabel), children: ["Unique ", formik.values.isPrimaryKey && "(Auto-enabled for Primary Key)"] })] }), _jsx("p", { className: "text-xs mt-2", children: "You won't be able to create an entry if there is an existing entry with identical content" }), isFormFieldValid(formik, "unique") && (_jsx("p", { className: styles.fieldError, children: (_68 = (_67 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _67 === void 0 ? void 0 : _67.unique) === null || _68 === void 0 ? void 0 : _68.toString() }))] })), currentFields.includes("index") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "index", name: "index", onChange: function (event) {
1664
+ }, checked: formik.values.unique, disabled: formik.values.isPrimaryKey }), _jsxs("label", { htmlFor: "unique", className: classNames("form-field-label", styles.fieldLabel), 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: (_71 = (_70 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _70 === void 0 ? void 0 : _70.unique) === null || _71 === void 0 ? void 0 : _71.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: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "index", name: "index", onChange: function (event) {
1615
1665
  formik.setFieldValue("index", event.currentTarget.checked);
1616
- }, checked: formik.values.index }), _jsx("label", { htmlFor: "index", className: classNames("form-field-label", styles.fieldLabel), children: "Index" })] }), isFormFieldValid(formik, "index") && (_jsx("p", { className: styles.fieldError, children: (_70 = (_69 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _69 === void 0 ? void 0 : _69.index) === null || _70 === void 0 ? void 0 : _70.toString() }))] })), currentFields.includes("private") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "private", name: "private", onChange: function (event) {
1666
+ }, checked: formik.values.index }), _jsx("label", { htmlFor: "index", className: classNames("form-field-label", styles.fieldLabel), children: "Index" })] }), isFormFieldValid(formik, "index") && (_jsx("p", { className: styles.fieldError, children: (_73 = (_72 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _72 === void 0 ? void 0 : _72.index) === null || _73 === void 0 ? void 0 : _73.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: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "private", name: "private", onChange: function (event) {
1617
1667
  formik.setFieldValue("private", event.currentTarget.checked);
1618
- }, checked: formik.values.private }), _jsx("label", { htmlFor: "private", className: classNames("form-field-label", styles.fieldLabel), children: "Private" })] }), _jsx("p", { className: "text-xs mt-2", children: "This field will not show up in the API response" }), isFormFieldValid(formik, "private") && (_jsx("p", { className: styles.fieldError, children: (_72 = (_71 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _71 === void 0 ? void 0 : _71.private) === null || _72 === void 0 ? void 0 : _72.toString() }))] })), currentFields.includes("encrypt") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "encrypt", name: "encrypt", onChange: function (event) {
1668
+ }, checked: formik.values.private }), _jsx("label", { htmlFor: "private", className: classNames("form-field-label", styles.fieldLabel), 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: (_75 = (_74 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _74 === void 0 ? void 0 : _74.private) === null || _75 === void 0 ? void 0 : _75.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: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "encrypt", name: "encrypt", onChange: function (event) {
1619
1669
  formik.setFieldValue("encrypt", event.currentTarget.checked);
1620
1670
  setEncryptState(event.currentTarget.checked);
1621
- }, checked: formik.values.encrypt }), _jsx("label", { htmlFor: "encrypt", className: classNames("form-field-label", styles.fieldLabel), children: "Encrypt" })] }), isFormFieldValid(formik, "encrypt") && (_jsx("p", { className: styles.fieldError, children: (_74 = (_73 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _73 === void 0 ? void 0 : _73.encrypt) === null || _74 === void 0 ? void 0 : _74.toString() }))] })), currentFields.includes("isMultiSelect") && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "isMultiSelect", name: "isMultiSelect", onChange: function (event) {
1671
+ }, 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: (_77 = (_76 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _76 === void 0 ? void 0 : _76.encrypt) === null || _77 === void 0 ? void 0 : _77.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: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "isMultiSelect", name: "isMultiSelect", onChange: function (event) {
1622
1672
  formik.setFieldValue("isMultiSelect", event.currentTarget.checked);
1623
- }, checked: formik.values.isMultiSelect }), _jsx("label", { htmlFor: "isMultiSelect", className: classNames("form-field-label", styles.fieldLabel), children: "Is MultiSelect" })] }), isFormFieldValid(formik, "isMultiSelect") && (_jsx("p", { className: styles.fieldError, children: (_76 = (_75 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _75 === void 0 ? void 0 : _75.isMultiSelect) === null || _76 === void 0 ? void 0 : _76.toString() }))] })), currentFields.includes("enableAuditTracking") && formik.values.relationType !== "one-to-many" && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "enableAuditTracking", name: "enableAuditTracking", onChange: function (event) {
1673
+ }, checked: formik.values.isMultiSelect }), _jsx("label", { htmlFor: "isMultiSelect", className: classNames("form-field-label", styles.fieldLabel), children: "Is MultiSelect" })] }), isFormFieldValid(formik, "isMultiSelect") && (_jsx("p", { className: styles.fieldError, children: (_79 = (_78 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _78 === void 0 ? void 0 : _78.isMultiSelect) === null || _79 === void 0 ? void 0 : _79.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: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "enableAuditTracking", name: "enableAuditTracking", onChange: function (event) {
1624
1674
  formik.setFieldValue("enableAuditTracking", event.currentTarget.checked);
1625
- }, checked: formik.values.enableAuditTracking }), _jsx("label", { htmlFor: "enableAuditTracking", className: classNames("form-field-label", styles.fieldLabel), children: "Enable Audit Tracking" })] }), _jsx("p", { className: "fieldSubTitle", children: "By selecting this option, you are setting audit trail for this field." }), isFormFieldValid(formik, "enableAuditTracking") && (_jsx("p", { className: styles.fieldError, children: (_78 = (_77 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _77 === void 0 ? void 0 : _77.enableAuditTracking) === null || _78 === void 0 ? void 0 : _78.toString() }))] })), currentFields.includes("isUserKey") && formik.values.unique && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "isUserKey", name: "isUserKey", onChange: function (event) {
1675
+ }, 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: (_81 = (_80 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _80 === void 0 ? void 0 : _80.enableAuditTracking) === null || _81 === void 0 ? void 0 : _81.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: "solid-field-checkbox-row", children: [_jsx(SolidCheckbox, { id: "isUserKey", name: "isUserKey", onChange: function (event) {
1626
1676
  formik.setFieldValue("isUserKey", event.currentTarget.checked);
1627
- }, checked: formik.values.isUserKey }), _jsx("label", { htmlFor: "isUserKey", className: classNames("form-field-label", styles.fieldLabel), children: "Is Userkey" })] }), _jsx("p", { className: "fieldSubTitle", children: "By selecting this option, you are setting this field as the model's user key. Any existing user key configuration will be overwritten" }), isFormFieldValid(formik, "isUserKey") && (_jsx("p", { className: styles.fieldError, children: (_80 = (_79 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _79 === void 0 ? void 0 : _79.isUserKey) === null || _80 === void 0 ? void 0 : _80.toString() }))] })), currentFields.includes("isPrimaryKey") && (modelMetaData === null || modelMetaData === void 0 ? void 0 : modelMetaData.isLegacyTable) && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SolidCheckbox, { id: "isPrimaryKey", name: "isPrimaryKey", onChange: function (event) {
1677
+ }, 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: (_83 = (_82 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _82 === void 0 ? void 0 : _82.isUserKey) === null || _83 === void 0 ? void 0 : _83.toString() }))] })), currentFields.includes("isPrimaryKey") && (modelMetaData === null || modelMetaData === void 0 ? void 0 : modelMetaData.isLegacyTable) && (_jsxs("div", { className: "field mt-2 flex w-1/2 flex-col gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SolidCheckbox, { id: "isPrimaryKey", name: "isPrimaryKey", onChange: function (event) {
1628
1678
  var checked = event.currentTarget.checked;
1629
1679
  formik.setFieldValue("isPrimaryKey", checked);
1630
1680
  // Auto-set required and unique when isPrimaryKey is checked
@@ -1632,11 +1682,11 @@ var FieldMetaDataForm = function (_a) {
1632
1682
  formik.setFieldValue("required", true);
1633
1683
  formik.setFieldValue("unique", true);
1634
1684
  }
1635
- }, checked: formik.values.isPrimaryKey }), _jsx("label", { htmlFor: "isPrimaryKey", className: classNames("form-field-label", styles.fieldLabel), children: "Is Primary Key" })] }), _jsx("p", { className: "fieldSubTitle", children: "By selecting this option, you are setting this field as the primary key for this legacy table." }), isFormFieldValid(formik, "isPrimaryKey") && (_jsx("p", { className: styles.fieldError, children: (_82 = (_81 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _81 === void 0 ? void 0 : _81.isPrimaryKey) === null || _82 === void 0 ? void 0 : _82.toString() }))] }))] }), formik.values.encrypt === true && (_jsxs("div", { className: "mt-2 flex flex-wrap -mx-2 -mt-2", children: [_jsx("div", { className: "w-full px-2 pt-2 md:w-1/2", children: _jsxs("div", { className: "field flex w-full flex-col gap-2", children: [_jsx("label", { htmlFor: "encryptionType", className: classNames("form-field-label", styles.fieldLabel), children: "Encryption Type" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_k = {},
1636
- _k[styles.fieldInvalidControl] = isFormFieldValid(formik, "encryptionType"),
1637
- _k)), children: _jsx(SolidAutocomplete, { value: encryptionTypeField.selectedItem, suggestions: encryptionTypeField.filteredItems, completeMethod: encryptionTypeField.searchItems, onChange: encryptionTypeField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "encryptionType") && (_jsx("p", { className: styles.fieldError, children: (_84 = (_83 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _83 === void 0 ? void 0 : _83.encryptionType) === null || _84 === void 0 ? void 0 : _84.toString() }))] }) }), _jsx("div", { className: "w-full px-2 pt-2 md:w-1/2", children: _jsxs("div", { className: "field flex w-full flex-col gap-2", children: [_jsx("label", { htmlFor: "decryptWhen", className: classNames("form-field-label", styles.fieldLabel), children: "Decrypt When" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_l = {},
1638
- _l[styles.fieldInvalidControl] = isFormFieldValid(formik, "decryptWhen"),
1639
- _l)), children: _jsx(SolidAutocomplete, { value: decryptWhenField.selectedItem, suggestions: decryptWhenField.filteredItems, completeMethod: decryptWhenField.searchItems, onChange: decryptWhenField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "decryptWhen") && (_jsx("p", { className: styles.fieldError, children: (_86 = (_85 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _85 === void 0 ? void 0 : _85.decryptWhen) === null || _86 === void 0 ? void 0 : _86.toString() }))] }) })] }))] })] }) }), _jsxs("div", { className: "solid-field-form-actions", children: [_jsx(SolidButton, { label: submitLabel, size: "small", onClick: function () { return showError(); }, type: "submit" }), _jsx(SolidButton, { label: "Cancel", size: "small", severity: "secondary", type: "reset", onClick: closeForm, outlined: true })] })] }) }) }) }) }), _jsx(SolidDialog, { open: isBackPopupVisible, onOpenChange: function (next) {
1685
+ }, 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: (_85 = (_84 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _84 === void 0 ? void 0 : _84.isPrimaryKey) === null || _85 === void 0 ? void 0 : _85.toString() }))] }))] }), formik.values.encrypt === true && (_jsxs("div", { className: "mt-2 flex flex-wrap -mx-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", (_l = {},
1686
+ _l[styles.fieldInvalidControl] = isFormFieldValid(formik, "encryptionType"),
1687
+ _l)), 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: (_87 = (_86 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _86 === void 0 ? void 0 : _86.encryptionType) === null || _87 === void 0 ? void 0 : _87.toString() }))] }) }), _jsx("div", { className: "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", (_m = {},
1688
+ _m[styles.fieldInvalidControl] = isFormFieldValid(formik, "decryptWhen"),
1689
+ _m)), 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: (_89 = (_88 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _88 === void 0 ? void 0 : _88.decryptWhen) === null || _89 === void 0 ? void 0 : _89.toString() }))] }) })] }))] })] }) }), _jsxs("div", { className: "solid-field-form-actions", children: [_jsx(SolidButton, { label: submitLabel, size: "small", onClick: function () { return showError(); }, type: "submit" }), _jsx(SolidButton, { label: "Cancel", size: "small", severity: "secondary", type: "reset", onClick: closeForm, outlined: true })] })] }) }) }) }) }), _jsx(SolidDialog, { open: isBackPopupVisible, onOpenChange: function (next) {
1640
1690
  if (!next) {
1641
1691
  setIsBackPopupVisible(false);
1642
1692
  }