@applica-software-guru/react-admin 1.5.320 → 1.5.321
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/ra-lists/ListView.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +27 -27
- package/dist/react-admin.cjs.js.gz +0 -0
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +631 -612
- package/dist/react-admin.es.js.gz +0 -0
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +27 -27
- package/dist/react-admin.umd.js.gz +0 -0
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ra-lists/ListView.tsx +25 -4
package/package.json
CHANGED
|
@@ -48,7 +48,7 @@ function ListView<RecordType extends RaRecord = any>(props: ListViewProps): Reac
|
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
function renderList() {
|
|
51
|
+
function renderList(shouldRenderEmptyList: boolean) {
|
|
52
52
|
return (
|
|
53
53
|
<div
|
|
54
54
|
className={ListClasses.main}
|
|
@@ -73,7 +73,7 @@ function ListView<RecordType extends RaRecord = any>(props: ListViewProps): Reac
|
|
|
73
73
|
/>
|
|
74
74
|
) : null}
|
|
75
75
|
{!error && (
|
|
76
|
-
<Content className={ListClasses.content}>
|
|
76
|
+
<Content className={ListClasses.content} sx={shouldRenderEmptyList ? { background: 'transparent' } : {}}>
|
|
77
77
|
{bulkActionButtons && children && React.isValidElement<any>(children)
|
|
78
78
|
? cloneElement(children, { bulkActionButtons })
|
|
79
79
|
: children}
|
|
@@ -97,6 +97,8 @@ function ListView<RecordType extends RaRecord = any>(props: ListViewProps): Reac
|
|
|
97
97
|
return empty !== false && cloneElement(empty, { className: ListClasses.noResults, hasCreate });
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
const shouldRenderEmptyList = !isLoading && data?.length === 0;
|
|
101
|
+
|
|
100
102
|
const shouldRenderEmptyPage =
|
|
101
103
|
!isLoading && data?.length === 0 && !Object.keys(filterValues).length && empty !== false;
|
|
102
104
|
|
|
@@ -113,7 +115,26 @@ function ListView<RecordType extends RaRecord = any>(props: ListViewProps): Reac
|
|
|
113
115
|
const wrapperProps =
|
|
114
116
|
!isLoading && !shouldRenderEmptyPage && (!aside || isFilterSidebar) ? { content: false } : undefined;
|
|
115
117
|
return (
|
|
116
|
-
<Root
|
|
118
|
+
<Root
|
|
119
|
+
className={clsx('list-page', className)}
|
|
120
|
+
{...rest}
|
|
121
|
+
sx={
|
|
122
|
+
shouldRenderEmptyList
|
|
123
|
+
? {
|
|
124
|
+
'& .MuiPaper-root': {
|
|
125
|
+
backgroundColor: 'transparent',
|
|
126
|
+
border: 'none'
|
|
127
|
+
},
|
|
128
|
+
'& .RaList-actions': {
|
|
129
|
+
border: '1px solid',
|
|
130
|
+
borderRadius: `${theme.shape.borderRadius}px`,
|
|
131
|
+
borderColor: theme.palette.mode === 'dark' ? theme.palette.divider : theme.palette.grey.A800,
|
|
132
|
+
backgroundColor: theme.palette.background.paper
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
: {}
|
|
136
|
+
}
|
|
137
|
+
>
|
|
117
138
|
<Title title={title} defaultTitle={defaultTitle} preferenceKey={`${resource}.list.title`} />
|
|
118
139
|
<Wrapper {...wrapperProps}>
|
|
119
140
|
{isLoading ? (
|
|
@@ -129,7 +150,7 @@ function ListView<RecordType extends RaRecord = any>(props: ListViewProps): Reac
|
|
|
129
150
|
) : shouldRenderEmptyPage ? (
|
|
130
151
|
renderEmpty()
|
|
131
152
|
) : (
|
|
132
|
-
renderList()
|
|
153
|
+
renderList(shouldRenderEmptyList)
|
|
133
154
|
)}
|
|
134
155
|
</Wrapper>
|
|
135
156
|
{hasAsideSidebar ? <AsideCard aside={aside} /> : null}
|