@solidstarters/solid-core-ui 1.1.72 → 1.1.73

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 (52) hide show
  1. package/dist/components/common/SolidBreadcrumb.d.ts.map +1 -1
  2. package/dist/components/common/SolidBreadcrumb.js +5 -3
  3. package/dist/components/common/SolidBreadcrumb.js.map +1 -1
  4. package/dist/components/common/SolidBreadcrumb.tsx +5 -3
  5. package/dist/components/core/common/SolidCreateButton.d.ts +1 -1
  6. package/dist/components/core/common/SolidCreateButton.d.ts.map +1 -1
  7. package/dist/components/core/common/SolidCreateButton.js +3 -4
  8. package/dist/components/core/common/SolidCreateButton.js.map +1 -1
  9. package/dist/components/core/common/SolidCreateButton.tsx +3 -6
  10. package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
  11. package/dist/components/core/form/SolidFormView.js +10 -8
  12. package/dist/components/core/form/SolidFormView.js.map +1 -1
  13. package/dist/components/core/form/SolidFormView.tsx +12 -8
  14. package/dist/components/core/list/SolidEmptyListViewPlaceholder.d.ts +2 -0
  15. package/dist/components/core/list/SolidEmptyListViewPlaceholder.d.ts.map +1 -0
  16. package/dist/components/core/list/SolidEmptyListViewPlaceholder.js +16 -0
  17. package/dist/components/core/list/SolidEmptyListViewPlaceholder.js.map +1 -0
  18. package/dist/components/core/list/SolidEmptyListViewPlaceholder.tsx +41 -0
  19. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  20. package/dist/components/core/list/SolidListView.js +15 -3
  21. package/dist/components/core/list/SolidListView.js.map +1 -1
  22. package/dist/components/core/list/SolidListView.tsx +24 -4
  23. package/dist/components/core/list/SolidListViewColumn.d.ts.map +1 -1
  24. package/dist/components/core/list/SolidListViewColumn.js +3 -0
  25. package/dist/components/core/list/SolidListViewColumn.js.map +1 -1
  26. package/dist/components/core/list/SolidListViewColumn.tsx +3 -0
  27. package/dist/components/core/list/SolidListViewShimmerLoading.d.ts +2 -0
  28. package/dist/components/core/list/SolidListViewShimmerLoading.d.ts.map +1 -0
  29. package/dist/components/core/list/SolidListViewShimmerLoading.js +7 -0
  30. package/dist/components/core/list/SolidListViewShimmerLoading.js.map +1 -0
  31. package/dist/components/core/list/SolidListViewShimmerLoading.tsx +77 -0
  32. package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.d.ts.map +1 -1
  33. package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.js +0 -1
  34. package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.js.map +1 -1
  35. package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.tsx +0 -1
  36. package/dist/components/layout/AppSidebar.js +1 -1
  37. package/dist/components/layout/AppSidebar.js.map +1 -1
  38. package/dist/components/layout/AppSidebar.tsx +2 -2
  39. package/dist/resources/globals.css +78 -1
  40. package/dist/resources/solid-primereact.css +1 -1
  41. package/package.json +1 -1
  42. package/src/components/common/SolidBreadcrumb.tsx +5 -3
  43. package/src/components/core/common/SolidCreateButton.tsx +3 -6
  44. package/src/components/core/form/SolidFormView.tsx +12 -8
  45. package/src/components/core/list/SolidEmptyListViewPlaceholder.tsx +41 -0
  46. package/src/components/core/list/SolidListView.tsx +24 -4
  47. package/src/components/core/list/SolidListViewColumn.tsx +3 -0
  48. package/src/components/core/list/SolidListViewShimmerLoading.tsx +77 -0
  49. package/src/components/core/list/widgets/SolidShortTextAvatarWidget.tsx +0 -1
  50. package/src/components/layout/AppSidebar.tsx +2 -2
  51. package/src/resources/globals.css +78 -1
  52. package/src/resources/solid-primereact.css +1 -1
@@ -1,19 +1,16 @@
1
1
  'use client';
2
2
  import Link from 'next/link';
3
- import { usePathname, useRouter } from 'next/navigation';
3
+ import { usePathname } from 'next/navigation';
4
4
  import { Button } from 'primereact/button';
5
5
 
6
- export const SolidCreateButton = ({ url }: any) => {
7
- const router = useRouter();
6
+ export const SolidCreateButton = ({ url, title }: any) => {
8
7
  const pathName = usePathname();
9
-
10
8
  const createPath = url ? url : pathName.split('/').slice(0, -1).join('/') + '/form/new';
11
9
 
12
-
13
10
  return (
14
11
  <div>
15
12
  <Link href={createPath}>
16
- <Button type="button" icon="pi pi-plus" label="Add" size='small'></Button>
13
+ <Button type="button" icon="pi pi-plus" label={`Add ${title ? title : ''}`} size='small'></Button>
17
14
  </Link>
18
15
  </div>
19
16
  )
@@ -353,7 +353,6 @@ const SolidFormView = (params: SolidFormViewProps) => {
353
353
  const router = useRouter();
354
354
  const toast = useRef<Toast>(null);
355
355
  const searchParams = useSearchParams();
356
- const viewModeFromURL = searchParams.get("viewMode");
357
356
 
358
357
  const [redirectToList, setRedirectToList] = useState(false);
359
358
 
@@ -372,15 +371,20 @@ const SolidFormView = (params: SolidFormViewProps) => {
372
371
  const op = useRef(null);
373
372
 
374
373
  useEffect(() => {
375
- if (viewModeFromURL === "edit" || viewModeFromURL === "view") {
376
- setViewMode(viewModeFromURL);
377
- } else {
378
- setViewMode("view"); // Default to 'view' if not present
379
- }
374
+ const mode = searchParams.get('viewMode');
375
+
380
376
  if (params.id === 'new') {
381
- setViewMode("edit");
377
+ setViewMode('edit');
378
+ return;
379
+ }
380
+
381
+ // Set the viewMode based on the URL
382
+ if (mode === 'view' || mode === 'edit') {
383
+ setViewMode(mode);
384
+ } else {
385
+ setViewMode('view'); // Default to 'view' if no valid mode is provided
382
386
  }
383
- }, [viewModeFromURL]);
387
+ }, [searchParams, params.id]);
384
388
 
385
389
 
386
390
  // function that updates view mode
@@ -0,0 +1,41 @@
1
+ import { createPermission } from '@/helpers/permissions'
2
+ import { SolidCreateButton } from '../common/SolidCreateButton'
3
+ import Image from 'next/image'
4
+
5
+ export const SolidEmptyListViewPlaceholder = ({ createButtonUrl, actionsAllowed, params, solidListViewMetaData }: any) => {
6
+ const noDataText = solidListViewMetaData?.data?.solidView?.layout?.attrs?.listViewNoDataHelperText
7
+ ?? (process.env.NEXT_PUBLIC_DEFAULT_LIST_VIEW_NODATA_HELPER_TEXT && solidListViewMetaData?.data?.solidView?.displayName
8
+ ? `${process.env.NEXT_PUBLIC_DEFAULT_LIST_VIEW_NODATA_HELPER_TEXT} ${solidListViewMetaData.data.solidView.displayName}`
9
+ : null)
10
+ return (
11
+ <div className="page-parent-wrapper">
12
+ <div className="page-header">
13
+ <p className="m-0 view-title">{solidListViewMetaData?.data?.solidView?.displayName}</p>
14
+ </div>
15
+ <div className='solid-empty-listview-placeholder-container'>
16
+ {process.env.NEXT_PUBLIC_DEFAULT_LIST_VIEW_NODATA_IMAGE &&
17
+ <Image
18
+ alt={solidListViewMetaData?.data?.solidView?.displayName}
19
+ src={process.env.NEXT_PUBLIC_DEFAULT_LIST_VIEW_NODATA_IMAGE}
20
+ className='relative'
21
+ height={385}
22
+ width={617}
23
+ />
24
+ }
25
+ <div className='text-base font-bold'>
26
+ No Data Available.
27
+ </div>
28
+ {noDataText &&
29
+ <div className='text-sm mt-1'>
30
+ {noDataText}
31
+ </div>
32
+ }
33
+ {actionsAllowed.includes(`${createPermission(params.modelName)}`) && solidListViewMetaData?.data?.solidView?.layout?.attrs?.create !== false && params.embeded !== true &&
34
+ <div className='mt-2'>
35
+ <SolidCreateButton url={createButtonUrl} title={solidListViewMetaData?.data?.solidView?.displayName} />
36
+ </div>
37
+ }
38
+ </div>
39
+ </div>
40
+ )
41
+ }
@@ -43,6 +43,8 @@ import Download from "yet-another-react-lightbox/plugins/download";
43
43
  import "yet-another-react-lightbox/styles.css";
44
44
  import "yet-another-react-lightbox/plugins/counter.css";
45
45
  import { SolidListViewConfigure } from "./SolidListViewConfigure";
46
+ import { SolidListViewShimmerLoading } from "./SolidListViewShimmerLoading";
47
+ import { SolidEmptyListViewPlaceholder } from "./SolidEmptyListViewPlaceholder";
46
48
 
47
49
 
48
50
  const getRandomInt = (min: number, max: number) => {
@@ -708,6 +710,23 @@ export const SolidListView = (params: SolidListViewParams) => {
708
710
  setListViewRowActionPopupState(false)
709
711
  }
710
712
 
713
+ if (loading || isLoading) {
714
+ return <SolidListViewShimmerLoading />;
715
+ }
716
+
717
+ const isListViewEmptyWithoutFilters = !loading && (!filters || Object.keys(filters).length === 0) && listViewData.length === 0;
718
+
719
+ if (isListViewEmptyWithoutFilters) {
720
+ return (
721
+ <SolidEmptyListViewPlaceholder
722
+ createButtonUrl={createButtonUrl}
723
+ actionsAllowed={actionsAllowed}
724
+ params={params}
725
+ solidListViewMetaData={solidListViewMetaData}
726
+ />
727
+ );
728
+ }
729
+
711
730
  return (
712
731
  <div className="page-parent-wrapper">
713
732
  <div className="page-header">
@@ -791,8 +810,9 @@ export const SolidListView = (params: SolidListViewParams) => {
791
810
  onSort={(e: DataTableStateEvent) => onSort(e)}
792
811
  sortField={sortField}
793
812
  sortOrder={sortOrder === 1 || sortOrder === -1 ? sortOrder : 0}
794
- loading={loading || isLoading}
795
- loadingIcon="pi pi-spinner"
813
+ loading={false}
814
+ // loading={loading || isLoading}
815
+ // loadingIcon="pi pi-spinner"
796
816
  selection={[...selectedRecords, ...selectedRecoverRecords]}
797
817
  onSelectionChange={onSelectionChange}
798
818
  selectionMode="checkbox"
@@ -818,7 +838,7 @@ export const SolidListView = (params: SolidListViewParams) => {
818
838
  if (typeof window !== "undefined") {
819
839
  sessionStorage.setItem("fromView", "list");
820
840
  }
821
- router.push(`${editButtonUrl}/${rowData?.id}`);
841
+ router.push(`${editButtonUrl}/${rowData?.id}?viewMode=view`);
822
842
  }
823
843
  }}
824
844
  >
@@ -848,7 +868,7 @@ export const SolidListView = (params: SolidListViewParams) => {
848
868
  if (params.embeded == true) {
849
869
  params.handlePopUpOpen(selectedSolidViewData?.id);
850
870
  } else {
851
- router.push(`${editButtonUrl}/${selectedSolidViewData?.id}`)
871
+ router.push(`${editButtonUrl}/${selectedSolidViewData?.id}?viewMode=edit`)
852
872
  }
853
873
  }}
854
874
  />
@@ -100,6 +100,9 @@ export const SolidListViewColumn = ({ solidListViewMetaData, fieldMetadata, colu
100
100
  if (fieldMetadata.type === 'richText') {
101
101
  return SolidRichTextColumn({ solidListViewMetaData, fieldMetadata, column });
102
102
  }
103
+ if (fieldMetadata.type === 'email') {
104
+ return SolidShortTextColumn({ solidListViewMetaData, fieldMetadata, column });
105
+ }
103
106
  if (fieldMetadata.type === 'boolean') {
104
107
  return SolidBooleanColumn({ solidListViewMetaData, fieldMetadata, column });
105
108
  }
@@ -0,0 +1,77 @@
1
+ import { Skeleton } from 'primereact/skeleton'
2
+ import React from 'react'
3
+
4
+ export const SolidListViewShimmerLoading = () => {
5
+ const rows = Array.from({ length: 14 });
6
+ return (
7
+ <div className='h-screen surface-0'>
8
+ <div className="page-header">
9
+ <div className='flex align-items-center gap-3'>
10
+ <Skeleton width="50px" className='border-round-lg'></Skeleton>
11
+ <Skeleton width="300px" className='border-round-lg'></Skeleton>
12
+ </div>
13
+ <div className='flex align-items-center gap-3'>
14
+ <Skeleton width="4rem" height="2rem"></Skeleton>
15
+ <Skeleton width="4rem" height="2rem"></Skeleton>
16
+ </div>
17
+ </div>
18
+ <div className='solid-list-skeleton-wrapper'>
19
+ <table className="solid-list-skeleton-table" style={{ borderCollapse: 'collapse', width: '100%' }}>
20
+ <thead>
21
+ <tr className="solid-list-skeleton-header">
22
+ <th className="solid-list-skeleton-col-1">
23
+ <Skeleton width="16px" height='16px' className='border-round-xs' />
24
+ </th>
25
+ <th className="solid-list-skeleton-col-2">
26
+ <Skeleton width="70px" className='border-round-lg' />
27
+ </th>
28
+ <th className="solid-list-skeleton-col-3">
29
+ <Skeleton width="90px" className='border-round-lg' />
30
+ </th>
31
+ <th className="solid-list-skeleton-col-4">
32
+ <Skeleton width="80px" className='border-round-lg' />
33
+ </th>
34
+ <th className="solid-list-skeleton-col-5">
35
+ <Skeleton width="90px" className='border-round-lg' />
36
+ </th>
37
+ <th className="solid-list-skeleton-col-6">
38
+ <Skeleton width="100px" className='border-round-lg' />
39
+ </th>
40
+ <th className="solid-list-skeleton-col-7">
41
+ <Skeleton width="30px" className='border-round-lg' />
42
+ </th>
43
+ <th className="solid-list-skeleton-col-8">
44
+ <Skeleton width="30px" className='border-round-lg' />
45
+ </th>
46
+ </tr>
47
+ </thead>
48
+ <tbody>
49
+ {rows.map((_, i) => (
50
+ <tr className="solid-list-skeleton-row" key={i}>
51
+ <td><Skeleton width="16px" height='16px' className='border-round-xs'/></td>
52
+ <td><Skeleton width="50%" /></td>
53
+ <td><Skeleton width="50%" /></td>
54
+ <td><Skeleton width="50%" /></td>
55
+ <td><Skeleton width="50%" /></td>
56
+ <td><Skeleton width="50%" /></td>
57
+ <td><Skeleton shape="circle" height='15px' width='15px' /></td>
58
+ <td><Skeleton width="5px" height='20px' /></td>
59
+ </tr>
60
+ ))}
61
+ </tbody>
62
+ </table>
63
+ <div className='solid-list-skeleton-footer flex align-items-center justify-content-between'>
64
+ <div className='flex align-items-center gap-3'>
65
+ <Skeleton width="5rem" height="1rem"></Skeleton>
66
+ <Skeleton width="30px" height='15px' className='border-round-sm'></Skeleton>
67
+ </div>
68
+ <div className='flex align-items-center gap-3'>
69
+ <Skeleton width="70px"></Skeleton>
70
+ <Skeleton width="10px" height='15px' className='border-round-sm'></Skeleton>
71
+ <Skeleton width="15px" height='15px' className='border-round-sm'></Skeleton>
72
+ </div>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ )
77
+ }
@@ -46,7 +46,6 @@ export const SolidShortTextAvatarWidget = ({ rowData, solidListViewMetaData, fie
46
46
  justifyContent: 'center',
47
47
  fontWeight: 600,
48
48
  fontSize: 12,
49
- boxShadow: '0 0 0 2px rgba(0,0,0,0.1)',
50
49
  }}
51
50
  >
52
51
  {initials}
@@ -188,7 +188,7 @@ const AppSidebar = () => {
188
188
  <div className={`sidebar-right ${visibleNavbar ? "open" : ""}`}>
189
189
 
190
190
  <div className="flex relative justify-content-between align-items-center py-4 px-3">
191
- <div className="text-base font-semibold">{currentMainMenu && currentMainMenu}</div>
191
+ <div className="text-base sidebar-title font-semibold">{currentMainMenu && currentMainMenu}</div>
192
192
  {/* <button
193
193
  className="sidebar-toggle-button"
194
194
  onClick={handleToggle}
@@ -213,7 +213,7 @@ const AppSidebar = () => {
213
213
  />
214
214
  </div>
215
215
  </div> */}
216
- <div className="px-3">
216
+ <div className="px-3 solid-sidebar-menuitems-wrapper">
217
217
  <NavbarTwoMenu menuItems={currentMenu}></NavbarTwoMenu>
218
218
  </div>
219
219
  </div>
@@ -3112,7 +3112,84 @@ flex-shrink: 0; */
3112
3112
  }
3113
3113
 
3114
3114
  .solid-global-search-element input {
3115
-
3116
3115
  min-width: 300px;
3116
+ }
3117
+
3118
+ .solid-empty-listview-placeholder-container {
3119
+ border-top: 1px solid var(--primary-light-color) !important;
3120
+ height: calc(100vh - 54px);
3121
+ background-color: var(--solid-list-view-placeholder);
3122
+ display: flex;
3123
+ flex-direction: column;
3124
+ align-items: center;
3125
+ justify-content: center;
3126
+ gap: 12px;
3127
+ }
3128
+
3129
+ .solid-list-skeleton-wrapper {
3130
+ height: calc(100vh - 60px);
3131
+ display: flex;
3132
+ flex-direction: column;
3133
+ justify-content: space-between;
3134
+ }
3135
+
3136
+ .solid-list-skeleton-col-1 {
3137
+ width: 50px;
3138
+ }
3139
+
3140
+ .solid-list-skeleton-col-2 {
3141
+ width: 120px;
3142
+ }
3143
+
3144
+ .solid-list-skeleton-col-8 {
3145
+ width: 50px;
3146
+ }
3147
+
3148
+ .solid-list-skeleton-col-3,
3149
+ .solid-list-skeleton-col-4,
3150
+ .solid-list-skeleton-col-5,
3151
+ .solid-list-skeleton-col-6 {
3152
+ width: auto;
3153
+ }
3154
+
3155
+ .solid-list-skeleton-header th {
3156
+ border-top: 1px solid #CED0D6;
3157
+ border-bottom: 1px solid #CED0D6;
3158
+ text-align: left;
3159
+ padding: 8px 15px;
3160
+ height: 45px;
3161
+ position: relative;
3162
+ }
3163
+
3164
+ .solid-list-skeleton-header th::after {
3165
+ content: '';
3166
+ position: absolute;
3167
+ right: 0;
3168
+ top: 50%;
3169
+ transform: translateY(-50%);
3170
+ height: 60%;
3171
+ width: 0.0625rem;
3172
+ background-color: #D8E2EA
3173
+ }
3174
+
3175
+ .solid-list-skeleton-row td {
3176
+ border-bottom: 1px solid rgba(216, 226, 234, 0.40);
3177
+ padding: 8px 15px;
3178
+ height: 45px;
3179
+ vertical-align: middle;
3180
+ }
3117
3181
 
3182
+ .solid-list-skeleton-row td .p-skeleton {
3183
+ height: 1rem;
3184
+ /* Set skeleton height to 0.75rem */
3185
+ }
3186
+
3187
+ .solid-list-skeleton-footer {
3188
+ border-top: 1px solid rgba(216, 226, 234, 0.40);
3189
+ padding: 20px;
3190
+ }
3191
+
3192
+ .solid-sidebar-menuitems-wrapper {
3193
+ height: calc(100vh - 64px);
3194
+ overflow-y: auto;
3118
3195
  }
@@ -1312,7 +1312,7 @@
1312
1312
  }
1313
1313
 
1314
1314
  .p-datatable .p-paginator-bottom {
1315
- border-width: 1px 0 1px 0;
1315
+ border-width: 1px 0 0 0;
1316
1316
  border-radius: 0;
1317
1317
  }
1318
1318