@solidstarters/solid-core-ui 1.1.60 → 1.1.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/components/Svg/ExcelSvg.d.ts +6 -0
  2. package/dist/components/Svg/ExcelSvg.d.ts.map +1 -0
  3. package/dist/components/Svg/ExcelSvg.js +6 -0
  4. package/dist/components/Svg/ExcelSvg.js.map +1 -0
  5. package/dist/components/Svg/PDFSvg.d.ts +5 -1
  6. package/dist/components/Svg/PDFSvg.d.ts.map +1 -1
  7. package/dist/components/Svg/PDFSvg.js +3 -2
  8. package/dist/components/Svg/PDFSvg.js.map +1 -1
  9. package/dist/components/auth/GoogleAuthChecking.js +1 -1
  10. package/dist/components/auth/GoogleAuthChecking.js.map +1 -1
  11. package/dist/components/auth/SolidInitialLoginOtp.d.ts.map +1 -1
  12. package/dist/components/auth/SolidInitialLoginOtp.js +31 -18
  13. package/dist/components/auth/SolidInitialLoginOtp.js.map +1 -1
  14. package/dist/components/auth/SolidOTPVerify.js +1 -1
  15. package/dist/components/auth/SolidOTPVerify.js.map +1 -1
  16. package/dist/components/common/CancelButton.d.ts.map +1 -1
  17. package/dist/components/common/CancelButton.js +8 -4
  18. package/dist/components/common/CancelButton.js.map +1 -1
  19. package/dist/components/common/SolidBreadcrumb.d.ts.map +1 -1
  20. package/dist/components/common/SolidBreadcrumb.js +32 -15
  21. package/dist/components/common/SolidBreadcrumb.js.map +1 -1
  22. package/dist/components/core/common/SolidGlobalSearchElement.d.ts +1 -0
  23. package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
  24. package/dist/components/core/common/SolidGlobalSearchElement.js +292 -56
  25. package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
  26. package/dist/components/core/common/SolidSaveCustomFilterForm.d.ts +9 -0
  27. package/dist/components/core/common/SolidSaveCustomFilterForm.d.ts.map +1 -0
  28. package/dist/components/core/common/SolidSaveCustomFilterForm.js +37 -0
  29. package/dist/components/core/common/SolidSaveCustomFilterForm.js.map +1 -0
  30. package/dist/components/core/filter/fields/SolidBooleanField.js +1 -1
  31. package/dist/components/core/filter/fields/SolidBooleanField.js.map +1 -1
  32. package/dist/components/core/kanban/KanbanBoard.d.ts.map +1 -1
  33. package/dist/components/core/kanban/KanbanBoard.js +1 -1
  34. package/dist/components/core/kanban/KanbanBoard.js.map +1 -1
  35. package/dist/components/core/kanban/KanbanCard.d.ts.map +1 -1
  36. package/dist/components/core/kanban/KanbanCard.js +4 -1
  37. package/dist/components/core/kanban/KanbanCard.js.map +1 -1
  38. package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
  39. package/dist/components/core/kanban/SolidKanbanView.js +172 -110
  40. package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
  41. package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.d.ts.map +1 -1
  42. package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js +6 -2
  43. package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js.map +1 -1
  44. package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.d.ts.map +1 -1
  45. package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js +3 -2
  46. package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js.map +1 -1
  47. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  48. package/dist/components/core/list/SolidListView.js +3 -0
  49. package/dist/components/core/list/SolidListView.js.map +1 -1
  50. package/dist/components/core/model/CreateModel.js +3 -3
  51. package/dist/components/core/model/CreateModel.js.map +1 -1
  52. package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
  53. package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
  54. package/dist/components/core/model/ModelMetaData.d.ts.map +1 -1
  55. package/dist/components/core/model/ModelMetaData.js +68 -15
  56. package/dist/components/core/model/ModelMetaData.js.map +1 -1
  57. package/dist/index.d.ts +1 -0
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +1 -0
  60. package/dist/index.js.map +1 -1
  61. package/dist/resources/globals.css +22 -7
  62. package/package.json +1 -1
  63. package/src/components/Svg/ExcelSvg.tsx +15 -0
  64. package/src/components/Svg/PDFSvg.tsx +6 -3
  65. package/src/components/auth/GoogleAuthChecking.tsx +1 -1
  66. package/src/components/auth/SolidInitialLoginOtp.tsx +13 -2
  67. package/src/components/auth/SolidOTPVerify.tsx +1 -1
  68. package/src/components/common/CancelButton.tsx +12 -6
  69. package/src/components/common/SolidBreadcrumb.tsx +79 -60
  70. package/src/components/core/common/SolidGlobalSearchElement.tsx +425 -123
  71. package/src/components/core/common/SolidSaveCustomFilterForm.tsx +74 -0
  72. package/src/components/core/filter/fields/SolidBooleanField.tsx +1 -1
  73. package/src/components/core/kanban/KanbanBoard.tsx +3 -2
  74. package/src/components/core/kanban/KanbanCard.tsx +6 -3
  75. package/src/components/core/kanban/SolidKanbanView.tsx +219 -174
  76. package/src/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +14 -4
  77. package/src/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +4 -8
  78. package/src/components/core/list/SolidListView.tsx +4 -1
  79. package/src/components/core/model/CreateModel.tsx +2 -2
  80. package/src/components/core/model/FieldMetaDataForm.tsx +0 -2
  81. package/src/components/core/model/ModelMetaData.tsx +204 -121
  82. package/src/index.ts +1 -0
  83. package/src/resources/globals.css +22 -7
@@ -7,6 +7,11 @@ import { FormEvent } from "primereact/ts-helpers";
7
7
  import { FilterMatchMode } from 'primereact/api';
8
8
  import { Document, Page, pdfjs } from "react-pdf";
9
9
  import { Dialog } from "primereact/dialog";
10
+ import { PDFSvg } from '@/components/Svg/PDFSvg';
11
+ import Image from 'next/image';
12
+ import FileImage from '../../../../resources/images/fileTypes/File.png'
13
+ import { ExcelSvg } from '@/components/Svg/ExcelSvg';
14
+
10
15
 
11
16
  pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`;
12
17
 
@@ -22,7 +27,6 @@ const SolidMediaSingleKanbanField = ({ solidKanbanViewMetaData, fieldMetadata, f
22
27
  // const url = "http://localhost:8080/media-files-storage/PF Form.xls";
23
28
 
24
29
 
25
-
26
30
  return (
27
31
  <>
28
32
  {mimeType && mimeType.includes("image/") &&
@@ -52,7 +56,7 @@ const SolidMediaSingleKanbanField = ({ solidKanbanViewMetaData, fieldMetadata, f
52
56
  <div onClick={(e) => e.stopPropagation()}>
53
57
  <div className='flex align-items-end gap-2 my-2'>
54
58
  <div onClick={() => setVisible(true)} style={{ cursor: 'pointer' }}>
55
- <svg width="36px" height="36px" viewBox="-4 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#000000" stroke-width="0.0004"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M25.6686 26.0962C25.1812 26.2401 24.4656 26.2563 23.6984 26.145C22.875 26.0256 22.0351 25.7739 21.2096 25.403C22.6817 25.1888 23.8237 25.2548 24.8005 25.6009C25.0319 25.6829 25.412 25.9021 25.6686 26.0962ZM17.4552 24.7459C17.3953 24.7622 17.3363 24.7776 17.2776 24.7939C16.8815 24.9017 16.4961 25.0069 16.1247 25.1005L15.6239 25.2275C14.6165 25.4824 13.5865 25.7428 12.5692 26.0529C12.9558 25.1206 13.315 24.178 13.6667 23.2564C13.9271 22.5742 14.193 21.8773 14.468 21.1894C14.6075 21.4198 14.7531 21.6503 14.9046 21.8814C15.5948 22.9326 16.4624 23.9045 17.4552 24.7459ZM14.8927 14.2326C14.958 15.383 14.7098 16.4897 14.3457 17.5514C13.8972 16.2386 13.6882 14.7889 14.2489 13.6185C14.3927 13.3185 14.5105 13.1581 14.5869 13.0744C14.7049 13.2566 14.8601 13.6642 14.8927 14.2326ZM9.63347 28.8054C9.38148 29.2562 9.12426 29.6782 8.86063 30.0767C8.22442 31.0355 7.18393 32.0621 6.64941 32.0621C6.59681 32.0621 6.53316 32.0536 6.44015 31.9554C6.38028 31.8926 6.37069 31.8476 6.37359 31.7862C6.39161 31.4337 6.85867 30.8059 7.53527 30.2238C8.14939 29.6957 8.84352 29.2262 9.63347 28.8054ZM27.3706 26.1461C27.2889 24.9719 25.3123 24.2186 25.2928 24.2116C24.5287 23.9407 23.6986 23.8091 22.7552 23.8091C21.7453 23.8091 20.6565 23.9552 19.2582 24.2819C18.014 23.3999 16.9392 22.2957 16.1362 21.0733C15.7816 20.5332 15.4628 19.9941 15.1849 19.4675C15.8633 17.8454 16.4742 16.1013 16.3632 14.1479C16.2737 12.5816 15.5674 11.5295 14.6069 11.5295C13.948 11.5295 13.3807 12.0175 12.9194 12.9813C12.0965 14.6987 12.3128 16.8962 13.562 19.5184C13.1121 20.5751 12.6941 21.6706 12.2895 22.7311C11.7861 24.0498 11.2674 25.4103 10.6828 26.7045C9.04334 27.3532 7.69648 28.1399 6.57402 29.1057C5.8387 29.7373 4.95223 30.7028 4.90163 31.7107C4.87693 32.1854 5.03969 32.6207 5.37044 32.9695C5.72183 33.3398 6.16329 33.5348 6.6487 33.5354C8.25189 33.5354 9.79489 31.3327 10.0876 30.8909C10.6767 30.0029 11.2281 29.0124 11.7684 27.8699C13.1292 27.3781 14.5794 27.011 15.985 26.6562L16.4884 26.5283C16.8668 26.4321 17.2601 26.3257 17.6635 26.2153C18.0904 26.0999 18.5296 25.9802 18.976 25.8665C20.4193 26.7844 21.9714 27.3831 23.4851 27.6028C24.7601 27.7883 25.8924 27.6807 26.6589 27.2811C27.3486 26.9219 27.3866 26.3676 27.3706 26.1461ZM30.4755 36.2428C30.4755 38.3932 28.5802 38.5258 28.1978 38.5301H3.74486C1.60224 38.5301 1.47322 36.6218 1.46913 36.2428L1.46884 3.75642C1.46884 1.6039 3.36763 1.4734 3.74457 1.46908H20.263L20.2718 1.4778V7.92396C20.2718 9.21763 21.0539 11.6669 24.0158 11.6669H30.4203L30.4753 11.7218L30.4755 36.2428ZM28.9572 10.1976H24.0169C21.8749 10.1976 21.7453 8.29969 21.7424 7.92417V2.95307L28.9572 10.1976ZM31.9447 36.2428V11.1157L21.7424 0.871022V0.823357H21.6936L20.8742 0H3.74491C2.44954 0 0 0.785336 0 3.75711V36.2435C0 37.5427 0.782956 40 3.74491 40H28.2001C29.4952 39.9997 31.9447 39.2143 31.9447 36.2428Z" fill="#EB5757"></path> </g></svg>
59
+ <PDFSvg size={50} />
56
60
  </div>
57
61
  <p className="text-sm" style={{ cursor: 'pointer', maxWidth: '70%', wordWrap: 'break-word', overflowWrap: 'break-word' }} onClick={() => setVisible(true)}>
58
62
  {fileName}
@@ -69,7 +73,7 @@ const SolidMediaSingleKanbanField = ({ solidKanbanViewMetaData, fieldMetadata, f
69
73
  {mimeType && (mimeType.includes("excel") || mimeType.includes("spreadsheet")) && (
70
74
  <div className='flex align-items-end gap-2 my-2' onClick={(e) => e.stopPropagation()}>
71
75
  <a href={url} download target="_blank" rel="noopener noreferrer">
72
- <svg fill="#45B058" height="36px" width="36px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g> <g> <g> <path d="M447.168,134.56c-0.535-1.288-1.318-2.459-2.304-3.445l-128-128c-2.003-1.988-4.709-3.107-7.531-3.115H74.667 C68.776,0,64,4.776,64,10.667v490.667C64,507.224,68.776,512,74.667,512h362.667c5.891,0,10.667-4.776,10.667-10.667V138.667 C447.997,137.256,447.714,135.86,447.168,134.56z M320,36.416L411.584,128H320V36.416z M426.667,490.667H85.333V21.333h213.333 v117.333c0,5.891,4.776,10.667,10.667,10.667h117.333V490.667z"></path> <path d="M128,181.333v256c0,5.891,4.776,10.667,10.667,10.667h234.667c5.891,0,10.667-4.776,10.667-10.667v-256 c0-5.891-4.776-10.667-10.667-10.667H138.667C132.776,170.667,128,175.442,128,181.333z M320,192h42.667v42.667H320V192z M320,256h42.667v42.667H320V256z M320,320h42.667v42.667H320V320z M320,384h42.667v42.667H320V384z M213.333,192h85.333v42.667 h-85.333V192z M213.333,256h85.333v42.667h-85.333V256z M213.333,320h85.333v42.667h-85.333V320z M213.333,384h85.333v42.667 h-85.333V384z M149.333,192H192v42.667h-42.667V192z M149.333,256H192v42.667h-42.667V256z M149.333,320H192v42.667h-42.667V320z M149.333,384H192v42.667h-42.667V384z"></path> </g> </g> </g> </g></svg>
76
+ <ExcelSvg size={50} />
73
77
  </a>
74
78
  <a href={url} download target="_blank" rel="noopener noreferrer" className='text-color flex align-items-start gap-2' style={{ textDecoration: 'none' }}>
75
79
  <p className="text-sm mb-1" style={{ wordWrap: 'break-word', overflowWrap: 'break-word' }}>
@@ -86,7 +90,13 @@ const SolidMediaSingleKanbanField = ({ solidKanbanViewMetaData, fieldMetadata, f
86
90
  !mimeType.includes("spreadsheet") && (
87
91
  <div className='flex align-items-end gap-2 my-2' onClick={(e) => e.stopPropagation()}>
88
92
  <a href={url} download target="_blank" rel="noopener noreferrer">
89
- <svg width="36px" height="36px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="#722ED1" stroke="#722ED1" stroke-width="0.00024000000000000003"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><path d="M3 23h18V6.709L15.29 1H3zM15 2h.2L20 6.8V7h-5zM4 2h10v6h6v14H4z"></path><path fill="none" d="M0 0h24v24H0z"></path></g></svg>
93
+ <Image
94
+ src={FileImage}
95
+ alt={fileName}
96
+ className="relative"
97
+ height={50}
98
+ width={50}
99
+ />
90
100
  </a>
91
101
  <a href={url} download target="_blank" rel="noopener noreferrer" className='text-color flex align-items-start gap-2' style={{ textDecoration: 'none' }}>
92
102
  <p className="text-sm mb-1" style={{ wordWrap: 'break-word', overflowWrap: 'break-word' }}>
@@ -2,12 +2,13 @@
2
2
  import { useState } from 'react';
3
3
  import { SolidKanbanViewFieldsParams } from '../SolidKanbanViewFields';
4
4
  import { Dialog } from 'primereact/dialog';
5
- import { Document, Page, pdfjs } from "react-pdf";
5
+ import { Document, Page } from "react-pdf";
6
+ import { PDFSvg } from '@/components/Svg/PDFSvg';
6
7
  import MP3Image from '../../../../resources/images/fileTypes/Mp3.png'
7
8
  import MP4Image from '../../../../resources/images/fileTypes/Mp4.png'
8
9
  import FileImage from '../../../../resources/images/fileTypes/File.png'
9
10
  import Image from 'next/image';
10
- import { PDFSvg } from '@/components/Svg/PDFSvg';
11
+ import { ExcelSvg } from '@/components/Svg/ExcelSvg';
11
12
  const SolidShortTextKanbanField = ({ solidKanbanViewMetaData, fieldMetadata, fieldLayout, data, setLightboxUrls, setOpenLightbox, groupedView }: SolidKanbanViewFieldsParams) => {
12
13
  const [visible, setVisible] = useState(false);
13
14
  const renderMode = fieldLayout?.attrs?.renderMode ? fieldLayout?.attrs?.renderMode : "text";
@@ -70,12 +71,7 @@ const SolidShortTextKanbanField = ({ solidKanbanViewMetaData, fieldMetadata, fie
70
71
 
71
72
  {renderMode === "image" && !groupedView && mimeType && (mimeType.includes("excel") || mimeType.includes("spreadsheet")) && (
72
73
  <a href={data[fieldMetadata.name]} className='kanban-media-view-card mt-3' onClick={(e) => e.stopPropagation()} style={{ cursor: 'pointer' }} download target="_blank" rel="noopener noreferrer">
73
- <svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
74
- <path d="M15 10.4147V10.4146C14.9999 5.29959 19.6888 1 25.3892 1H53.5858L77 24.4142V69.5852C77 74.7288 72.5287 78.9999 66.8806 78.9999H25.1406C19.47 78.9999 15 74.7276 15 69.5852V10.4147Z" fill="white" stroke="#DBDBDB" stroke-width="2" />
75
- <path d="M54.0513 16.32V0L78 24H62.0342C54.8496 24 53.7187 18.88 54.0513 16.32Z" fill="#D4D4D8" />
76
- <rect x="2" y="38" width="51" height="30" rx="6" fill="#079455" />
77
- <path d="M13.7955 46.9091L16.4354 51.3707H16.5376L19.1903 46.9091H22.3161L18.321 53.4545L22.4055 60H19.2223L16.5376 55.532H16.4354L13.7507 60H10.5803L14.6776 53.4545L10.657 46.9091H13.7955ZM24.0675 60V46.9091H26.8352V57.718H32.4474V60H24.0675ZM41.3819 50.674C41.3308 50.1584 41.1113 49.7578 40.7235 49.4723C40.3358 49.1868 39.8095 49.044 39.1447 49.044C38.693 49.044 38.3116 49.108 38.0005 49.2358C37.6895 49.3594 37.4508 49.532 37.2846 49.7536C37.1227 49.9751 37.0417 50.2266 37.0417 50.5078C37.0332 50.7422 37.0822 50.9467 37.1887 51.1214C37.2995 51.2962 37.4508 51.4474 37.6426 51.5753C37.8343 51.6989 38.0559 51.8075 38.3074 51.9013C38.5588 51.9908 38.8272 52.0675 39.1127 52.1314L40.2889 52.4126C40.8599 52.5405 41.3841 52.7109 41.8613 52.924C42.3386 53.1371 42.752 53.3991 43.1014 53.7102C43.4508 54.0213 43.7214 54.3878 43.9132 54.8097C44.1092 55.2315 44.2093 55.7152 44.2136 56.2607C44.2093 57.0618 44.0048 57.7564 43.6 58.3445C43.1994 58.9283 42.6199 59.3821 41.8613 59.706C41.1071 60.0256 40.1973 60.1854 39.1319 60.1854C38.0751 60.1854 37.1547 60.0234 36.3706 59.6996C35.5907 59.3757 34.9814 58.8963 34.5424 58.2614C34.1078 57.6222 33.8798 56.8317 33.8585 55.8899H36.5368C36.5666 56.3288 36.6923 56.6953 36.9139 56.9893C37.1397 57.2791 37.4402 57.4986 37.8152 57.6477C38.1944 57.7926 38.6227 57.8651 39.1 57.8651C39.5687 57.8651 39.9757 57.7969 40.3208 57.6605C40.6703 57.5241 40.9409 57.3345 41.1326 57.0916C41.3244 56.8487 41.4203 56.5696 41.4203 56.2543C41.4203 55.9602 41.3329 55.7131 41.1582 55.5128C40.9877 55.3125 40.7363 55.142 40.4039 55.0014C40.0758 54.8608 39.6731 54.733 39.1958 54.6179L37.7704 54.2599C36.6667 53.9915 35.7953 53.5717 35.1561 53.0007C34.5169 52.4297 34.1994 51.6605 34.2037 50.6932C34.1994 49.9006 34.4103 49.2081 34.8365 48.6158C35.2669 48.0234 35.8571 47.5611 36.6071 47.2287C37.3571 46.8963 38.2093 46.7301 39.1639 46.7301C40.1355 46.7301 40.9835 46.8963 41.7079 47.2287C42.4366 47.5611 43.0034 48.0234 43.4082 48.6158C43.813 49.2081 44.0218 49.8942 44.0346 50.674H41.3819Z" fill="white" />
78
- </svg>
74
+ <ExcelSvg />
79
75
  </a>
80
76
  )}
81
77
  {renderMode === "image" && !groupedView && mimeType && mimeType.includes("audio") && (
@@ -147,7 +147,7 @@ export const SolidListView = (params: SolidListViewParams) => {
147
147
  } = entityApi;
148
148
 
149
149
  // Get the list view layout & metadata first.
150
- const listViewMetaDataQs = qs.stringify({ modelName: params.modelName, moduleName: params.moduleName, viewType: 'list'}, {
150
+ const listViewMetaDataQs = qs.stringify({ modelName: params.modelName, moduleName: params.moduleName, viewType: 'list' }, {
151
151
  encodeValuesOnly: true,
152
152
  });
153
153
  const [listViewMetaData, setListViewMetaData] = useState({});
@@ -812,6 +812,9 @@ export const SolidListView = (params: SolidListViewParams) => {
812
812
  if (params.embeded == true) {
813
813
  params.handlePopUpOpen(rowData?.id);
814
814
  } else {
815
+ if (typeof window !== "undefined") {
816
+ sessionStorage.setItem("fromView", "list");
817
+ }
815
818
  router.push(`${editButtonUrl}/${rowData?.id}`);
816
819
  }
817
820
  }}
@@ -178,7 +178,7 @@ const CreateModel = ({ data, params }: any) => {
178
178
  }
179
179
  return rest
180
180
  });
181
- const { module, createdAt, updatedAt, id, deletedAt, ...modelData } = modelMetaData;
181
+ const { module, parentModel,createdAt, updatedAt, id, deletedAt, ...modelData } = modelMetaData;
182
182
  const updateData = { ...modelData, displayName: modelData.displayName.trim(), fields: fieldData };
183
183
  updateModel({ id: data.id, data: updateData });
184
184
  }
@@ -190,7 +190,7 @@ const CreateModel = ({ data, params }: any) => {
190
190
  }
191
191
  return rest
192
192
  });
193
- const { module, ...modelData } = modelMetaData;
193
+ const { module, parentModel,...modelData } = modelMetaData;
194
194
  const data = { ...modelData, displayName: modelData.displayName.trim(), fields: fieldData };
195
195
  createModel(data);
196
196
  if (isCreateModelSuccess) {
@@ -173,8 +173,6 @@ const fieldBasedPayloadFormating = (values: any, currentFields: string[], fieldM
173
173
  if (transformedPayload.relationType == "many-to-many") {
174
174
  transformedPayload.isRelationManyToManyOwner = true;
175
175
  }
176
-
177
-
178
176
  return transformedPayload
179
177
 
180
178
  }
@@ -2,6 +2,7 @@
2
2
  import { SingleSelectAutoCompleteField } from "@/components/common/SingleSelectAutoCompleteField";
3
3
  import { getSingularAndPlural } from "@/helpers/helpers";
4
4
  import { useGetFieldDefaultMetaDataQuery } from "@/redux/api/fieldApi";
5
+ import { useLazyGetModelsQuery } from "@/redux/api/modelApi";
5
6
  import { useLazyGetmodulesQuery } from "@/redux/api/moduleApi";
6
7
  import { useFormik } from "formik";
7
8
  import { snakeCase } from "lodash";
@@ -27,6 +28,7 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
27
28
  const pathname = usePathname();
28
29
 
29
30
  const [triggerGetModules, { data: moduleData, isFetching: isModuleFetching, error: moduleError }] = useLazyGetmodulesQuery();
31
+ const [triggerGetModels, { data: modelData, isFetching: isModelFetching, error: modelError }] = useLazyGetModelsQuery();
30
32
  const { data: fieldDefaultMetaData, isLoading, error, refetch } = useGetFieldDefaultMetaDataQuery(null);
31
33
 
32
34
 
@@ -54,14 +56,22 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
54
56
  enableSoftDelete: modelMetaData ? modelMetaData?.enableSoftDelete : "",
55
57
  enableAuditTracking: modelMetaData ? modelMetaData?.enableAuditTracking : "",
56
58
  internationalisation: modelMetaData ? modelMetaData?.internationalisation : "",
59
+ isChild: modelMetaData ? modelMetaData?.isChild : false,
60
+ parentModelId: modelMetaData ? modelMetaData?.parentModel?.id : "",
61
+ parentModel: modelMetaData ? modelMetaData?.parentModel : "",
62
+
57
63
  };
58
64
 
59
65
  const [showTableName, setShowTableName] = useState<any>(false);
66
+ const [showParentModel, setShowParentModel] = useState<any>(false);
60
67
 
61
68
  useEffect(() => {
62
69
  if (modelMetaData && modelMetaData.tableName) {
63
70
  setShowTableName(true)
64
71
  }
72
+ if (modelMetaData && modelMetaData.isChild) {
73
+ setShowParentModel(true)
74
+ }
65
75
  }, [modelMetaData])
66
76
 
67
77
  const validationSchema = Yup.object({
@@ -93,6 +103,10 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
93
103
  enableSoftDelete: Yup.boolean(),
94
104
  enableAuditTracking: Yup.boolean(),
95
105
  internationalisation: Yup.boolean(),
106
+ isChild: Yup.boolean(),
107
+ parentModelId: Yup.number(),
108
+ parentModel: Yup.object()
109
+
96
110
  });
97
111
 
98
112
 
@@ -124,6 +138,11 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
124
138
  enableSoftDelete: values.enableSoftDelete === true ? true : '',
125
139
  enableAuditTracking: values.enableAuditTracking === true ? true : '',
126
140
  internationalisation: values.internationalisation === true ? true : '',
141
+ isChild: values.isChild ? values.isChild === true : '',
142
+ ...(values.isChild == true && {
143
+ parentModelId: values.parentModelId,
144
+ parentModel: values.parentModel,
145
+ }),
127
146
  };
128
147
  setModelMetaData(modelData);
129
148
  nextTab()
@@ -198,6 +217,37 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
198
217
  };
199
218
 
200
219
 
220
+ const searchModel = async (event: any) => {
221
+ try {
222
+ const query = event.query;
223
+ const queryData = {
224
+ limit: 10,
225
+ offset: 0,
226
+ filters: {
227
+ singularName: {
228
+ $containsi: query,
229
+ },
230
+ },
231
+ };
232
+
233
+ const queryString = qs.stringify(queryData, {
234
+ encodeValuesOnly: true,
235
+ });
236
+
237
+ const result = await triggerGetModels(queryString).unwrap();
238
+
239
+ if (result && result.records) {
240
+ const updatedSuggestion = [...result.records];
241
+ return updatedSuggestion
242
+ } else {
243
+ return []
244
+ }
245
+ } catch (error) {
246
+ return []
247
+ }
248
+ };
249
+
250
+
201
251
  const serachDataSource = async (event: any) => {
202
252
  const query = event.query;
203
253
  try {
@@ -404,6 +454,39 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
404
454
  className="mt-2"
405
455
  />
406
456
  )}
457
+
458
+ <div className="mt-4">
459
+ <div className="flex align-items-center gap-2">
460
+ <Checkbox onChange={e => { setShowParentModel(e.checked) }} checked={showParentModel} disabled={params.id !== 'new'}></Checkbox>
461
+ <label htmlFor="ingredient1" className="form-field-label">
462
+ isChild
463
+ </label>
464
+ </div>
465
+ </div>
466
+ {showParentModel &&
467
+ <div className="flex flex-column gap-2 mt-3">
468
+ <label htmlFor="type" className="form-field-label">
469
+ Parent Model
470
+ </label>
471
+ <SingleSelectAutoCompleteField
472
+ disabled={params.id !== 'new'}
473
+ key="parentModel"
474
+ formik={formik}
475
+ isFormFieldValid={isFormFieldValid}
476
+ relationField={true}
477
+ fieldName="parentModel"
478
+ fieldNameId="parentModelId"
479
+ labelKey="displayName"
480
+ valueKey="id"
481
+ searchData={searchModel}
482
+ existingData={formik.values.parentModel}
483
+ formErrors={formErrors}
484
+ />
485
+ {(isFormFieldValid(formik, "parentModel") || (formErrors["parentModel"])) && (
486
+ <Message severity="error" text={formik?.errors?.parentModelId?.toString()} />
487
+ )}
488
+ </div>
489
+ }
407
490
  {/* <div className="field col-6">
408
491
  <div className="flex align-items-center gap-2 mt-3">
409
492
  <Checkbox
@@ -510,132 +593,132 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
510
593
 
511
594
  {/* <p className="form-wrapper-heading text-base">Basic Settings</p> */}
512
595
  <Panel header={"Basic Settings"} className="solid-column-panel">
513
- <div className="flex flex-column gap-2 mt-3">
514
- <label htmlFor="displayName" className="form-field-label">
515
- Display Name
516
- </label>
517
- <InputText
518
- type="text"
519
- id="displayName"
520
- name="displayName"
521
- onChange={(e) => {
596
+ <div className="flex flex-column gap-2 mt-3">
597
+ <label htmlFor="displayName" className="form-field-label">
598
+ Display Name
599
+ </label>
600
+ <InputText
601
+ type="text"
602
+ id="displayName"
603
+ name="displayName"
604
+ onChange={(e) => {
522
605
 
523
- formik.handleChange(e);
524
- const { toCamelCase, toSnakeCase, toPluralCamelCase } = getSingularAndPlural(e.target.value);
606
+ formik.handleChange(e);
607
+ const { toCamelCase, toSnakeCase, toPluralCamelCase } = getSingularAndPlural(e.target.value);
608
+ if (params.id === 'new') {
609
+ formik.setFieldValue("singularName", toCamelCase);
610
+ formik.setFieldValue("pluralName", toPluralCamelCase);
611
+ }
612
+ if (showTableName == true) {
525
613
  if (params.id === 'new') {
526
- formik.setFieldValue("singularName", toCamelCase);
527
- formik.setFieldValue("pluralName", toPluralCamelCase);
528
- }
529
- if (showTableName == true) {
530
- if (params.id === 'new') {
531
- formik.setFieldValue("tableName", toSnakeCase);
532
- }
614
+ formik.setFieldValue("tableName", toSnakeCase);
533
615
  }
616
+ }
534
617
 
535
618
 
536
- }}
537
- value={formik.values.displayName}
538
- className={classNames("", {
539
- "p-invalid": isFormFieldValid(formik, "displayName") || formErrors["displayName"],
540
- })}
619
+ }}
620
+ value={formik.values.displayName}
621
+ className={classNames("", {
622
+ "p-invalid": isFormFieldValid(formik, "displayName") || formErrors["displayName"],
623
+ })}
624
+
625
+ />
541
626
 
627
+ {(isFormFieldValid(formik, "displayName") || (formErrors["displayName"])) && (
628
+ <Message
629
+ severity="error"
630
+ text={formik?.errors?.displayName?.toString()}
542
631
  />
632
+ )}
633
+ </div>
634
+ <div className="flex flex-column gap-1 mt-4">
635
+ <label htmlFor="singularName" className="form-field-label">
636
+ Singular Name
637
+ </label>
638
+ <InputText
639
+ disabled={true}
640
+ type="text"
641
+ id="singularName"
642
+ name="singularName"
643
+ onChange={formik.handleChange}
644
+ value={formik.values.singularName}
645
+ className={classNames("", {
646
+ "p-invalid": isFormFieldValid(formik, "singularName") || formErrors["singularName"],
647
+ })}
648
+ />
649
+ {(isFormFieldValid(formik, "singularName") || (formErrors["singularName"])) && (
650
+ <Message
651
+ severity="error"
652
+ text={formik?.errors?.singularName?.toString()}
653
+ />
654
+ )}
655
+ </div>
656
+ <div className="flex flex-column gap-1 mt-4">
657
+ <label htmlFor="pluralName" className="form-field-label">
658
+ Plural Name
659
+ </label>
660
+ <InputText
661
+ disabled={true}
662
+ type="text"
663
+ id="pluralName"
664
+ name="pluralName"
665
+ onChange={formik.handleChange}
666
+ value={formik.values.pluralName}
667
+ className={classNames("", {
668
+ "p-invalid": isFormFieldValid(formik, "pluralName") || formErrors["pluralName"],
669
+ })}
670
+ />
671
+ {(isFormFieldValid(formik, "pluralName") || (formErrors["pluralName"])) && (
672
+ <Message severity="error" text={formik?.errors?.pluralName?.toString()} />
673
+ )}
674
+ </div>
543
675
 
544
- {(isFormFieldValid(formik, "displayName") || (formErrors["displayName"])) && (
545
- <Message
546
- severity="error"
547
- text={formik?.errors?.displayName?.toString()}
548
- />
549
- )}
676
+ <div className="mt-4">
677
+ <div className="flex align-items-center gap-2">
678
+ <Checkbox onChange={e => {
679
+ setShowTableName(e.checked);
680
+ if (e.checked === true) {
681
+ const { toCamelCase, toSnakeCase, toPluralCamelCase } = getSingularAndPlural(formik.values.displayName);
682
+ if (params.id === 'new') {
683
+ formik.setFieldValue("tableName", toSnakeCase);
684
+ }
685
+ }
686
+
687
+ }} checked={showTableName} disabled={params.id !== 'new'}></Checkbox>
688
+ <label htmlFor="ingredient1" className="form-field-label">
689
+ Set table name
690
+ </label>
550
691
  </div>
692
+ </div>
693
+ {showTableName &&
551
694
  <div className="flex flex-column gap-1 mt-4">
552
- <label htmlFor="singularName" className="form-field-label">
553
- Singular Name
695
+ <label htmlFor="tableName" className="form-field-label">
696
+ Table Name
554
697
  </label>
555
698
  <InputText
556
- disabled={true}
699
+ disabled={params.id !== 'new'}
557
700
  type="text"
558
- id="singularName"
559
- name="singularName"
701
+ id="tableName"
702
+ name="tableName"
560
703
  onChange={formik.handleChange}
561
- value={formik.values.singularName}
704
+ value={formik.values.tableName}
562
705
  className={classNames("", {
563
- "p-invalid": isFormFieldValid(formik, "singularName") || formErrors["singularName"],
706
+ "p-invalid": isFormFieldValid(formik, "tableName") || formErrors["tableName"],
564
707
  })}
565
708
  />
566
- {(isFormFieldValid(formik, "singularName") || (formErrors["singularName"])) && (
709
+ {(isFormFieldValid(formik, "tableName") || (formErrors["tableName"])) && (
567
710
  <Message
568
711
  severity="error"
569
- text={formik?.errors?.singularName?.toString()}
712
+ text={formik?.errors?.tableName?.toString()}
570
713
  />
571
714
  )}
572
715
  </div>
573
- <div className="flex flex-column gap-1 mt-4">
574
- <label htmlFor="pluralName" className="form-field-label">
575
- Plural Name
576
- </label>
577
- <InputText
578
- disabled={true}
579
- type="text"
580
- id="pluralName"
581
- name="pluralName"
582
- onChange={formik.handleChange}
583
- value={formik.values.pluralName}
584
- className={classNames("", {
585
- "p-invalid": isFormFieldValid(formik, "pluralName") || formErrors["pluralName"],
586
- })}
587
- />
588
- {(isFormFieldValid(formik, "pluralName") || (formErrors["pluralName"])) && (
589
- <Message severity="error" text={formik?.errors?.pluralName?.toString()} />
590
- )}
591
- </div>
592
-
593
- <div className="mt-4">
594
- <div className="flex align-items-center gap-2">
595
- <Checkbox onChange={e => {
596
- setShowTableName(e.checked);
597
- if (e.checked === true) {
598
- const { toCamelCase, toSnakeCase, toPluralCamelCase } = getSingularAndPlural(formik.values.displayName);
599
- if (params.id === 'new') {
600
- formik.setFieldValue("tableName", toSnakeCase);
601
- }
602
- }
603
-
604
- }} checked={showTableName} disabled={params.id !== 'new'}></Checkbox>
605
- <label htmlFor="ingredient1" className="form-field-label">
606
- Set table name
607
- </label>
608
- </div>
609
- </div>
610
- {showTableName &&
611
- <div className="flex flex-column gap-1 mt-4">
612
- <label htmlFor="tableName" className="form-field-label">
613
- Table Name
614
- </label>
615
- <InputText
616
- disabled={params.id !== 'new'}
617
- type="text"
618
- id="tableName"
619
- name="tableName"
620
- onChange={formik.handleChange}
621
- value={formik.values.tableName}
622
- className={classNames("", {
623
- "p-invalid": isFormFieldValid(formik, "tableName") || formErrors["tableName"],
624
- })}
625
- />
626
- {(isFormFieldValid(formik, "tableName") || (formErrors["tableName"])) && (
627
- <Message
628
- severity="error"
629
- text={formik?.errors?.tableName?.toString()}
630
- />
631
- )}
632
- </div>
633
- }
634
- <div className="flex flex-column gap-1 mt-4">
635
- <label htmlFor="description" className="form-field-label">
636
- Description
637
- </label>
638
- {/* <InputText
716
+ }
717
+ <div className="flex flex-column gap-1 mt-4">
718
+ <label htmlFor="description" className="form-field-label">
719
+ Description
720
+ </label>
721
+ {/* <InputText
639
722
  type="text"
640
723
  id="description"
641
724
  name="description"
@@ -645,24 +728,24 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
645
728
  "p-invalid": isFormFieldValid(formik, "description"),
646
729
  })}
647
730
  /> */}
648
- <InputTextarea
649
- id="description"
650
- name="description"
651
- onChange={formik.handleChange}
652
- value={formik.values.description}
653
- className={classNames("", {
654
- "p-invalid": isFormFieldValid(formik, "description") || formErrors["description"],
655
- })}
656
- rows={5}
657
- cols={30}
731
+ <InputTextarea
732
+ id="description"
733
+ name="description"
734
+ onChange={formik.handleChange}
735
+ value={formik.values.description}
736
+ className={classNames("", {
737
+ "p-invalid": isFormFieldValid(formik, "description") || formErrors["description"],
738
+ })}
739
+ rows={5}
740
+ cols={30}
741
+ />
742
+ {(isFormFieldValid(formik, "description") || (formErrors["description"])) && (
743
+ <Message
744
+ severity="error"
745
+ text={formik?.errors?.description?.toString()}
658
746
  />
659
- {(isFormFieldValid(formik, "description") || (formErrors["description"])) && (
660
- <Message
661
- severity="error"
662
- text={formik?.errors?.description?.toString()}
663
- />
664
- )}
665
- </div>
747
+ )}
748
+ </div>
666
749
  </Panel>
667
750
  </div>
668
751
 
package/src/index.ts CHANGED
@@ -225,6 +225,7 @@ export { SolidViewLayoutManager } from '@/components/core/common/SolidViewLayout
225
225
  export { SolidListViewConfigure } from '@/components/core/list/SolidListViewConfigure';
226
226
  export { SolidCreateButton } from '@/components/core/common/SolidCreateButton';
227
227
  export { SolidGlobalSearchElement } from '@/components/core/common/SolidGlobalSearchElement';
228
+ export { SolidSaveCustomFilterForm } from '@/components/core/common/SolidSaveCustomFilterForm';
228
229
  export { SolidSearchBox } from '@/components/core/common/SolidSearchBox';
229
230
 
230
231
  // export type {ModelMetaData} from '@/components/core/field/FieldListViewData'; //Commenting this line for now, since it does not seem to be used anywhere
@@ -2951,22 +2951,28 @@ li.header-li-px {
2951
2951
  .kanban-ungrouped-column-content {
2952
2952
  display: flex;
2953
2953
  flex-wrap: wrap;
2954
- gap: 10px;
2954
+ column-gap: 25px;
2955
+ row-gap: 10px;
2955
2956
  }
2956
2957
 
2957
2958
  .kanban-ungrouped-column .kanban-card-container {
2958
- flex: 1 1 calc(20% - 10px);
2959
- max-width: calc(20% - 10px);
2959
+ flex: 1 1 calc(20% - 20px);
2960
+ max-width: calc(20% - 20px);
2960
2961
  }
2961
2962
 
2962
2963
  .solid-kanban-card {
2963
2964
  box-shadow: none;
2964
2965
  border-radius: 0.5rem;
2965
- border: 1px solid rgba(216, 226, 234, 0.60);
2966
- background: #FFF;
2966
+ border: 1px solid #E0E0E0;
2967
+ background: #FAFAFA;
2967
2968
  padding: 9px;
2969
+ transition: 0.2s linear;
2968
2970
  }
2969
2971
 
2972
+ .solid-kanban-card:hover {
2973
+ border: 1px solid #722ED1;
2974
+ background: #F9F0FF;
2975
+ }
2970
2976
 
2971
2977
  .solid-media-card {
2972
2978
  box-shadow: none;
@@ -3024,7 +3030,8 @@ flex-shrink: 0; */
3024
3030
  border-radius: 8px;
3025
3031
  max-height: 120px;
3026
3032
  object-fit: contain;
3027
- box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
3033
+ /* box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 2px 0px; */
3034
+ background-color: #fff;
3028
3035
  }
3029
3036
 
3030
3037
 
@@ -3059,7 +3066,7 @@ flex-shrink: 0; */
3059
3066
  .solid-kanban-board-wrapper {
3060
3067
  border-top: 1px solid #CED0D6;
3061
3068
  overflow: hidden;
3062
- height: calc(100vh - 64px) !important;
3069
+ height: calc(100vh - 65px) !important;
3063
3070
  }
3064
3071
 
3065
3072
  .solid-kanban-board-scroll-context {
@@ -3088,4 +3095,12 @@ flex-shrink: 0; */
3088
3095
  .view-widget-chip.p-chip .p-chip-text {
3089
3096
  margin-top: 0 !important;
3090
3097
  margin-bottom: 0 !important;
3098
+ }
3099
+
3100
+
3101
+
3102
+ .solid-global-search-element input {
3103
+
3104
+ min-width: 300px;
3105
+
3091
3106
  }