@solidxai/core-ui 0.1.9-beta.18 → 0.1.9-beta.19
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.
- package/dist/adapters/auth/handleLogout.d.ts +1 -1
- package/dist/adapters/auth/handleLogout.d.ts.map +1 -1
- package/dist/adapters/auth/handleLogout.js +20 -32
- package/dist/adapters/auth/handleLogout.js.map +1 -1
- package/dist/adapters/auth/handleLogout.ts +7 -14
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.d.ts.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.js +1 -10
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.js.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.tsx +1 -8
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.d.ts.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.js +6 -11
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.js.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.tsx +5 -31
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +47 -13
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +38 -4
- package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.d.ts +16 -0
- package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.js +31 -0
- package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.js.map +1 -0
- package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.tsx +43 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ClearModulePackageRuntimeHeaderAction.d.ts +3 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ClearModulePackageRuntimeHeaderAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ClearModulePackageRuntimeHeaderAction.js +141 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ClearModulePackageRuntimeHeaderAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ClearModulePackageRuntimeHeaderAction.tsx +205 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.d.ts +4 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.js +112 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.tsx +146 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.d.ts +11 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.js +22 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.tsx +36 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/moduleMetadataListOnLoad.d.ts +3 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/moduleMetadataListOnLoad.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/moduleMetadataListOnLoad.js +133 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/moduleMetadataListOnLoad.js.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/moduleMetadataListOnLoad.ts +76 -0
- package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.d.ts +12 -0
- package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.d.ts.map +1 -0
- package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.js +168 -0
- package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.js.map +1 -0
- package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.tsx +241 -0
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.d.ts.map +1 -1
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.js +3 -0
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.js.map +1 -1
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.tsx +2 -0
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +74 -68
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +13 -4
- package/dist/components/core/list/SolidListViewColumn.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewColumn.js +0 -2
- package/dist/components/core/list/SolidListViewColumn.js.map +1 -1
- package/dist/components/core/list/SolidListViewColumn.tsx +0 -1
- package/dist/components/core/list/SolidListViewConfigure.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.js +10 -9
- package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.tsx +3 -1
- package/dist/components/core/list/SolidListViewHeaderButton.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewHeaderButton.js +3 -0
- package/dist/components/core/list/SolidListViewHeaderButton.js.map +1 -1
- package/dist/components/core/list/SolidListViewHeaderButton.tsx +2 -0
- package/dist/components/core/list/SolidListViewHeaderContextMenuButton.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewHeaderContextMenuButton.js +3 -0
- package/dist/components/core/list/SolidListViewHeaderContextMenuButton.js.map +1 -1
- package/dist/components/core/list/SolidListViewHeaderContextMenuButton.tsx +2 -0
- package/dist/components/core/list/SolidListViewRowActionsMenu.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewRowActionsMenu.js +7 -1
- package/dist/components/core/list/SolidListViewRowActionsMenu.js.map +1 -1
- package/dist/components/core/list/SolidListViewRowActionsMenu.tsx +5 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js +4 -6
- package/dist/components/core/list/columns/SolidBooleanColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.tsx +1 -3
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +3 -2
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +3 -2
- package/dist/components/core/list/columns/SolidMediaSingleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js +3 -2
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.tsx +3 -2
- package/dist/components/core/model/CreateModel.css +48 -0
- package/dist/components/core/model/CreateModel.d.ts +1 -0
- package/dist/components/core/model/CreateModel.d.ts.map +1 -1
- package/dist/components/core/model/CreateModel.js +69 -104
- package/dist/components/core/model/CreateModel.js.map +1 -1
- package/dist/components/core/model/CreateModel.tsx +92 -204
- package/dist/components/core/model/FieldMetaData.d.ts +1 -1
- package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaData.js +6 -22
- package/dist/components/core/model/FieldMetaData.js.map +1 -1
- package/dist/components/core/model/FieldMetaData.tsx +6 -45
- package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js +196 -222
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.tsx +0 -72
- package/dist/components/core/model/ModelMetaData.d.ts.map +1 -1
- package/dist/components/core/model/ModelMetaData.js +7 -7
- package/dist/components/core/model/ModelMetaData.js.map +1 -1
- package/dist/components/core/model/ModelMetaData.tsx +7 -0
- package/dist/components/core/module/CreateModule.css +44 -0
- package/dist/components/core/module/CreateModule.d.ts +1 -0
- package/dist/components/core/module/CreateModule.d.ts.map +1 -1
- package/dist/components/core/module/CreateModule.js +40 -43
- package/dist/components/core/module/CreateModule.js.map +1 -1
- package/dist/components/core/module/CreateModule.tsx +243 -247
- package/dist/components/core/module/ModuleListViewData.d.ts.map +1 -1
- package/dist/components/core/module/ModuleListViewData.js +47 -7
- package/dist/components/core/module/ModuleListViewData.js.map +1 -1
- package/dist/components/core/module/ModuleListViewData.tsx +58 -0
- package/dist/components/core/module/ModuleMetadataExplorer.css +638 -0
- package/dist/components/core/module/ModuleMetadataExplorer.d.ts +15 -0
- package/dist/components/core/module/ModuleMetadataExplorer.d.ts.map +1 -0
- package/dist/components/core/module/ModuleMetadataExplorer.js +666 -0
- package/dist/components/core/module/ModuleMetadataExplorer.js.map +1 -0
- package/dist/components/core/module/ModuleMetadataExplorer.tsx +1000 -0
- package/dist/components/core/module/ModulePackageDialog.css +540 -0
- package/dist/components/core/module/ModulePackageDialog.d.ts +16 -0
- package/dist/components/core/module/ModulePackageDialog.d.ts.map +1 -0
- package/dist/components/core/module/ModulePackageDialog.js +625 -0
- package/dist/components/core/module/ModulePackageDialog.js.map +1 -0
- package/dist/components/core/module/ModulePackageDialog.tsx +906 -0
- package/dist/components/layout/user-profile-menu.d.ts.map +1 -1
- package/dist/components/layout/user-profile-menu.js +57 -33
- package/dist/components/layout/user-profile-menu.js.map +1 -1
- package/dist/components/layout/user-profile-menu.tsx +11 -59
- package/dist/helpers/buttonEnvironment.d.ts +5 -0
- package/dist/helpers/buttonEnvironment.d.ts.map +1 -0
- package/dist/helpers/buttonEnvironment.js +30 -0
- package/dist/helpers/buttonEnvironment.js.map +1 -0
- package/dist/helpers/buttonEnvironment.ts +35 -0
- package/dist/helpers/fileTypeIcon.d.ts +12 -0
- package/dist/helpers/fileTypeIcon.d.ts.map +1 -0
- package/dist/helpers/fileTypeIcon.js +37 -0
- package/dist/helpers/fileTypeIcon.js.map +1 -0
- package/dist/helpers/fileTypeIcon.tsx +65 -0
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +10 -0
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +10 -0
- package/dist/helpers/waitForBackendAvailability.d.ts +7 -0
- package/dist/helpers/waitForBackendAvailability.d.ts.map +1 -0
- package/dist/helpers/waitForBackendAvailability.js +86 -0
- package/dist/helpers/waitForBackendAvailability.js.map +1 -0
- package/dist/helpers/waitForBackendAvailability.ts +37 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.ts +18 -0
- package/dist/redux/api/moduleApi.d.ts +26 -1
- package/dist/redux/api/moduleApi.d.ts.map +1 -1
- package/dist/redux/api/moduleApi.js +237 -1
- package/dist/redux/api/moduleApi.js.map +1 -1
- package/dist/redux/api/moduleApi.ts +181 -1
- package/dist/redux/store/defaultStoreConfig.d.ts +22 -0
- package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
- package/dist/redux/store/solidEntityApiPool.d.ts +1 -0
- package/dist/redux/store/solidEntityApiPool.d.ts.map +1 -1
- package/dist/redux/store/solidEntityApiPool.js +4 -0
- package/dist/redux/store/solidEntityApiPool.js.map +1 -1
- package/dist/redux/store/solidEntityApiPool.ts +4 -0
- package/dist/resources/globals.css +56 -0
- package/dist/resources/shadcn-base.css +5 -0
- package/dist/routes/AppEventListener.d.ts.map +1 -1
- package/dist/routes/AppEventListener.js +58 -8
- package/dist/routes/AppEventListener.js.map +1 -1
- package/dist/routes/AppEventListener.tsx +69 -8
- package/dist/types/index.d.ts +1 -0
- package/dist/types/jsoneditor.d.ts +4 -0
- package/package.json +2 -1
|
@@ -1404,237 +1404,211 @@ var FieldMetaDataForm = function (_a) {
|
|
|
1404
1404
|
searchData: searchSelectionDecryptWhen,
|
|
1405
1405
|
existingData: decryptWhenExisting,
|
|
1406
1406
|
});
|
|
1407
|
-
return (_jsxs("div", { children: [_jsx("div", { children:
|
|
1407
|
+
return (_jsxs("div", { children: [_jsx("div", { children: _jsx("form", { onSubmit: formik.handleSubmit, onReset: function (event) {
|
|
1408
1408
|
event.preventDefault();
|
|
1409
1409
|
resetFormStateForTypeSelection();
|
|
1410
|
-
}, children:
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
} }), fieldMetaData ?
|
|
1434
|
-
_jsxs("div", { className: "form-wrapper-title solid-mobile-text-wrapper", children: ["Edit ", capitalize(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.displayName)] })
|
|
1435
|
-
:
|
|
1436
|
-
_jsxs("div", { className: "form-wrapper-title solid-mobile-text-wrapper", children: ["Add New ", (selectedType === null || selectedType === void 0 ? void 0 : selectedType.label) && !showTypeFilter && capitalize(selectedType.label), " Field to ", capitalize(modelMetaData === null || modelMetaData === void 0 ? void 0 : modelMetaData.displayName)] })] }), _jsx("div", { className: "flex align-items-center gap-3 close-popup", children: _jsx(SolidButton, { icon: "si si-times", text: true, "aria-label": "Cancel", type: "reset", size: "small", onClick: function () { return setVisiblePopup(false); }, className: 'max-w-2rem bg-primary-reverse text-color' }) })] }) }), showTypeFilter === true ?
|
|
1437
|
-
_jsx(FieldSelector, { handleTypeSelect: handleTypeSelect, modelMetaData: modelMetaData })
|
|
1438
|
-
:
|
|
1439
|
-
_jsx("div", { className: "p-3", style: { maxHeight: '80vh', overflowY: 'auto', overflowX: 'hidden' }, children: _jsx("div", { className: "p-d-flex p-jc-center creat-field-for form-dem", children: _jsxs("div", { className: "p-fluid", style: { position: 'relative' }, children: [_jsxs(TabView, { panelContainerClassName: "px-0", children: [_jsx(TabPanel, { header: "Basic Info", className: (formik.touched.hasOwnProperty("name") && formik.errors.hasOwnProperty("name")) || (formik.touched.hasOwnProperty("displayName") && formik.errors.hasOwnProperty("displayName")) || (formik.touched.hasOwnProperty("displayName") && formik.errors.hasOwnProperty("ormType")) ? "tab-error-heading" : "", children: _jsxs("div", { className: "formgrid grid", children: [currentFields.includes("displayName") && (_jsxs("div", { className: "field col-12 md:col-6 mt-2", children: [_jsx("label", { htmlFor: "displayName", className: classNames("form-field-label", styles.fieldLabel), children: "Display Name" }), _jsx(SolidInput, { type: "text", disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, id: "displayName", name: "displayName", onChange: function (e) {
|
|
1440
|
-
formik.setFieldValue("displayName", e.target.value);
|
|
1441
|
-
var _a = getSingularAndPlural(e.target.value), toCamelCase = _a.toCamelCase, toSnakeCase = _a.toSnakeCase;
|
|
1442
|
-
formik.setFieldValue("name", toCamelCase);
|
|
1443
|
-
if (showColumnName) {
|
|
1444
|
-
formik.setFieldValue("columnName", toSnakeCase);
|
|
1445
|
-
}
|
|
1446
|
-
}, value: formik.values.displayName, className: classNames(styles.fieldInput, {
|
|
1447
|
-
"p-invalid": isFormFieldValid(formik, "displayName"),
|
|
1448
|
-
}) }), isFormFieldValid(formik, "displayName") && (_jsx("p", { className: styles.fieldError, children: (_r = (_q = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _q === void 0 ? void 0 : _q.displayName) === null || _r === void 0 ? void 0 : _r.toString() }))] })), currentFields.includes("name") && (_jsxs("div", { className: "field col-12 md:col-6 mt-1 md:mt-0", children: [_jsx("label", { htmlFor: "name", className: classNames("form-field-label", styles.fieldLabel), children: "Name" }), _jsx(SolidInput, { disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, type: "text", id: "name", name: "name", onChange: formik.handleChange, value: formik.values.name, className: classNames(styles.fieldInput, {
|
|
1449
|
-
"p-invalid": isFormFieldValid(formik, "name"),
|
|
1450
|
-
}) }), isFormFieldValid(formik, "name") && (_jsx("p", { className: styles.fieldError, children: (_t = (_s = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _s === void 0 ? void 0 : _s.name) === null || _t === void 0 ? void 0 : _t.toString() }))] })), currentFields.includes("description") && (_jsxs("div", { className: "field col-12 md:col-6 mt-1 md:mt-2", children: [_jsx("label", { htmlFor: "description", className: classNames("form-field-label", styles.fieldLabel), children: "Description" }), _jsx(SolidTextarea, { "aria-describedby": "Description of your field", id: "description", name: "description", onChange: formik.handleChange, value: formik.values.description, rows: 5, cols: 30, className: classNames(styles.fieldTextarea, {
|
|
1451
|
-
"p-invalid": isFormFieldValid(formik, "description"),
|
|
1452
|
-
}) }), isFormFieldValid(formik, "description") && (_jsx("p", { className: styles.fieldError, children: (_v = (_u = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _u === void 0 ? void 0 : _u.description) === null || _v === void 0 ? void 0 : _v.toString() }))] })), currentFields.includes("columnName") && (_jsxs("div", { className: "field col-12 md:col-6 mt-2", children: [_jsxs("div", { className: "flex align-items-center gap-2", children: [_jsx(SolidCheckbox, { onChange: function (event) {
|
|
1453
|
-
var checked = event.currentTarget.checked;
|
|
1454
|
-
setShowColumnName(checked);
|
|
1455
|
-
if (checked === true) {
|
|
1456
|
-
var toSnakeCase = getSingularAndPlural(formik.values.displayName).toSnakeCase;
|
|
1457
|
-
if (pathname.includes('create')) {
|
|
1458
|
-
formik.setFieldValue("columnName", toSnakeCase);
|
|
1459
|
-
}
|
|
1410
|
+
}, children: showTypeFilter === true ?
|
|
1411
|
+
_jsx(FieldSelector, { handleTypeSelect: handleTypeSelect, modelMetaData: modelMetaData })
|
|
1412
|
+
:
|
|
1413
|
+
_jsx("div", { className: "p-3", style: { maxHeight: '80vh', overflowY: 'auto', overflowX: 'hidden' }, children: _jsx("div", { className: "p-d-flex p-jc-center creat-field-for form-dem", children: _jsxs("div", { className: "p-fluid", style: { position: 'relative' }, children: [_jsxs(TabView, { panelContainerClassName: "px-0", children: [_jsx(TabPanel, { header: "Basic Info", className: (formik.touched.hasOwnProperty("name") && formik.errors.hasOwnProperty("name")) || (formik.touched.hasOwnProperty("displayName") && formik.errors.hasOwnProperty("displayName")) || (formik.touched.hasOwnProperty("displayName") && formik.errors.hasOwnProperty("ormType")) ? "tab-error-heading" : "", children: _jsxs("div", { className: "formgrid grid", children: [currentFields.includes("displayName") && (_jsxs("div", { className: "field col-12 md:col-6 mt-2", children: [_jsx("label", { htmlFor: "displayName", className: classNames("form-field-label", styles.fieldLabel), children: "Display Name" }), _jsx(SolidInput, { type: "text", disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, id: "displayName", name: "displayName", onChange: function (e) {
|
|
1414
|
+
formik.setFieldValue("displayName", e.target.value);
|
|
1415
|
+
var _a = getSingularAndPlural(e.target.value), toCamelCase = _a.toCamelCase, toSnakeCase = _a.toSnakeCase;
|
|
1416
|
+
formik.setFieldValue("name", toCamelCase);
|
|
1417
|
+
if (showColumnName) {
|
|
1418
|
+
formik.setFieldValue("columnName", toSnakeCase);
|
|
1419
|
+
}
|
|
1420
|
+
}, value: formik.values.displayName, className: classNames(styles.fieldInput, {
|
|
1421
|
+
"p-invalid": isFormFieldValid(formik, "displayName"),
|
|
1422
|
+
}) }), isFormFieldValid(formik, "displayName") && (_jsx("p", { className: styles.fieldError, children: (_r = (_q = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _q === void 0 ? void 0 : _q.displayName) === null || _r === void 0 ? void 0 : _r.toString() }))] })), currentFields.includes("name") && (_jsxs("div", { className: "field col-12 md:col-6 mt-1 md:mt-0", children: [_jsx("label", { htmlFor: "name", className: classNames("form-field-label", styles.fieldLabel), children: "Name" }), _jsx(SolidInput, { disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, type: "text", id: "name", name: "name", onChange: formik.handleChange, value: formik.values.name, className: classNames(styles.fieldInput, {
|
|
1423
|
+
"p-invalid": isFormFieldValid(formik, "name"),
|
|
1424
|
+
}) }), isFormFieldValid(formik, "name") && (_jsx("p", { className: styles.fieldError, children: (_t = (_s = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _s === void 0 ? void 0 : _s.name) === null || _t === void 0 ? void 0 : _t.toString() }))] })), currentFields.includes("description") && (_jsxs("div", { className: "field col-12 md:col-6 mt-1 md:mt-2", children: [_jsx("label", { htmlFor: "description", className: classNames("form-field-label", styles.fieldLabel), children: "Description" }), _jsx(SolidTextarea, { "aria-describedby": "Description of your field", id: "description", name: "description", onChange: formik.handleChange, value: formik.values.description, rows: 5, cols: 30, className: classNames(styles.fieldTextarea, {
|
|
1425
|
+
"p-invalid": isFormFieldValid(formik, "description"),
|
|
1426
|
+
}) }), isFormFieldValid(formik, "description") && (_jsx("p", { className: styles.fieldError, children: (_v = (_u = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _u === void 0 ? void 0 : _u.description) === null || _v === void 0 ? void 0 : _v.toString() }))] })), currentFields.includes("columnName") && (_jsxs("div", { className: "field col-12 md:col-6 mt-2", children: [_jsxs("div", { className: "flex align-items-center gap-2", children: [_jsx(SolidCheckbox, { onChange: function (event) {
|
|
1427
|
+
var checked = event.currentTarget.checked;
|
|
1428
|
+
setShowColumnName(checked);
|
|
1429
|
+
if (checked === true) {
|
|
1430
|
+
var toSnakeCase = getSingularAndPlural(formik.values.displayName).toSnakeCase;
|
|
1431
|
+
if (pathname.includes('create')) {
|
|
1432
|
+
formik.setFieldValue("columnName", toSnakeCase);
|
|
1460
1433
|
}
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1434
|
+
}
|
|
1435
|
+
else {
|
|
1436
|
+
formik.setFieldValue("columnName", null);
|
|
1437
|
+
}
|
|
1438
|
+
}, checked: showColumnName, disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id }), _jsx("label", { htmlFor: "ingredient1", className: "form-field-label", children: "Set Column Name" })] }), showColumnName && (_jsxs("div", { className: "field col-12 gap-2 mt-4", children: [_jsx("label", { htmlFor: "columnName", className: classNames("form-field-label", styles.fieldLabel), children: "Column Name" }), _jsx(SolidInput, { disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, type: "text", id: "columnName", name: "columnName", onChange: formik.handleChange, value: formik.values.columnName, className: classNames(styles.fieldInput, {
|
|
1439
|
+
"p-invalid": isFormFieldValid(formik, "columnName"),
|
|
1440
|
+
}) }), isFormFieldValid(formik, "columnName") && (_jsx("p", { className: styles.fieldError, children: (_x = (_w = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _w === void 0 ? void 0 : _w.columnName) === null || _x === void 0 ? void 0 : _x.toString() }))] }))] }))] }) }), _jsxs(TabPanel, { header: "Advanced Config", children: [((_z = (_y = formik === null || formik === void 0 ? void 0 : formik.values) === null || _y === void 0 ? void 0 : _y.type) === null || _z === void 0 ? void 0 : _z.length) > 0 && (_jsxs("div", { className: "formgrid grid", children: [currentFields.includes("length") && (_jsxs("div", { className: "field col-6 flex-flex-column gap-2", children: [_jsx("label", { htmlFor: "length", className: classNames("form-field-label", styles.fieldLabel), children: "Length" }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "length", name: "length", value: formik.values.length, onChange: function (event) { return formik.setFieldValue("length", event.value); }, className: classNames({
|
|
1441
|
+
"p-invalid": isFormFieldValid(formik, "length"),
|
|
1442
|
+
}) }) }), isFormFieldValid(formik, "length") && (_jsx("p", { className: styles.fieldError, children: (_1 = (_0 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _0 === void 0 ? void 0 : _0.length) === null || _1 === void 0 ? void 0 : _1.toString() }))] })), currentFields.includes("defaultValue") && selectedTypeValue === "boolean" &&
|
|
1443
|
+
_jsxs("div", { className: "field col-12 md:col-6 flex flex-column gap-2 mt-2", children: [_jsx("label", { style: { marginBottom: "0px" }, htmlFor: "defaultValue", className: classNames("form-field-label", styles.fieldLabel), children: "Default Value" }), _jsx(SolidSegmentedControl, { value: resolveBooleanOptionValue(formik.values.defaultValue), onChange: function (value) { return formik.setFieldValue("defaultValue", value); }, options: booleanSegmentedOptions, className: classNames("", {
|
|
1444
|
+
"p-invalid": isFormFieldValid(formik, "defaultValue"),
|
|
1445
|
+
}) })] }), currentFields.includes("defaultValue") && selectedTypeValue !== "boolean" && (_jsxs("div", { className: "field col-12 md:col-6 flex flex-column gap-2 mt-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") &&
|
|
1446
|
+
_jsx(SolidInput, { type: "text", id: "defaultValue", name: "defaultValue", onChange: formik.handleChange, value: formik.values.defaultValue, className: classNames(styles.fieldInput, {
|
|
1447
|
+
"p-invalid": isFormFieldValid(formik, "defaultValue"),
|
|
1448
|
+
}) }), (selectedTypeValue === "float" || selectedTypeValue === "decimal") &&
|
|
1449
|
+
_jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "defaultValue", name: "defaultValue", step: "0.00001", value: formik.values.defaultValue, onChange: function (event) { return formik.setFieldValue("defaultValue", event.value); }, className: classNames({
|
|
1473
1450
|
"p-invalid": isFormFieldValid(formik, "defaultValue"),
|
|
1474
|
-
}) }), (selectedTypeValue === "
|
|
1475
|
-
|
|
1476
|
-
"p-invalid": isFormFieldValid(formik, "defaultValue"),
|
|
1477
|
-
}) }) }), (selectedTypeValue === "int" || selectedTypeValue === "bigint") &&
|
|
1478
|
-
_jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "defaultValue", name: "defaultValue", step: "1", value: formik.values.defaultValue, onChange: function (event) { return formik.setFieldValue("defaultValue", event.value); }, className: classNames({
|
|
1479
|
-
"p-invalid": isFormFieldValid(formik, "defaultValue"),
|
|
1480
|
-
}) }) }), (selectedTypeValue === "date" || selectedTypeValue === "datetime" || selectedTypeValue === "time") && (function () {
|
|
1481
|
-
var showTimeSelect = selectedTypeValue === "datetime" || selectedTypeValue === "time";
|
|
1482
|
-
var timeOnly = selectedTypeValue === "time";
|
|
1483
|
-
var dateFormat = selectedTypeValue === "datetime"
|
|
1484
|
-
? "yyyy-MM-dd HH:mm"
|
|
1485
|
-
: timeOnly
|
|
1486
|
-
? "HH:mm"
|
|
1487
|
-
: "yyyy-MM-dd";
|
|
1488
|
-
var timeFormat = "HH:mm";
|
|
1489
|
-
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({
|
|
1451
|
+
}) }) }), (selectedTypeValue === "int" || selectedTypeValue === "bigint") &&
|
|
1452
|
+
_jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "defaultValue", name: "defaultValue", step: "1", value: formik.values.defaultValue, onChange: function (event) { return formik.setFieldValue("defaultValue", event.value); }, className: classNames({
|
|
1490
1453
|
"p-invalid": isFormFieldValid(formik, "defaultValue"),
|
|
1491
|
-
}) }))
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
})
|
|
1507
|
-
.filter(Boolean);
|
|
1508
|
-
formik.setFieldValue("mediaTypes", normalizedValues);
|
|
1509
|
-
}, placeholder: "Select media types", className: "w-full" }) }), isFormFieldValid(formik, "mediaTypes") && (_jsx("p", { className: styles.fieldError, children: (_5 = (_4 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _4 === void 0 ? void 0 : _4.mediaTypes) === null || _5 === void 0 ? void 0 : _5.toString() }))] })), currentFields.includes("mediaMaxSizeKb") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2 md:mt-0", 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({
|
|
1510
|
-
"p-invalid": isFormFieldValid(formik, "mediaMaxSizeKb"),
|
|
1511
|
-
}) }) }), isFormFieldValid(formik, "mediaMaxSizeKb") && (_jsx("p", { className: styles.fieldError, children: (_7 = (_6 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _6 === void 0 ? void 0 : _6.mediaMaxSizeKb) === null || _7 === void 0 ? void 0 : _7.toString() }))] })), currentFields.includes("mediaStorageProviderId") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-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 = {},
|
|
1512
|
-
_c[styles.fieldInvalidControl] = isFormFieldValid(formik, "mediaStorageProvider"),
|
|
1513
|
-
_c)), children: _jsx(SolidAutocomplete, { value: mediaStorageProviderField.selectedItem, suggestions: mediaStorageProviderField.filteredItems, completeMethod: mediaStorageProviderField.searchItems, onChange: mediaStorageProviderField.handleChange, dropdown: true, field: "name", className: "w-full" }) }), isFormFieldValid(formik, "mediaStorageProvider") && (_jsx("p", { className: styles.fieldError, children: (_9 = (_8 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _8 === void 0 ? void 0 : _8.mediaStorageProviderId) === null || _9 === void 0 ? void 0 : _9.toString() }))] })), currentFields.includes("mediaEmbedded") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-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) {
|
|
1514
|
-
formik.setFieldValue("mediaEmbedded", value);
|
|
1515
|
-
}, options: booleanSegmentedOptions, className: classNames("", {
|
|
1516
|
-
"p-invalid": isFormFieldValid(formik, "mediaEmbedded"),
|
|
1517
|
-
}) }), isFormFieldValid(formik, "mediaEmbedded") && (_jsx("p", { className: styles.fieldError, children: (_11 = (_10 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _10 === void 0 ? void 0 : _10.mediaEmbedded) === null || _11 === void 0 ? void 0 : _11.toString() }))] })), currentFields.includes("relationType") && (_jsxs("div", { className: "field col-12 flex gap-2 mt-1 align-items-center", 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) {
|
|
1518
|
-
formik.setFieldValue("relationType", value);
|
|
1519
|
-
if (value === "one-to-many") {
|
|
1520
|
-
formik.setFieldValue("relationCreateInverse", true);
|
|
1521
|
-
}
|
|
1522
|
-
}, className: classNames("", {
|
|
1523
|
-
"p-invalid": isFormFieldValid(formik, "relationType"),
|
|
1524
|
-
}) }), isFormFieldValid(formik, "relationType") && (_jsx("p", { className: styles.fieldError, children: (_13 = (_12 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _12 === void 0 ? void 0 : _12.relationType) === null || _13 === void 0 ? void 0 : _13.toString() }))] })), currentFields.includes("relationType") && (formik.values.relationType === "many-to-one" || formik.values.relationType === "one-to-many") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-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) {
|
|
1525
|
-
var value = _a.value;
|
|
1526
|
-
return formik.setFieldValue("relationCascade", value);
|
|
1527
|
-
}, placeholder: "Cascade", className: classNames("w-full", {
|
|
1528
|
-
"p-invalid": isFormFieldValid(formik, "relationCascade"),
|
|
1529
|
-
}) }), isFormFieldValid(formik, "relationCascade") && (_jsx("p", { className: styles.fieldError, children: (_15 = (_14 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _14 === void 0 ? void 0 : _14.relationCascade) === null || _15 === void 0 ? void 0 : _15.toString() }))] })), currentFields.includes("relationModelModuleName") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-1", children: [_jsx("label", { htmlFor: "relationModelModuleName", className: classNames("form-field-label", styles.fieldLabel), children: "Co-Module Name" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_d = {},
|
|
1530
|
-
_d[styles.fieldInvalidControl] = isFormFieldValid(formik, "relationModelModuleName"),
|
|
1531
|
-
_d)), children: _jsx(SolidAutocomplete, { value: relationModelModuleField.selectedItem, suggestions: relationModelModuleField.filteredItems, completeMethod: relationModelModuleField.searchItems, onChange: relationModelModuleField.handleChange, dropdown: true, field: "name", className: "w-full" }) }), isFormFieldValid(formik, "relationModelModuleName") && (_jsx("p", { className: styles.fieldError, children: (_17 = (_16 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _16 === void 0 ? void 0 : _16.relationModelModuleName) === null || _17 === void 0 ? void 0 : _17.toString() }))] })), currentFields.includes("relationCoModelSingularName") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-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 = {},
|
|
1532
|
-
_e[styles.fieldInvalidControl] = isFormFieldValid(formik, "relationCoModelSingularName"),
|
|
1533
|
-
_e)), children: _jsx(SolidAutocomplete, { value: relationCoModelField.selectedItem, suggestions: relationCoModelField.filteredItems, completeMethod: relationCoModelField.searchItems, onChange: relationCoModelField.handleChange, dropdown: true, field: "displayName", className: "w-full" }) }), isFormFieldValid(formik, "relationCoModelSingularName") && (_jsx("p", { className: styles.fieldError, children: (_19 = (_18 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _18 === void 0 ? void 0 : _18.relationCoModelSingularName) === null || _19 === void 0 ? void 0 : _19.toString() })), formik.values.relationType === "one-to-many" &&
|
|
1534
|
-
_jsx("p", { className: "fieldSubTitle", children: "This is the child model." }), formik.values.relationType === "many-to-one" &&
|
|
1535
|
-
_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 col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "relationCoModelColumnName", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Co-Model Column Name" }), _jsx(SolidInput, { type: "text", id: "relationCoModelColumnName", name: "relationCoModelColumnName", onChange: formik.handleChange, disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, value: formik.values.relationCoModelColumnName, className: classNames(styles.fieldInput, {
|
|
1536
|
-
"p-invalid": isFormFieldValid(formik, "relationCoModelColumnName"),
|
|
1537
|
-
}) }), isFormFieldValid(formik, "relationCoModelColumnName") && (_jsx("p", { className: styles.fieldError, children: (_21 = (_20 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _20 === void 0 ? void 0 : _20.relationCoModelColumnName) === null || _21 === void 0 ? void 0 : _21.toString() })), _jsx("p", { className: "fieldSubTitle", children: "Allows you to control the column name of the foreign key. Eg. when adding a country field to state model, by default foreign key column in the state table will be called country_id, use this field to create a foreign key with a different name. " })] })), askForUserKeyField && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-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 = {},
|
|
1538
|
-
_f[styles.fieldInvalidControl] = isFormFieldValid(formik, "userKey"),
|
|
1539
|
-
_f)), children: _jsx(SolidAutocomplete, { value: userKeyField.selectedItem, suggestions: userKeyField.filteredItems, completeMethod: userKeyField.searchItems, onChange: userKeyField.handleChange, dropdown: true, field: "displayName", className: "w-full" }) }), _jsx("p", { className: "fieldSubTitle", children: "The co-model you have selected does not have a user key specified. Use the above dropdown to choose from one of the \"unique\" fields in this co-model to be set as its userkey. User keys are required in co-models being used in many-to-one or one-to-many relations as in SolidX when a many-to-one field is rendered it uses an autocomplete dropdown, and the user key value is what is displayed as the label in the dropdown." }), isFormFieldValid(formik, "userKey") && (_jsx("p", { className: styles.fieldError, children: (_23 = (_22 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _22 === void 0 ? void 0 : _22.userKey) === null || _23 === void 0 ? void 0 : _23.toString() }))] })), currentFields.includes("relationFieldFixedFilter") && (_jsxs("div", { className: "field col-12 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "relationFieldFixedFilter", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Field Fixed Filter" }), _jsx(SolidTextarea, { "aria-describedby": "Fixed Filter", id: "relationFieldFixedFilter", name: "relationFieldFixedFilter", onChange: formik.handleChange, value: formik.values.relationFieldFixedFilter, rows: 5, cols: 30, className: classNames(styles.fieldTextarea, {
|
|
1540
|
-
"p-invalid": isFormFieldValid(formik, "relationFieldFixedFilter"),
|
|
1541
|
-
}) }), isFormFieldValid(formik, "relationFieldFixedFilter") && (_jsx("p", { className: styles.fieldError, children: (_25 = (_24 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _24 === void 0 ? void 0 : _24.relationFieldFixedFilter) === null || _25 === void 0 ? void 0 : _25.toString() })), _jsx("p", { className: "fieldSubTitle", children: "Many to one fields are rendered as autocomplete dropdown on the SolidX ui. Use the fixed filter to load a pre-filtered set of records from the co-model. Please note user input entered in the autocomplete is used to apply a dynamic filter." })] })), currentFields.includes("relationCreateInverse") && (_jsxs("div", { className: "field col-12 md:col-6 flex flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "relationCreateInverse", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Create Inverse" }), _jsxs("div", { className: "flex align-items-center", children: [_jsx(SolidCheckbox, { id: "relationCreateInverse", name: "relationCreateInverse", checked: formik.values.relationCreateInverse, disabled: formik.values.relationType === "one-to-many", onChange: function (event) { return formik.setFieldValue("relationCreateInverse", event.currentTarget.checked); } }), _jsx("label", { htmlFor: "relationCreateInverse", className: classNames("ml-2", "form-field-label", styles.fieldLabel), children: "Create Inverse" })] }), isFormFieldValid(formik, "relationCreateInverse") && (_jsx("p", { className: styles.fieldError, children: (_27 = (_26 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _26 === void 0 ? void 0 : _26.relationCreateInverse) === null || _27 === void 0 ? void 0 : _27.toString() }))] })), currentFields.includes("relationCoModelFieldName") && formik.values.relationCreateInverse && !formik.values.relationCoModelSingularName && (_jsx("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: _jsx(SolidMessage, { text: "Please select Co-model" }) })), currentFields.includes("relationCoModelFieldName") && formik.values.relationCreateInverse && formik.values.relationCoModelSingularName && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsxs("label", { htmlFor: "relationCoModelFieldName", className: classNames("form-field-label", styles.fieldLabel), children: ["Field Name In ", formik.values.relationCoModelSingularName, " Model"] }), _jsx(SolidInput, { type: "text", id: "relationCoModelFieldName", name: "relationCoModelFieldName", onChange: formik.handleChange, disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, value: formik.values.relationCoModelFieldName, className: classNames(styles.fieldInput, {
|
|
1542
|
-
"p-invalid": isFormFieldValid(formik, "relationCoModelFieldName"),
|
|
1543
|
-
}) }), formik.values.relationType === "one-to-many" &&
|
|
1544
|
-
_jsxs("p", { className: "fieldSubTitle", children: ["This is a field that is created in the child model. In this case a ", _jsx("span", { style: { fontWeight: "700" }, children: (_28 = formik.values.relationCoModelFieldName) !== null && _28 !== void 0 ? _28 : formik.values.relationCoModelSingularName }), " field will be created in the ", formik.values.relationCoModelSingularName, " when setting create inverse true."] }), formik.values.relationType === "many-to-one" &&
|
|
1545
|
-
_jsxs("p", { className: "fieldSubTitle", children: ["This is a field that is created in the parent model. In this case a ", _jsx("span", { style: { fontWeight: "700" }, children: (_29 = formik.values.relationCoModelFieldName) !== null && _29 !== void 0 ? _29 : "".concat(formik.values.relationCoModelSingularName, "s") }), " field will be created in the ", formik.values.relationCoModelSingularName, " when setting create inverse true."] }), formik.values.relationType === "many-to-many" &&
|
|
1546
|
-
_jsxs("p", { className: "fieldSubTitle", children: ["In this case a ", formik.values.relationCoModelFieldName, " field will be created in the ", _jsx("span", { style: { fontWeight: "700" }, children: (_30 = formik.values.relationCoModelSingularName) !== null && _30 !== void 0 ? _30 : '{{}}' }), " when setting create inverse true."] }), isFormFieldValid(formik, "relationCoModelFieldName") && (_jsx("p", { className: styles.fieldError, children: (_32 = (_31 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _31 === void 0 ? void 0 : _31.relationCoModelFieldName) === null || _32 === void 0 ? void 0 : _32.toString() }))] })), currentFields.includes("relationJoinTableName") && formik.values.relationType === "many-to-many" && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "relationJoinTableName", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Join Table Name" }), _jsx(SolidInput, { type: "text", id: "relationJoinTableName", name: "relationJoinTableName", onChange: formik.handleChange, disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, value: formik.values.relationJoinTableName, className: classNames(styles.fieldInput, {
|
|
1547
|
-
"p-invalid": isFormFieldValid(formik, "relationJoinTableName"),
|
|
1548
|
-
}) }), isFormFieldValid(formik, "relationJoinTableName") && (_jsx("p", { className: styles.fieldError, children: (_34 = (_33 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _33 === void 0 ? void 0 : _33.relationJoinTableName) === null || _34 === void 0 ? void 0 : _34.toString() }))] })), currentFields.includes("selectionDynamicProvider") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-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 = {},
|
|
1549
|
-
_g[styles.fieldInvalidControl] = isFormFieldValid(formik, "selectionDynamicProvider"),
|
|
1550
|
-
_g)), children: _jsx(SolidAutocomplete, { value: selectionDynamicProviderField.selectedItem, suggestions: selectionDynamicProviderField.filteredItems, completeMethod: selectionDynamicProviderField.searchItems, onChange: selectionDynamicProviderField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "selectionDynamicProvider") && (_jsx("p", { className: styles.fieldError, children: (_36 = (_35 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _35 === void 0 ? void 0 : _35.selectionDynamicProvider) === null || _36 === void 0 ? void 0 : _36.toString() }))] })), currentFields.includes("selectionValueType") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-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) {
|
|
1454
|
+
}) }) }), (selectedTypeValue === "date" || selectedTypeValue === "datetime" || selectedTypeValue === "time") && (function () {
|
|
1455
|
+
var showTimeSelect = selectedTypeValue === "datetime" || selectedTypeValue === "time";
|
|
1456
|
+
var timeOnly = selectedTypeValue === "time";
|
|
1457
|
+
var dateFormat = selectedTypeValue === "datetime"
|
|
1458
|
+
? "yyyy-MM-dd HH:mm"
|
|
1459
|
+
: timeOnly
|
|
1460
|
+
? "HH:mm"
|
|
1461
|
+
: "yyyy-MM-dd";
|
|
1462
|
+
var timeFormat = "HH:mm";
|
|
1463
|
+
return (_jsx(SolidDatePicker, { id: "defaultValue", selected: formik.values.defaultValue ? new Date(formik.values.defaultValue) : undefined, onChange: function (date) { return formik.setFieldValue("defaultValue", date); }, showTimeSelect: showTimeSelect, timeOnly: timeOnly, dateFormat: dateFormat, timeFormat: timeFormat, inputClassName: classNames({
|
|
1464
|
+
"p-invalid": isFormFieldValid(formik, "defaultValue"),
|
|
1465
|
+
}) }));
|
|
1466
|
+
})(), isFormFieldValid(formik, "defaultValue") && (_jsx("p", { className: styles.fieldError, children: (_3 = (_2 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _2 === void 0 ? void 0 : _2.defaultValue) === null || _3 === void 0 ? void 0 : _3.toString() }))] })), currentFields.includes("mediaTypes") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2", children: [_jsx("label", { htmlFor: "mediaTypes", className: classNames("form-field-label", styles.fieldLabel), children: "Media Type" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_b = {},
|
|
1467
|
+
_b[styles.fieldInvalidControl] = isFormFieldValid(formik, "mediaTypes"),
|
|
1468
|
+
_b)), children: _jsx(SolidAutocomplete, { multiple: true, dropdown: true, field: "label", value: mediaTypeSelectedItems, suggestions: filteredMediaTypes, completeMethod: handleMediaTypesSearch, maxVisibleChips: 3, onChange: function (_a) {
|
|
1551
1469
|
var value = _a.value;
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1470
|
+
var selection = Array.isArray(value) ? value : [];
|
|
1471
|
+
var normalizedValues = selection
|
|
1472
|
+
.map(function (item) {
|
|
1473
|
+
if (item && typeof item === "object") {
|
|
1474
|
+
if (item.value)
|
|
1475
|
+
return item.value;
|
|
1476
|
+
if (item.label)
|
|
1477
|
+
return item.label;
|
|
1478
|
+
}
|
|
1479
|
+
return item !== null && item !== void 0 ? item : null;
|
|
1480
|
+
})
|
|
1481
|
+
.filter(Boolean);
|
|
1482
|
+
formik.setFieldValue("mediaTypes", normalizedValues);
|
|
1483
|
+
}, placeholder: "Select media types", className: "w-full" }) }), isFormFieldValid(formik, "mediaTypes") && (_jsx("p", { className: styles.fieldError, children: (_5 = (_4 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _4 === void 0 ? void 0 : _4.mediaTypes) === null || _5 === void 0 ? void 0 : _5.toString() }))] })), currentFields.includes("mediaMaxSizeKb") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2 md:mt-0", children: [_jsx("label", { htmlFor: "mediaMaxSizeKb", className: classNames("form-field-label", styles.fieldLabel), children: "Media Max Size (Mb)" }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "mediaMaxSizeKb", name: "mediaMaxSizeKb", value: formik.values.mediaMaxSizeKb, onChange: function (event) { return formik.setFieldValue("mediaMaxSizeKb", event.value); }, className: classNames({
|
|
1484
|
+
"p-invalid": isFormFieldValid(formik, "mediaMaxSizeKb"),
|
|
1485
|
+
}) }) }), isFormFieldValid(formik, "mediaMaxSizeKb") && (_jsx("p", { className: styles.fieldError, children: (_7 = (_6 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _6 === void 0 ? void 0 : _6.mediaMaxSizeKb) === null || _7 === void 0 ? void 0 : _7.toString() }))] })), currentFields.includes("mediaStorageProviderId") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "mediaStorageProviderId", className: classNames("form-field-label", styles.fieldLabel), children: "Media Storage Provider" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_c = {},
|
|
1486
|
+
_c[styles.fieldInvalidControl] = isFormFieldValid(formik, "mediaStorageProvider"),
|
|
1487
|
+
_c)), children: _jsx(SolidAutocomplete, { value: mediaStorageProviderField.selectedItem, suggestions: mediaStorageProviderField.filteredItems, completeMethod: mediaStorageProviderField.searchItems, onChange: mediaStorageProviderField.handleChange, dropdown: true, field: "name", className: "w-full" }) }), isFormFieldValid(formik, "mediaStorageProvider") && (_jsx("p", { className: styles.fieldError, children: (_9 = (_8 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _8 === void 0 ? void 0 : _8.mediaStorageProviderId) === null || _9 === void 0 ? void 0 : _9.toString() }))] })), currentFields.includes("mediaEmbedded") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "mediaEmbedded", className: classNames("form-field-label", styles.fieldLabel), children: "Media Embedded" }), _jsx(SolidSegmentedControl, { value: resolveBooleanOptionValue(formik.values.mediaEmbedded), onChange: function (value) {
|
|
1488
|
+
formik.setFieldValue("mediaEmbedded", value);
|
|
1489
|
+
}, options: booleanSegmentedOptions, className: classNames("", {
|
|
1490
|
+
"p-invalid": isFormFieldValid(formik, "mediaEmbedded"),
|
|
1491
|
+
}) }), isFormFieldValid(formik, "mediaEmbedded") && (_jsx("p", { className: styles.fieldError, children: (_11 = (_10 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _10 === void 0 ? void 0 : _10.mediaEmbedded) === null || _11 === void 0 ? void 0 : _11.toString() }))] })), currentFields.includes("relationType") && (_jsxs("div", { className: "field col-12 flex gap-2 mt-1 align-items-center", children: [_jsx("label", { style: { marginBottom: "0px" }, htmlFor: "relationType", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Type" }), _jsx(SolidSegmentedControl, { value: formik.values.relationType, options: fieldDefaultMetaData.data.relationTypes, onChange: function (value) {
|
|
1492
|
+
formik.setFieldValue("relationType", value);
|
|
1493
|
+
if (value === "one-to-many") {
|
|
1494
|
+
formik.setFieldValue("relationCreateInverse", true);
|
|
1495
|
+
}
|
|
1496
|
+
}, className: classNames("", {
|
|
1497
|
+
"p-invalid": isFormFieldValid(formik, "relationType"),
|
|
1498
|
+
}) }), isFormFieldValid(formik, "relationType") && (_jsx("p", { className: styles.fieldError, children: (_13 = (_12 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _12 === void 0 ? void 0 : _12.relationType) === null || _13 === void 0 ? void 0 : _13.toString() }))] })), currentFields.includes("relationType") && (formik.values.relationType === "many-to-one" || formik.values.relationType === "one-to-many") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "relationCascade", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Cascade" }), _jsx(SolidSelect, { value: formik.values.relationCascade, options: fieldDefaultMetaData.data.cascadeTypes, optionLabel: "label", optionValue: "value", onChange: function (_a) {
|
|
1499
|
+
var value = _a.value;
|
|
1500
|
+
return formik.setFieldValue("relationCascade", value);
|
|
1501
|
+
}, placeholder: "Cascade", className: classNames("w-full", {
|
|
1502
|
+
"p-invalid": isFormFieldValid(formik, "relationCascade"),
|
|
1503
|
+
}) }), isFormFieldValid(formik, "relationCascade") && (_jsx("p", { className: styles.fieldError, children: (_15 = (_14 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _14 === void 0 ? void 0 : _14.relationCascade) === null || _15 === void 0 ? void 0 : _15.toString() }))] })), currentFields.includes("relationModelModuleName") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-1", children: [_jsx("label", { htmlFor: "relationModelModuleName", className: classNames("form-field-label", styles.fieldLabel), children: "Co-Module Name" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_d = {},
|
|
1504
|
+
_d[styles.fieldInvalidControl] = isFormFieldValid(formik, "relationModelModuleName"),
|
|
1505
|
+
_d)), children: _jsx(SolidAutocomplete, { value: relationModelModuleField.selectedItem, suggestions: relationModelModuleField.filteredItems, completeMethod: relationModelModuleField.searchItems, onChange: relationModelModuleField.handleChange, dropdown: true, field: "name", className: "w-full" }) }), isFormFieldValid(formik, "relationModelModuleName") && (_jsx("p", { className: styles.fieldError, children: (_17 = (_16 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _16 === void 0 ? void 0 : _16.relationModelModuleName) === null || _17 === void 0 ? void 0 : _17.toString() }))] })), currentFields.includes("relationCoModelSingularName") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "relationCoModelSingularName", className: classNames("form-field-label", styles.fieldLabel), children: "Co-Model Name" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_e = {},
|
|
1506
|
+
_e[styles.fieldInvalidControl] = isFormFieldValid(formik, "relationCoModelSingularName"),
|
|
1507
|
+
_e)), children: _jsx(SolidAutocomplete, { value: relationCoModelField.selectedItem, suggestions: relationCoModelField.filteredItems, completeMethod: relationCoModelField.searchItems, onChange: relationCoModelField.handleChange, dropdown: true, field: "displayName", className: "w-full" }) }), isFormFieldValid(formik, "relationCoModelSingularName") && (_jsx("p", { className: styles.fieldError, children: (_19 = (_18 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _18 === void 0 ? void 0 : _18.relationCoModelSingularName) === null || _19 === void 0 ? void 0 : _19.toString() })), formik.values.relationType === "one-to-many" &&
|
|
1508
|
+
_jsx("p", { className: "fieldSubTitle", children: "This is the child model." }), formik.values.relationType === "many-to-one" &&
|
|
1509
|
+
_jsx("p", { className: "fieldSubTitle", children: "This is the parent model." })] })), currentFields.includes("relationCoModelColumnName") && (formik.values.relationType === "many-to-many" || formik.values.relationType === "many-to-one") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "relationCoModelColumnName", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Co-Model Column Name" }), _jsx(SolidInput, { type: "text", id: "relationCoModelColumnName", name: "relationCoModelColumnName", onChange: formik.handleChange, disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, value: formik.values.relationCoModelColumnName, className: classNames(styles.fieldInput, {
|
|
1510
|
+
"p-invalid": isFormFieldValid(formik, "relationCoModelColumnName"),
|
|
1511
|
+
}) }), isFormFieldValid(formik, "relationCoModelColumnName") && (_jsx("p", { className: styles.fieldError, children: (_21 = (_20 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _20 === void 0 ? void 0 : _20.relationCoModelColumnName) === null || _21 === void 0 ? void 0 : _21.toString() })), _jsx("p", { className: "fieldSubTitle", children: "Allows you to control the column name of the foreign key. Eg. when adding a country field to state model, by default foreign key column in the state table will be called country_id, use this field to create a foreign key with a different name. " })] })), askForUserKeyField && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "userKey", className: classNames("form-field-label", styles.fieldLabel), children: "Set User Key" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_f = {},
|
|
1512
|
+
_f[styles.fieldInvalidControl] = isFormFieldValid(formik, "userKey"),
|
|
1513
|
+
_f)), children: _jsx(SolidAutocomplete, { value: userKeyField.selectedItem, suggestions: userKeyField.filteredItems, completeMethod: userKeyField.searchItems, onChange: userKeyField.handleChange, dropdown: true, field: "displayName", className: "w-full" }) }), _jsx("p", { className: "fieldSubTitle", children: "The co-model you have selected does not have a user key specified. Use the above dropdown to choose from one of the \"unique\" fields in this co-model to be set as its userkey. User keys are required in co-models being used in many-to-one or one-to-many relations as in SolidX when a many-to-one field is rendered it uses an autocomplete dropdown, and the user key value is what is displayed as the label in the dropdown." }), isFormFieldValid(formik, "userKey") && (_jsx("p", { className: styles.fieldError, children: (_23 = (_22 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _22 === void 0 ? void 0 : _22.userKey) === null || _23 === void 0 ? void 0 : _23.toString() }))] })), currentFields.includes("relationFieldFixedFilter") && (_jsxs("div", { className: "field col-12 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "relationFieldFixedFilter", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Field Fixed Filter" }), _jsx(SolidTextarea, { "aria-describedby": "Fixed Filter", id: "relationFieldFixedFilter", name: "relationFieldFixedFilter", onChange: formik.handleChange, value: formik.values.relationFieldFixedFilter, rows: 5, cols: 30, className: classNames(styles.fieldTextarea, {
|
|
1514
|
+
"p-invalid": isFormFieldValid(formik, "relationFieldFixedFilter"),
|
|
1515
|
+
}) }), isFormFieldValid(formik, "relationFieldFixedFilter") && (_jsx("p", { className: styles.fieldError, children: (_25 = (_24 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _24 === void 0 ? void 0 : _24.relationFieldFixedFilter) === null || _25 === void 0 ? void 0 : _25.toString() })), _jsx("p", { className: "fieldSubTitle", children: "Many to one fields are rendered as autocomplete dropdown on the SolidX ui. Use the fixed filter to load a pre-filtered set of records from the co-model. Please note user input entered in the autocomplete is used to apply a dynamic filter." })] })), currentFields.includes("relationCreateInverse") && (_jsxs("div", { className: "field col-12 md:col-6 flex flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "relationCreateInverse", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Create Inverse" }), _jsxs("div", { className: "flex align-items-center", children: [_jsx(SolidCheckbox, { id: "relationCreateInverse", name: "relationCreateInverse", checked: formik.values.relationCreateInverse, disabled: formik.values.relationType === "one-to-many", onChange: function (event) { return formik.setFieldValue("relationCreateInverse", event.currentTarget.checked); } }), _jsx("label", { htmlFor: "relationCreateInverse", className: classNames("ml-2", "form-field-label", styles.fieldLabel), children: "Create Inverse" })] }), isFormFieldValid(formik, "relationCreateInverse") && (_jsx("p", { className: styles.fieldError, children: (_27 = (_26 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _26 === void 0 ? void 0 : _26.relationCreateInverse) === null || _27 === void 0 ? void 0 : _27.toString() }))] })), currentFields.includes("relationCoModelFieldName") && formik.values.relationCreateInverse && !formik.values.relationCoModelSingularName && (_jsx("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: _jsx(SolidMessage, { text: "Please select Co-model" }) })), currentFields.includes("relationCoModelFieldName") && formik.values.relationCreateInverse && formik.values.relationCoModelSingularName && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsxs("label", { htmlFor: "relationCoModelFieldName", className: classNames("form-field-label", styles.fieldLabel), children: ["Field Name In ", formik.values.relationCoModelSingularName, " Model"] }), _jsx(SolidInput, { type: "text", id: "relationCoModelFieldName", name: "relationCoModelFieldName", onChange: formik.handleChange, disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, value: formik.values.relationCoModelFieldName, className: classNames(styles.fieldInput, {
|
|
1516
|
+
"p-invalid": isFormFieldValid(formik, "relationCoModelFieldName"),
|
|
1517
|
+
}) }), formik.values.relationType === "one-to-many" &&
|
|
1518
|
+
_jsxs("p", { className: "fieldSubTitle", children: ["This is a field that is created in the child model. In this case a ", _jsx("span", { style: { fontWeight: "700" }, children: (_28 = formik.values.relationCoModelFieldName) !== null && _28 !== void 0 ? _28 : formik.values.relationCoModelSingularName }), " field will be created in the ", formik.values.relationCoModelSingularName, " when setting create inverse true."] }), formik.values.relationType === "many-to-one" &&
|
|
1519
|
+
_jsxs("p", { className: "fieldSubTitle", children: ["This is a field that is created in the parent model. In this case a ", _jsx("span", { style: { fontWeight: "700" }, children: (_29 = formik.values.relationCoModelFieldName) !== null && _29 !== void 0 ? _29 : "".concat(formik.values.relationCoModelSingularName, "s") }), " field will be created in the ", formik.values.relationCoModelSingularName, " when setting create inverse true."] }), formik.values.relationType === "many-to-many" &&
|
|
1520
|
+
_jsxs("p", { className: "fieldSubTitle", children: ["In this case a ", formik.values.relationCoModelFieldName, " field will be created in the ", _jsx("span", { style: { fontWeight: "700" }, children: (_30 = formik.values.relationCoModelSingularName) !== null && _30 !== void 0 ? _30 : '{{}}' }), " when setting create inverse true."] }), isFormFieldValid(formik, "relationCoModelFieldName") && (_jsx("p", { className: styles.fieldError, children: (_32 = (_31 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _31 === void 0 ? void 0 : _31.relationCoModelFieldName) === null || _32 === void 0 ? void 0 : _32.toString() }))] })), currentFields.includes("relationJoinTableName") && formik.values.relationType === "many-to-many" && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "relationJoinTableName", className: classNames("form-field-label", styles.fieldLabel), children: "Relation Join Table Name" }), _jsx(SolidInput, { type: "text", id: "relationJoinTableName", name: "relationJoinTableName", onChange: formik.handleChange, disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id, value: formik.values.relationJoinTableName, className: classNames(styles.fieldInput, {
|
|
1521
|
+
"p-invalid": isFormFieldValid(formik, "relationJoinTableName"),
|
|
1522
|
+
}) }), isFormFieldValid(formik, "relationJoinTableName") && (_jsx("p", { className: styles.fieldError, children: (_34 = (_33 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _33 === void 0 ? void 0 : _33.relationJoinTableName) === null || _34 === void 0 ? void 0 : _34.toString() }))] })), currentFields.includes("selectionDynamicProvider") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "selectionDynamicProvider", className: classNames("form-field-label", styles.fieldLabel), children: "Selection Dynamic Provider" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_g = {},
|
|
1523
|
+
_g[styles.fieldInvalidControl] = isFormFieldValid(formik, "selectionDynamicProvider"),
|
|
1524
|
+
_g)), children: _jsx(SolidAutocomplete, { value: selectionDynamicProviderField.selectedItem, suggestions: selectionDynamicProviderField.filteredItems, completeMethod: selectionDynamicProviderField.searchItems, onChange: selectionDynamicProviderField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "selectionDynamicProvider") && (_jsx("p", { className: styles.fieldError, children: (_36 = (_35 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _35 === void 0 ? void 0 : _35.selectionDynamicProvider) === null || _36 === void 0 ? void 0 : _36.toString() }))] })), currentFields.includes("selectionValueType") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "selectionValueType", className: classNames("form-field-label", styles.fieldLabel), children: "Select Value Type" }), _jsx(SolidSelect, { value: formik.values.selectionValueType, options: selctionValueTypes, optionLabel: "label", optionValue: "value", onChange: function (_a) {
|
|
1525
|
+
var value = _a.value;
|
|
1526
|
+
return formik.setFieldValue("selectionValueType", value);
|
|
1527
|
+
}, placeholder: "Select Value Type", className: classNames("w-full", {
|
|
1528
|
+
"p-invalid": isFormFieldValid(formik, "selectionValueType"),
|
|
1529
|
+
}) }), isFormFieldValid(formik, "selectionValueType") && (_jsx("p", { className: styles.fieldError, children: (_38 = (_37 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _37 === void 0 ? void 0 : _37.selectionValueType) === null || _38 === void 0 ? void 0 : _38.toString() }))] })), currentFields.includes("selectionStaticValues") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "selectionStaticValues", className: classNames("form-field-label", styles.fieldLabel), children: "Selection Static Values" }), formik.values.selectionStaticValues.map(function (enumValue, index) { return (_jsx(SelectionStaticValues, { enumValue: enumValue, onUpdate: function (updatedString) { return updateEnumValues(index, updatedString); }, onDelete: function () { return deleteEnumValue(index); }, onAdd: addEnumValue }, index)); }), isFormFieldValid(formik, "selectionStaticValues") && (_jsx("p", { className: styles.fieldError, children: (_40 = (_39 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _39 === void 0 ? void 0 : _39.selectionStaticValues) === null || _40 === void 0 ? void 0 : _40.toString() }))] })), currentFields.includes("computedFieldValueType") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "computedFieldValueType", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Value Type" }), _jsx(SolidAutocomplete, { value: selectedComputedFieldValueType, suggestions: filteredComputedFieldValueTypes, completeMethod: searchComputedFieldValueType, field: "label", dropdown: true, className: classNames("solid-standard-autocomplete", (_h = {},
|
|
1530
|
+
_h[styles.fieldInvalidControl] = isFormFieldValid(formik, "computedFieldValueType"),
|
|
1531
|
+
_h)), onChange: function (e) {
|
|
1532
|
+
setSelectedComputedFieldValueType(e.value);
|
|
1533
|
+
formik.setFieldValue("computedFieldValueType", e.value.value);
|
|
1534
|
+
} }), isFormFieldValid(formik, "computedFieldValueType") && (_jsx("p", { className: styles.fieldError, children: (_42 = (_41 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _41 === void 0 ? void 0 : _41.computedFieldValueType) === null || _42 === void 0 ? void 0 : _42.toString() }))] })), currentFields.includes("computedFieldValueProvider") && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "computedFieldValueProvider", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Provider" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_j = {},
|
|
1535
|
+
_j[styles.fieldInvalidControl] = isFormFieldValid(formik, "computedFieldValueProvider"),
|
|
1536
|
+
_j)), children: _jsx(SolidAutocomplete, { value: computedFieldValueProviderField.selectedItem, suggestions: computedFieldValueProviderField.filteredItems, completeMethod: computedFieldValueProviderField.searchItems, onChange: computedFieldValueProviderField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "computedFieldValueProvider") && (_jsx("p", { className: styles.fieldError, children: (_44 = (_43 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _43 === void 0 ? void 0 : _43.computedFieldValueProvider) === null || _44 === void 0 ? void 0 : _44.toString() }))] })), currentFields.includes("computedFieldTriggerConfig") && (_jsxs("div", { className: "field col-12 flex-flex-column gap-2 mt-2", children: [(fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.computedFieldTriggerConfig) === null
|
|
1537
|
+
&&
|
|
1538
|
+
_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 align-items-center gap-2", children: [_jsx("label", { htmlFor: "computedFieldTriggerConfig", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Trigger Config" }), _jsx("div", { children: _jsx(SolidButton, { icon: "si si-plus", size: "small", onClick: handleAdd, type: "button", className: "ml-2" }) })] }), formik.values.computedFieldTriggerConfig.map(function (row, index) {
|
|
1539
|
+
var _a;
|
|
1540
|
+
return (_jsx(SelectComputedFieldTriggerValues, { index: index, row: row, onChange: handleChange, onDelete: handleDelete, isLastRow: index === formik.values.computedFieldTriggerConfig.length - 1, disableDelete: formik.values.computedFieldTriggerConfig.length === 1, formik: formik, isFormFieldValid: isFormFieldValid, searchModuleName: searchModuleName, searchModelName: computedFieldSearchHandlers[index], modelMetaData: modelMetaData, errors: (_a = formik.errors.computedFieldTriggerConfig) === null || _a === void 0 ? void 0 : _a[index] }, index));
|
|
1541
|
+
}), typeof formik.errors.computedFieldTriggerConfig === 'string' && (_jsx("p", { className: styles.fieldError, children: formik.errors.computedFieldTriggerConfig }))] })), currentFields.includes("selectionDynamicProviderCtxt") && (_jsxs("div", { className: "field col-12 flex-flex-column gap-2 mt-4", children: [_jsx("label", { htmlFor: "selectionDynamicProviderCtxt", className: classNames("form-field-label", styles.fieldLabel), children: "Selection Dynamic Provider Context" }), _jsx(SolidCodeEditor, { value: (_45 = formik.values.selectionDynamicProviderCtxt) !== null && _45 !== void 0 ? _45 : "", onChange: function (value) {
|
|
1542
|
+
formik.setFieldValue("selectionDynamicProviderCtxt", value !== null && value !== void 0 ? value : "");
|
|
1543
|
+
}, language: "json", height: "300px" }), _jsx("div", { className: " form-field-label mt-2", children: markdownText }), isFormFieldValid(formik, "selectionDynamicProviderCtxt") && (_jsx("p", { className: styles.fieldError, children: (_47 = (_46 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _46 === void 0 ? void 0 : _46.selectionDynamicProviderCtxt) === null || _47 === void 0 ? void 0 : _47.toString() }))] })), currentFields.includes("computedFieldValueProviderCtxt") && (_jsxs("div", { className: "field col-12 flex-flex-column gap-2 mt-4", children: [_jsx("label", { htmlFor: "computedFieldValueProviderCtxt", className: classNames("form-field-label", styles.fieldLabel), children: "Computed Field Value Provider Context" }), _jsx(SolidCodeEditor, { value: (_48 = formik.values.computedFieldValueProviderCtxt) !== null && _48 !== void 0 ? _48 : "", onChange: function (value) {
|
|
1544
|
+
formik.setFieldValue("computedFieldValueProviderCtxt", value !== null && value !== void 0 ? value : "");
|
|
1545
|
+
}, language: "json", height: "300px" }), _jsx("div", { className: "form-field-label mt-4", children: markdownText }), isFormFieldValid(formik, "computedFieldValueProviderCtxt") && (_jsx("p", { className: styles.fieldError, children: (_50 = (_49 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _49 === void 0 ? void 0 : _49.computedFieldValueProviderCtxt) === null || _50 === void 0 ? void 0 : _50.toString() }))] }))] })), showValidationSection && (_jsxs(_Fragment, { children: [_jsx("p", { className: "form-wrapper-heading", children: "Validations" }), _jsxs("div", { className: "formgrid grid", children: [(showRegexFields && selectedTypeValue === "password") &&
|
|
1546
|
+
_jsx(_Fragment, { children: _jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "regexPattern", className: classNames("form-field-label", styles.fieldLabel), children: "Password Policy" }), _jsx(SolidSelect, { value: selectedPasswordPolicy, options: passwordPolicyOptions, optionLabel: "label", optionValue: "value", onChange: function (_a) {
|
|
1547
|
+
var value = _a.value;
|
|
1548
|
+
setSelectedPasswordPolicy(value);
|
|
1549
|
+
if (value !== "custom") {
|
|
1550
|
+
formik.setFieldValue("regexPattern", value);
|
|
1610
1551
|
}
|
|
1611
|
-
}
|
|
1612
|
-
|
|
1613
|
-
formik.
|
|
1614
|
-
|
|
1615
|
-
formik
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1552
|
+
}, placeholder: "Select a Password Policy", className: "w-full" })] }) }), showRegexFields && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "regexPattern", className: classNames("form-field-label", styles.fieldLabel), children: "Regex Pattern" }), _jsx(SolidInput, { type: "text", id: "regexPattern", name: "regexPattern", onChange: formik.handleChange, value: formik.values.regexPattern, className: classNames(styles.fieldInput, {
|
|
1553
|
+
"p-invalid": isFormFieldValid(formik, "regexPattern"),
|
|
1554
|
+
}) }), isFormFieldValid(formik, "regexPattern") && (_jsx("p", { className: styles.fieldError, children: (_52 = (_51 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _51 === void 0 ? void 0 : _51.regexPattern) === null || _52 === void 0 ? void 0 : _52.toString() }))] }), showRegexFields && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2 mb-3 md:mb-3", children: [_jsx("label", { htmlFor: "regexPatternNotMatchingErrorMsg", className: classNames("form-field-label", styles.fieldLabel), children: "Regex Pattern Not Matching Error Msg" }), _jsx(SolidInput, { type: "text", id: "regexPatternNotMatchingErrorMsg", name: "regexPatternNotMatchingErrorMsg", onChange: formik.handleChange, value: formik.values.regexPatternNotMatchingErrorMsg, className: classNames(styles.fieldInput, {
|
|
1555
|
+
"p-invalid": isFormFieldValid(formik, "regexPatternNotMatchingErrorMsg"),
|
|
1556
|
+
}) }), isFormFieldValid(formik, "regexPatternNotMatchingErrorMsg") && (_jsx("p", { className: styles.fieldError, children: (_54 = (_53 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _53 === void 0 ? void 0 : _53.regexPatternNotMatchingErrorMsg) === null || _54 === void 0 ? void 0 : _54.toString() }))] }))] })), (showMinFields || showMaxFields) &&
|
|
1557
|
+
_jsxs(_Fragment, { children: [showMinFields && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsxs("label", { htmlFor: "min", className: classNames("form-field-label", styles.fieldLabel), children: ["Min ", (selectedTypeValue !== "int" && selectedTypeValue !== "decimal") && "(Characters Allowed)"] }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "min", name: "min", step: "0.00001", value: formik.values.min, onChange: function (event) { return formik.setFieldValue("min", event.value); }, className: classNames({
|
|
1558
|
+
"p-invalid": isFormFieldValid(formik, "min"),
|
|
1559
|
+
}), disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id }) }), isFormFieldValid(formik, "min") && (_jsx("p", { className: styles.fieldError, children: (_56 = (_55 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _55 === void 0 ? void 0 : _55.min) === null || _56 === void 0 ? void 0 : _56.toString() }))] })), showMaxFields && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsxs("label", { htmlFor: "max", className: classNames("form-field-label", styles.fieldLabel), children: ["Max ", (selectedTypeValue !== "int" &&
|
|
1560
|
+
selectedTypeValue !== "decimal") && "(Characters allowed)"] }), _jsx("div", { className: styles.fieldNumberWrapper, children: _jsx(SolidNumberInput, { id: "max", name: "max", step: "0.00001", value: formik.values.max, onChange: function (event) { return formik.setFieldValue("max", event.value); }, className: classNames({
|
|
1561
|
+
"p-invalid": isFormFieldValid(formik, "max"),
|
|
1562
|
+
}), disabled: fieldMetaData === null || fieldMetaData === void 0 ? void 0 : fieldMetaData.id }) }), isFormFieldValid(formik, "max") && (_jsx("p", { className: styles.fieldError, children: (_58 = (_57 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _57 === void 0 ? void 0 : _57.max) === null || _58 === void 0 ? void 0 : _58.toString() }))] }))] }), showOrmOptions && (_jsxs("div", { className: "field col-12 md:col-6 flex-flex-column gap-2 mt-2", children: [_jsx("label", { htmlFor: "ormType", className: classNames("form-field-label", styles.fieldLabel), children: "Type" }), _jsx(SolidRadioGroup, { name: "ormType", value: selectedOrmType, onChange: function (value) {
|
|
1563
|
+
formik.setFieldValue("ormType", value);
|
|
1564
|
+
setSelectedOrmType(value);
|
|
1565
|
+
}, options: (ormTypeOptions || []).map(function (ormType) { return ({
|
|
1566
|
+
value: ormType.label,
|
|
1567
|
+
label: (_jsxs("span", { className: classNames("ml-2", "form-field-label"), children: [ormType.label, _jsx("br", {}), _jsx("span", { className: "fieldSubTitle mt-0", children: "(".concat(ormType.description, ")") })] })),
|
|
1568
|
+
}); }), className: "ormTypeflex", itemClassName: "mr-3 align-items-center" }), isFormFieldValid(formik, "ormType") && (_jsx("p", { className: styles.fieldError, children: (_60 = (_59 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _59 === void 0 ? void 0 : _59.ormType) === null || _60 === void 0 ? void 0 : _60.toString() }))] }))] })] })), (formik.values.relationType !== "many-to-many" && formik.values.relationType !== "one-to-many") && _jsx("p", { className: "form-wrapper-heading", children: "Settings" }), _jsxs("div", { className: "formgrid grid mt-1 md:mt-0", children: [currentFields.includes("required") && (formik.values.relationType !== "many-to-many" && formik.values.relationType !== "one-to-many") && (_jsxs("div", { className: "field col-6 flex-flex-column gap-2 mt-2", children: [_jsxs("div", { className: "flex align-items-center", children: [_jsx(SolidCheckbox, { id: "required", name: "required", onChange: function (event) {
|
|
1569
|
+
if (!formik.values.isPrimaryKey && !formik.values.unique) {
|
|
1570
|
+
formik.setFieldValue("required", event.currentTarget.checked);
|
|
1571
|
+
}
|
|
1572
|
+
}, checked: formik.values.required, disabled: formik.values.isPrimaryKey || formik.values.unique }), _jsxs("label", { htmlFor: "required", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: ["Required ", formik.values.isPrimaryKey && "(Auto-enabled for Primary Key)", !formik.values.isPrimaryKey && formik.values.unique && "(Auto-enabled for Unique)"] })] }), _jsx("p", { className: "text-xs mt-2", children: "You won't be able to create an entry if this field is empty" }), isFormFieldValid(formik, "required") && (_jsx("p", { className: styles.fieldError, children: (_62 = (_61 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _61 === void 0 ? void 0 : _61.required) === null || _62 === void 0 ? void 0 : _62.toString() }))] })), currentFields.includes("unique") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field col-6 flex-flex-column gap-2", children: [_jsxs("div", { className: "flex align-items-center", children: [_jsx(SolidCheckbox, { id: "unique", name: "unique", onChange: function (event) {
|
|
1573
|
+
// Prevent unchecking if isPrimaryKey is true
|
|
1574
|
+
if (!formik.values.isPrimaryKey) {
|
|
1575
|
+
var nextValue = event.currentTarget.checked;
|
|
1576
|
+
formik.setFieldValue("unique", nextValue);
|
|
1577
|
+
formik.setFieldValue("isUserKey", false);
|
|
1578
|
+
// Auto-enable required when unique is checked
|
|
1579
|
+
if (nextValue) {
|
|
1630
1580
|
formik.setFieldValue("required", true);
|
|
1631
|
-
formik.setFieldValue("unique", true);
|
|
1632
1581
|
}
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1582
|
+
else {
|
|
1583
|
+
formik.setFieldValue("required", false);
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
}, checked: formik.values.unique, disabled: formik.values.isPrimaryKey }), _jsxs("label", { htmlFor: "unique", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: ["Unique ", formik.values.isPrimaryKey && "(Auto-enabled for Primary Key)"] })] }), _jsx("p", { className: "text-xs mt-2", children: "You won't be able to create an entry if there is an existing entry with identical content" }), isFormFieldValid(formik, "unique") && (_jsx("p", { className: styles.fieldError, children: (_64 = (_63 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _63 === void 0 ? void 0 : _63.unique) === null || _64 === void 0 ? void 0 : _64.toString() }))] })), currentFields.includes("index") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field col-6 flex-flex-column gap-2 mt-2", children: [_jsxs("div", { className: "flex align-items-center", children: [_jsx(SolidCheckbox, { id: "index", name: "index", onChange: function (event) {
|
|
1587
|
+
formik.setFieldValue("index", event.currentTarget.checked);
|
|
1588
|
+
}, checked: formik.values.index }), _jsx("label", { htmlFor: "index", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: "Index" })] }), isFormFieldValid(formik, "index") && (_jsx("p", { className: styles.fieldError, children: (_66 = (_65 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _65 === void 0 ? void 0 : _65.index) === null || _66 === void 0 ? void 0 : _66.toString() }))] })), currentFields.includes("private") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field col-6 flex-flex-column gap-2 mt-2", children: [_jsxs("div", { className: "flex align-items-center", children: [_jsx(SolidCheckbox, { id: "private", name: "private", onChange: function (event) {
|
|
1589
|
+
formik.setFieldValue("private", event.currentTarget.checked);
|
|
1590
|
+
}, checked: formik.values.private }), _jsx("label", { htmlFor: "private", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: "Private" })] }), _jsx("p", { className: "text-xs mt-2", children: "This field will not show up in the API response" }), isFormFieldValid(formik, "private") && (_jsx("p", { className: styles.fieldError, children: (_68 = (_67 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _67 === void 0 ? void 0 : _67.private) === null || _68 === void 0 ? void 0 : _68.toString() }))] })), currentFields.includes("encrypt") && selectedTypeValue !== 'relation' && (_jsxs("div", { className: "field col-6 flex-flex-column gap-2 mt-2", children: [_jsxs("div", { className: "flex align-items-center gap-2", children: [_jsx(SolidCheckbox, { id: "encrypt", name: "encrypt", onChange: function (event) {
|
|
1591
|
+
formik.setFieldValue("encrypt", event.currentTarget.checked);
|
|
1592
|
+
setEncryptState(event.currentTarget.checked);
|
|
1593
|
+
}, checked: formik.values.encrypt }), _jsx("label", { htmlFor: "encrypt", className: classNames("form-field-label", styles.fieldLabel), children: "Encrypt" })] }), isFormFieldValid(formik, "encrypt") && (_jsx("p", { className: styles.fieldError, children: (_70 = (_69 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _69 === void 0 ? void 0 : _69.encrypt) === null || _70 === void 0 ? void 0 : _70.toString() }))] })), currentFields.includes("isMultiSelect") && (_jsxs("div", { className: "field col-6 flex-flex-column gap-2 mt-2", children: [_jsxs("div", { className: "flex align-items-center", children: [_jsx(SolidCheckbox, { id: "isMultiSelect", name: "isMultiSelect", onChange: function (event) {
|
|
1594
|
+
formik.setFieldValue("isMultiSelect", event.currentTarget.checked);
|
|
1595
|
+
}, checked: formik.values.isMultiSelect }), _jsx("label", { htmlFor: "isMultiSelect", className: classNames("form-field-label", styles.fieldLabel, "ml-2"), children: "Is MultiSelect" })] }), isFormFieldValid(formik, "isMultiSelect") && (_jsx("p", { className: styles.fieldError, children: (_72 = (_71 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _71 === void 0 ? void 0 : _71.isMultiSelect) === null || _72 === void 0 ? void 0 : _72.toString() }))] })), currentFields.includes("enableAuditTracking") && formik.values.relationType !== "one-to-many" && (_jsxs("div", { className: "field col-6 flex-flex-column gap-2 mt-2", children: [_jsxs("div", { className: "flex align-items-center gap-2", children: [_jsx(SolidCheckbox, { id: "enableAuditTracking", name: "enableAuditTracking", onChange: function (event) {
|
|
1596
|
+
formik.setFieldValue("enableAuditTracking", event.currentTarget.checked);
|
|
1597
|
+
}, checked: formik.values.enableAuditTracking }), _jsx("label", { htmlFor: "enableAuditTracking", className: classNames("form-field-label", styles.fieldLabel), children: "Enable Audit Tracking" })] }), _jsx("p", { className: "fieldSubTitle", children: "By selecting this option, you are setting audit trail for this field." }), isFormFieldValid(formik, "enableAuditTracking") && (_jsx("p", { className: styles.fieldError, children: (_74 = (_73 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _73 === void 0 ? void 0 : _73.enableAuditTracking) === null || _74 === void 0 ? void 0 : _74.toString() }))] })), currentFields.includes("isUserKey") && formik.values.unique && (_jsxs("div", { className: "field col-6 flex-flex-column gap-2 mt-2", children: [_jsxs("div", { className: "flex align-items-center gap-2", children: [_jsx(SolidCheckbox, { id: "isUserKey", name: "isUserKey", onChange: function (event) {
|
|
1598
|
+
formik.setFieldValue("isUserKey", event.currentTarget.checked);
|
|
1599
|
+
}, checked: formik.values.isUserKey }), _jsx("label", { htmlFor: "isUserKey", className: classNames("form-field-label", styles.fieldLabel), children: "Is Userkey" })] }), _jsx("p", { className: "fieldSubTitle", children: "By selecting this option, you are setting this field as the model's user key. Any existing user key configuration will be overwritten" }), isFormFieldValid(formik, "isUserKey") && (_jsx("p", { className: styles.fieldError, children: (_76 = (_75 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _75 === void 0 ? void 0 : _75.isUserKey) === null || _76 === void 0 ? void 0 : _76.toString() }))] })), currentFields.includes("isPrimaryKey") && (modelMetaData === null || modelMetaData === void 0 ? void 0 : modelMetaData.isLegacyTable) && (_jsxs("div", { className: "field col-6 flex-flex-column gap-2 mt-2", children: [_jsxs("div", { className: "flex align-items-center gap-2", children: [_jsx(SolidCheckbox, { id: "isPrimaryKey", name: "isPrimaryKey", onChange: function (event) {
|
|
1600
|
+
var checked = event.currentTarget.checked;
|
|
1601
|
+
formik.setFieldValue("isPrimaryKey", checked);
|
|
1602
|
+
// Auto-set required and unique when isPrimaryKey is checked
|
|
1603
|
+
if (checked) {
|
|
1604
|
+
formik.setFieldValue("required", true);
|
|
1605
|
+
formik.setFieldValue("unique", true);
|
|
1606
|
+
}
|
|
1607
|
+
}, checked: formik.values.isPrimaryKey }), _jsx("label", { htmlFor: "isPrimaryKey", className: classNames("form-field-label", styles.fieldLabel), children: "Is Primary Key" })] }), _jsx("p", { className: "fieldSubTitle", children: "By selecting this option, you are setting this field as the primary key for this legacy table." }), isFormFieldValid(formik, "isPrimaryKey") && (_jsx("p", { className: styles.fieldError, children: (_78 = (_77 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _77 === void 0 ? void 0 : _77.isPrimaryKey) === null || _78 === void 0 ? void 0 : _78.toString() }))] }))] }), formik.values.encrypt === true && (_jsxs("div", { className: "formgrid grid mt-2", children: [_jsx("div", { className: "md:col-6 sm:col-12", children: _jsxs("div", { className: "field col-6 flex-flex-column gap-2", children: [_jsx("label", { htmlFor: "encryptionType", className: classNames("form-field-label", styles.fieldLabel), children: "Encryption Type" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_k = {},
|
|
1608
|
+
_k[styles.fieldInvalidControl] = isFormFieldValid(formik, "encryptionType"),
|
|
1609
|
+
_k)), children: _jsx(SolidAutocomplete, { value: encryptionTypeField.selectedItem, suggestions: encryptionTypeField.filteredItems, completeMethod: encryptionTypeField.searchItems, onChange: encryptionTypeField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "encryptionType") && (_jsx("p", { className: styles.fieldError, children: (_80 = (_79 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _79 === void 0 ? void 0 : _79.encryptionType) === null || _80 === void 0 ? void 0 : _80.toString() }))] }) }), _jsx("div", { className: "md:col-6 sm:col-12", children: _jsxs("div", { className: "field col-6 flex-flex-column gap-2", children: [_jsx("label", { htmlFor: "decryptWhen", className: classNames("form-field-label", styles.fieldLabel), children: "Decrypt When" }), _jsx("div", { className: classNames("solid-standard-autocomplete", (_l = {},
|
|
1610
|
+
_l[styles.fieldInvalidControl] = isFormFieldValid(formik, "decryptWhen"),
|
|
1611
|
+
_l)), children: _jsx(SolidAutocomplete, { value: decryptWhenField.selectedItem, suggestions: decryptWhenField.filteredItems, completeMethod: decryptWhenField.searchItems, onChange: decryptWhenField.handleChange, dropdown: true, field: "label", className: "w-full" }) }), isFormFieldValid(formik, "decryptWhen") && (_jsx("p", { className: styles.fieldError, children: (_82 = (_81 = formik === null || formik === void 0 ? void 0 : formik.errors) === null || _81 === void 0 ? void 0 : _81.decryptWhen) === null || _82 === void 0 ? void 0 : _82.toString() }))] }) })] }))] })] }), _jsxs("div", { className: "flex gap-3 mt-3", children: [_jsx("div", { children: _jsx(SolidButton, { label: "Finish", size: "small", onClick: function () { return showError(); }, type: "submit" }) }), _jsx("div", { children: _jsx(SolidButton, { label: "Cancel", size: "small", severity: "secondary", type: "reset", onClick: function () { return setVisiblePopup(false); }, outlined: true }) })] })] }) }) }) }) }), _jsx(SolidDialog, { open: isBackPopupVisible, onOpenChange: function (next) {
|
|
1638
1612
|
if (!next) {
|
|
1639
1613
|
setIsBackPopupVisible(false);
|
|
1640
1614
|
}
|