@solidstarters/solid-core-ui 1.1.71 → 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.
- package/dist/components/auth/AuthLayout.js +3 -3
- package/dist/components/auth/AuthLayout.js.map +1 -1
- package/dist/components/auth/AuthLayout.tsx +3 -3
- package/dist/components/auth/SolidLogin.js +5 -5
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidLogin.tsx +6 -6
- package/dist/components/auth/SolidRegister.js +4 -4
- package/dist/components/auth/SolidRegister.js.map +1 -1
- package/dist/components/auth/SolidRegister.tsx +5 -5
- package/dist/components/common/GeneralSettings.d.ts.map +1 -1
- package/dist/components/common/GeneralSettings.js +48 -48
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/common/GeneralSettings.tsx +293 -285
- package/dist/components/common/SolidBreadcrumb.d.ts.map +1 -1
- package/dist/components/common/SolidBreadcrumb.js +5 -3
- package/dist/components/common/SolidBreadcrumb.js.map +1 -1
- package/dist/components/common/SolidBreadcrumb.tsx +5 -3
- package/dist/components/core/common/SolidCreateButton.d.ts +1 -1
- package/dist/components/core/common/SolidCreateButton.d.ts.map +1 -1
- package/dist/components/core/common/SolidCreateButton.js +3 -4
- package/dist/components/core/common/SolidCreateButton.js.map +1 -1
- package/dist/components/core/common/SolidCreateButton.tsx +3 -6
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +10 -8
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +12 -8
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.d.ts +2 -0
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.d.ts.map +1 -0
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.js +16 -0
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.js.map +1 -0
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.tsx +41 -0
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +15 -3
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +24 -4
- package/dist/components/core/list/SolidListViewColumn.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewColumn.js +3 -0
- package/dist/components/core/list/SolidListViewColumn.js.map +1 -1
- package/dist/components/core/list/SolidListViewColumn.tsx +3 -0
- package/dist/components/core/list/SolidListViewShimmerLoading.d.ts +2 -0
- package/dist/components/core/list/SolidListViewShimmerLoading.d.ts.map +1 -0
- package/dist/components/core/list/SolidListViewShimmerLoading.js +7 -0
- package/dist/components/core/list/SolidListViewShimmerLoading.js.map +1 -0
- package/dist/components/core/list/SolidListViewShimmerLoading.tsx +77 -0
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.d.ts.map +1 -1
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.js +0 -1
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.js.map +1 -1
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.tsx +0 -1
- package/dist/components/core/users/CreateUser.d.ts.map +1 -1
- package/dist/components/core/users/CreateUser.js +16 -16
- package/dist/components/core/users/CreateUser.js.map +1 -1
- package/dist/components/core/users/CreateUser.tsx +173 -171
- package/dist/components/layout/AppSidebar.js +1 -1
- package/dist/components/layout/AppSidebar.js.map +1 -1
- package/dist/components/layout/AppSidebar.tsx +2 -2
- package/dist/helpers/registry.js +2 -1
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +2 -1
- package/dist/redux/api/solidSettingsApi.d.ts +2 -1
- package/dist/redux/api/solidSettingsApi.d.ts.map +1 -1
- package/dist/redux/api/solidSettingsApi.js +11 -1
- package/dist/redux/api/solidSettingsApi.js.map +1 -1
- package/dist/redux/api/solidSettingsApi.tsx +8 -0
- package/dist/resources/globals.css +78 -1
- package/dist/resources/solid-primereact.css +1 -1
- package/package.json +1 -1
- package/src/components/auth/AuthLayout.tsx +3 -3
- package/src/components/auth/SolidLogin.tsx +6 -6
- package/src/components/auth/SolidRegister.tsx +5 -5
- package/src/components/common/GeneralSettings.tsx +293 -285
- package/src/components/common/SolidBreadcrumb.tsx +5 -3
- package/src/components/core/common/SolidCreateButton.tsx +3 -6
- package/src/components/core/form/SolidFormView.tsx +12 -8
- package/src/components/core/list/SolidEmptyListViewPlaceholder.tsx +41 -0
- package/src/components/core/list/SolidListView.tsx +24 -4
- package/src/components/core/list/SolidListViewColumn.tsx +3 -0
- package/src/components/core/list/SolidListViewShimmerLoading.tsx +77 -0
- package/src/components/core/list/widgets/SolidShortTextAvatarWidget.tsx +0 -1
- package/src/components/core/users/CreateUser.tsx +173 -171
- package/src/components/layout/AppSidebar.tsx +2 -2
- package/src/helpers/registry.ts +2 -1
- package/src/redux/api/solidSettingsApi.tsx +8 -0
- package/src/resources/globals.css +78 -1
- package/src/resources/solid-primereact.css +1 -1
|
@@ -36,8 +36,10 @@ export const SolidBreadcrumb = (props: Props) => {
|
|
|
36
36
|
|
|
37
37
|
useEffect(() => {
|
|
38
38
|
if (segments.length === 6 && segments[4] === "form" && userKeyFieldValue && !queryUserKeyField) {
|
|
39
|
-
const
|
|
40
|
-
|
|
39
|
+
const params = new URLSearchParams(searchParams.toString());
|
|
40
|
+
params.set("userKeyField", userKeyFieldValue);
|
|
41
|
+
const newUrl = `${pathname}?${params.toString()}`;
|
|
42
|
+
router.push(newUrl, { scroll: false });
|
|
41
43
|
}
|
|
42
44
|
}, [pathname, userKeyFieldValue, queryUserKeyField, router]);
|
|
43
45
|
|
|
@@ -81,7 +83,7 @@ export const SolidBreadcrumb = (props: Props) => {
|
|
|
81
83
|
|
|
82
84
|
if (segments.length === 6 && segments[4] === "form") {
|
|
83
85
|
breadcrumbItems.push({
|
|
84
|
-
label: queryUserKeyField
|
|
86
|
+
label: queryUserKeyField ? decodeURIComponent(queryUserKeyField) : segments[5],
|
|
85
87
|
});
|
|
86
88
|
}
|
|
87
89
|
}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import Link from 'next/link';
|
|
3
|
-
import { usePathname
|
|
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
|
-
|
|
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
|
-
|
|
376
|
-
|
|
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(
|
|
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
|
-
}, [
|
|
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={
|
|
795
|
-
|
|
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
|
+
}
|