@dashadmin/dash-components 1.3.25 → 1.3.28
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/README.md +35 -0
- package/dist/components/AuditLog/AuditLog.js +345 -1
- package/dist/components/AuditLog/index.js +4 -1
- package/dist/components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput.js +630 -3
- package/dist/components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput.js +53 -1
- package/dist/components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput.js +647 -3
- package/dist/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput.js +53 -1
- package/dist/components/Json/Json.js +235 -1
- package/dist/components/JsonColorSelector/JsonColorSelector.js +1172 -1
- package/dist/components/JsonColorSelector/JsonColorSelectorEnhanced.js +863 -2
- package/dist/components/JsonColorSelector/JsonCssVarValues.js +738 -1
- package/dist/components/JsonColorSelector/components/ColorEditDialog.js +426 -1
- package/dist/components/JsonColorSelector/components/ColorPaletteItem.js +75 -1
- package/dist/components/JsonColorSelector/components/ImageColorExtractor.js +283 -1
- package/dist/components/JsonColorSelector/helpers/functions.js +101 -1
- package/dist/components/JsonColorSelector/useAsyncColorThief.js +105 -1
- package/dist/components/ListActive/ListActive.js +126 -1
- package/dist/components/ListActive/ListBoolean.js +124 -1
- package/dist/components/NotificationPreferences/NotificationPreferences.js +317 -1
- package/dist/components/NotificationPreferences/index.js +7 -1
- package/dist/components/SearchableSelects/RASearchableSelect.js +236 -1
- package/dist/components/SearchableSelects/RASearchableSelectCheckboxes.js +479 -1
- package/dist/components/SearchableSelects/RASearchableSelectChips.js +465 -1
- package/dist/components/SearchableSelects/RASearchableSelectChipsRecordContext.js +295 -1
- package/dist/components/SearchableSelects/SearchableSelect.js +202 -1
- package/dist/components/SearchableSelects/SearchableSelectCheckboxes.js +290 -1
- package/dist/components/SortableDataGrid/SortableDataGrid.js +72 -1
- package/dist/components/SortableDataGrid/SortableDataGridBody.js +167 -1
- package/dist/components/SortableDataGrid/SortableDataGridHeader.js +109 -1
- package/dist/components/SortableDataGrid/SortableDataGridRow.js +283 -1
- package/dist/components/Upload/SingleImageUploader.js +40 -1
- package/dist/components/custom/PackageCopyMethod.js +78 -1
- package/dist/components/custom/PackageRadioButtonGroup.js +45 -1
- package/dist/components/dialog/Basic.js +8 -1
- package/dist/components/dialog/Correct.js +14 -1
- package/dist/components/dialog/Error.js +14 -1
- package/dist/components/dialog/Info.js +14 -1
- package/dist/components/dialog/InfoV2.js +21 -1
- package/dist/components/dialog/NotFound.js +14 -1
- package/dist/components/dialog/QuickSearch.js +117 -1
- package/dist/components/notifications/NotificationsCenter.js +597 -1
- package/dist/components/notifications/index.js +24 -1
- package/dist/components/tables/PaginationComponent.js +36 -1
- package/dist/components/theme/AppLoadingFallback.js +38 -2
- package/dist/components/theme/ErrorBoundary.js +52 -1
- package/dist/components/theme/InitialLoader.js +13 -1
- package/dist/components/theme/NotFound.js +136 -1
- package/dist/components/theme/NotResults.js +38 -1
- package/dist/hooks/useDraggable.js +6 -1
- package/dist/hooks/useNotifications.js +8 -1
- package/dist/hooks/useQuickSearch.js +26 -1
- package/dist/index.js +66 -5567
- package/dist/utils/setNativeValue.js +17 -1
- package/package.json +148 -132
- package/src/components/AuditLog/AuditLog.tsx +476 -0
- package/src/components/AuditLog/index.ts +2 -0
- package/src/components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput.tsx +917 -0
- package/src/components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput.tsx +39 -0
- package/src/components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput.tsx +916 -0
- package/src/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput.tsx +44 -0
- package/src/components/Json/Json.tsx +312 -0
- package/src/components/JsonColorSelector/JsonColorSelector.tsx +1435 -0
- package/src/components/JsonColorSelector/JsonColorSelectorEnhanced.tsx +1029 -0
- package/src/components/JsonColorSelector/JsonCssVarValues.tsx +863 -0
- package/src/components/JsonColorSelector/components/ColorEditDialog.tsx +491 -0
- package/src/components/JsonColorSelector/components/ColorPaletteItem.tsx +80 -0
- package/src/components/JsonColorSelector/components/ImageColorExtractor.tsx +328 -0
- package/src/components/JsonColorSelector/helpers/functions.tsx +123 -0
- package/src/components/JsonColorSelector/interfaces/interfaces.tsx +22 -0
- package/src/components/JsonColorSelector/useAsyncColorThief.tsx +97 -0
- package/src/components/ListActive/ListActive.tsx +106 -0
- package/src/components/ListActive/ListBoolean.tsx +96 -0
- package/src/components/NotificationPreferences/NotificationPreferences.tsx +463 -0
- package/src/components/NotificationPreferences/index.tsx +2 -0
- package/src/components/SearchableSelects/RASearchableSelect.tsx +300 -0
- package/src/components/SearchableSelects/RASearchableSelectCheckboxes.tsx +604 -0
- package/src/components/SearchableSelects/RASearchableSelectChips.tsx +558 -0
- package/src/components/SearchableSelects/RASearchableSelectChipsRecordContext.tsx +362 -0
- package/src/components/SearchableSelects/SearchableSelect.tsx +321 -0
- package/src/components/SearchableSelects/SearchableSelectCheckboxes.tsx +355 -0
- package/src/components/SortableDataGrid/SortableDataGrid.tsx +56 -0
- package/src/components/SortableDataGrid/SortableDataGridBody.tsx +175 -0
- package/src/components/SortableDataGrid/SortableDataGridHeader.tsx +171 -0
- package/src/components/SortableDataGrid/SortableDataGridRow.tsx +247 -0
- package/src/components/Upload/SingleImageUploader.tsx +55 -0
- package/src/components/custom/PackageCopyMethod.tsx +109 -0
- package/src/components/custom/PackageRadioButtonGroup.tsx +47 -0
- package/src/components/dialog/Basic.tsx +11 -0
- package/src/components/dialog/Correct.tsx +16 -0
- package/src/components/dialog/Error.tsx +15 -0
- package/src/components/dialog/Info.tsx +15 -0
- package/src/components/dialog/InfoV2.tsx +35 -0
- package/src/components/dialog/NotFound.tsx +18 -0
- package/src/components/dialog/QuickSearch.tsx +115 -0
- package/src/components/notifications/NotificationsCenter.tsx +792 -0
- package/src/components/notifications/index.ts +42 -0
- package/src/components/tables/PaginationComponent.tsx +17 -0
- package/src/components/theme/AppLoadingFallback.tsx +42 -0
- package/src/components/theme/ErrorBoundary.tsx +57 -0
- package/src/components/theme/InitialLoader.tsx +16 -0
- package/src/components/theme/NotFound.tsx +124 -0
- package/src/components/theme/NotResults.tsx +54 -0
- package/src/hooks/useDraggable.ts +11 -0
- package/src/hooks/useNotifications.ts +14 -0
- package/src/hooks/useQuickSearch.tsx +29 -0
- package/src/index.tsx +77 -0
- package/src/utils/setNativeValue.tsx +23 -0
- package/dist/color-thief-CTwGFhOB.js +0 -272
- /package/{dist → src}/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayAutoSearch.tsx.wip +0 -0
- /package/{dist → src}/components/JsonColorSelector/JsonColorSelector.tsx.bkup +0 -0
- /package/{dist → src}/components/SortableDataGrid/README.md +0 -0
- /package/{dist → src}/styles/index.less +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notifications Components
|
|
3
|
+
*
|
|
4
|
+
* A comprehensive notification system for React applications
|
|
5
|
+
* Includes toast notifications, notification menus, and draggable dialog notifications
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
// Main Component
|
|
10
|
+
NotificationsCenter,
|
|
11
|
+
|
|
12
|
+
// Sub-components
|
|
13
|
+
NotificationButton,
|
|
14
|
+
NotificationsMenu,
|
|
15
|
+
NotificationMenuItem,
|
|
16
|
+
ToastNotificationsStack,
|
|
17
|
+
DraggableNotificationDialog,
|
|
18
|
+
|
|
19
|
+
// Hook
|
|
20
|
+
useNotificationsCenter,
|
|
21
|
+
|
|
22
|
+
// Utilities
|
|
23
|
+
formatTimeAgo,
|
|
24
|
+
generateNotificationId,
|
|
25
|
+
|
|
26
|
+
// Types
|
|
27
|
+
type NotificationData,
|
|
28
|
+
type ToastNotification,
|
|
29
|
+
type DialogNotification,
|
|
30
|
+
type NotificationsCenterConfig,
|
|
31
|
+
type NotificationsCenterLabels,
|
|
32
|
+
type NotificationsCenterIcons,
|
|
33
|
+
type NotificationButtonProps,
|
|
34
|
+
type NotificationsMenuProps,
|
|
35
|
+
type NotificationMenuItemProps,
|
|
36
|
+
type ToastNotificationsStackProps,
|
|
37
|
+
type DraggableNotificationDialogProps,
|
|
38
|
+
type NotificationsCenterProps,
|
|
39
|
+
type UseNotificationsCenterReturn,
|
|
40
|
+
} from './NotificationsCenter';
|
|
41
|
+
|
|
42
|
+
export { default } from './NotificationsCenter';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Pagination, PaginationProps } from 'react-admin';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Portal } from '@mui/material';
|
|
5
|
+
|
|
6
|
+
const PaginationComponent:FC<PaginationProps> = (props) => {
|
|
7
|
+
return <div
|
|
8
|
+
className='dash-pagination-component'
|
|
9
|
+
>
|
|
10
|
+
<Pagination
|
|
11
|
+
rowsPerPageOptions={[10,25, 50, 100, 250, 500, 1000]}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default PaginationComponent;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface AppLoadingFallbackProps {
|
|
4
|
+
message?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const AppLoadingFallback: React.FC<AppLoadingFallbackProps> = ({ message = "Loading..." }) => (
|
|
8
|
+
<div
|
|
9
|
+
style={{
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexDirection: 'column',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
minHeight: '100vh',
|
|
15
|
+
gap: '16px',
|
|
16
|
+
background: 'linear-gradient(to bottom, var(--bodybg-primary), var(--bodybg-secondary))',
|
|
17
|
+
color: 'var(--text-color, @text-color--dark)'
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
<div
|
|
21
|
+
style={{
|
|
22
|
+
width: '60px',
|
|
23
|
+
height: '60px',
|
|
24
|
+
border: '4px solid rgba(255, 255, 255, 0.3)',
|
|
25
|
+
borderTop: '4px solid #ffffff',
|
|
26
|
+
borderRadius: '50%',
|
|
27
|
+
animation: 'spin 1s linear infinite'
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
<h6 style={{ margin: 0, fontSize: '1.25rem', fontWeight: 500 }}>
|
|
31
|
+
{message}
|
|
32
|
+
</h6>
|
|
33
|
+
<style>{`
|
|
34
|
+
@keyframes spin {
|
|
35
|
+
0% { transform: rotate(0deg); }
|
|
36
|
+
100% { transform: rotate(360deg); }
|
|
37
|
+
}
|
|
38
|
+
`}</style>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
export default AppLoadingFallback;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ErrorBoundaryState {
|
|
4
|
+
hasError: boolean;
|
|
5
|
+
error?: Error;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
class ErrorBoundary extends React.Component<{ children: React.ReactNode }, ErrorBoundaryState> {
|
|
9
|
+
constructor(props: { children: React.ReactNode }) {
|
|
10
|
+
super(props);
|
|
11
|
+
this.state = { hasError: false };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static getDerivedStateFromError(error: Error) {
|
|
15
|
+
return { hasError: true, error };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
|
|
19
|
+
console.error('Error:', error, errorInfo);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
render() {
|
|
23
|
+
if (this.state.hasError) {
|
|
24
|
+
return (
|
|
25
|
+
<div style={{
|
|
26
|
+
display: 'flex',
|
|
27
|
+
justifyContent: 'center',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
height: '100vh',
|
|
30
|
+
backgroundColor: '#121212',
|
|
31
|
+
color: '#ffffff',
|
|
32
|
+
flexDirection: 'column',
|
|
33
|
+
gap: '20px'
|
|
34
|
+
}}>
|
|
35
|
+
<h2>Error</h2>
|
|
36
|
+
<p>{this.state.error?.message}</p>
|
|
37
|
+
<button
|
|
38
|
+
onClick={() => window.location.reload()}
|
|
39
|
+
style={{
|
|
40
|
+
padding: '10px 20px',
|
|
41
|
+
backgroundColor: '#007bff',
|
|
42
|
+
color: 'white',
|
|
43
|
+
border: 'none',
|
|
44
|
+
borderRadius: '4px',
|
|
45
|
+
cursor: 'pointer'
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
Reload Page
|
|
49
|
+
</button>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
return this.props.children;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default ErrorBoundary;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const InitialLoader: React.FC = () => (
|
|
4
|
+
<div style={{
|
|
5
|
+
display: 'flex',
|
|
6
|
+
justifyContent: 'center',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
height: '100vh',
|
|
9
|
+
background: 'linear-gradient(to bottom, var(--bodybg-primary), var(--bodybg-secondary))',
|
|
10
|
+
color: 'var(--text-color, @text-color--dark)'
|
|
11
|
+
}}>
|
|
12
|
+
<div>Loading...</div>
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export default InitialLoader;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
TitleComponent,
|
|
4
|
+
} from 'react-admin';
|
|
5
|
+
|
|
6
|
+
import { Button } from '@mui/material';
|
|
7
|
+
import ErrorOutline from '@mui/icons-material/ErrorOutline'
|
|
8
|
+
import { useNavigate } from 'react-router';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
function goBack() {
|
|
12
|
+
window.history.go(-1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const sanitizeRestProps = ({
|
|
16
|
+
staticContext,
|
|
17
|
+
history,
|
|
18
|
+
location,
|
|
19
|
+
match,
|
|
20
|
+
...rest
|
|
21
|
+
}) => rest;
|
|
22
|
+
|
|
23
|
+
// 🆕 Enhanced interface with new optional props
|
|
24
|
+
interface NotFoundProps {
|
|
25
|
+
title?: TitleComponent;
|
|
26
|
+
time?: number;
|
|
27
|
+
redirect?: string | null;
|
|
28
|
+
disableCountdown?: boolean; // 🆕 Disable countdown functionality
|
|
29
|
+
disableGoBack?: boolean; // 🆕 Disable go back button
|
|
30
|
+
customMessage?: string; // 🆕 Optional custom message
|
|
31
|
+
customButtonText?: string; // 🆕 Optional custom button text
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const NotFound /* :CatchAllComponent */ = (props: NotFoundProps) => {
|
|
35
|
+
const {
|
|
36
|
+
title,
|
|
37
|
+
time = false,
|
|
38
|
+
redirect = null,
|
|
39
|
+
disableCountdown = false, // 🆕 Default to false (countdown enabled)
|
|
40
|
+
disableGoBack = false, // 🆕 Default to false (go back enabled)
|
|
41
|
+
customMessage, // 🆕 Optional custom message
|
|
42
|
+
customButtonText, // 🆕 Optional custom button text
|
|
43
|
+
...rest
|
|
44
|
+
} = props;
|
|
45
|
+
|
|
46
|
+
const [countdown, setCountdown] = React.useState<number>(time || 0);
|
|
47
|
+
const navigate = useNavigate();
|
|
48
|
+
|
|
49
|
+
// 🆕 Only setup countdown if not disabled and time is provided
|
|
50
|
+
React.useEffect(() => {
|
|
51
|
+
if (!disableCountdown && typeof time === 'number' && time > 0) {
|
|
52
|
+
const timer = setInterval(() => {
|
|
53
|
+
setCountdown((prev) => {
|
|
54
|
+
if (prev <= 1) {
|
|
55
|
+
const currentPath = window.location.pathname;
|
|
56
|
+
navigate(`${redirect || '/'}?redirect=${encodeURIComponent(currentPath)}`);
|
|
57
|
+
return 0;
|
|
58
|
+
}
|
|
59
|
+
return prev - 1;
|
|
60
|
+
});
|
|
61
|
+
}, 1000);
|
|
62
|
+
return () => clearInterval(timer);
|
|
63
|
+
}
|
|
64
|
+
}, [time, navigate, redirect, disableCountdown]);
|
|
65
|
+
|
|
66
|
+
React.useEffect(() => {
|
|
67
|
+
//DASHAuthenticationService.setPendingRedirect(window.location.pathname);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// 🆕 Determine if countdown should be shown
|
|
71
|
+
const shouldShowCountdown = !disableCountdown && time && time > 0;
|
|
72
|
+
|
|
73
|
+
// 🆕 Determine button text and action
|
|
74
|
+
const getButtonConfig = () => {
|
|
75
|
+
if (disableGoBack) {
|
|
76
|
+
return null; // No button
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
text: customButtonText || 'Aceptar',
|
|
81
|
+
action: goBack
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const buttonConfig = getButtonConfig();
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<div
|
|
89
|
+
className={'dash-app-module not-found'}
|
|
90
|
+
{...sanitizeRestProps(rest as any)}
|
|
91
|
+
>
|
|
92
|
+
<div className='dash-app-notfound'>
|
|
93
|
+
<div className='dash-app-notfound-img'>
|
|
94
|
+
<ErrorOutline sx={{ fontSize: 300 }} />
|
|
95
|
+
</div>
|
|
96
|
+
<div className='dash-app-notfound-content'>
|
|
97
|
+
<h1>Oops!</h1>
|
|
98
|
+
<span>
|
|
99
|
+
{customMessage || 'No encontramos este enlace.'}
|
|
100
|
+
</span>
|
|
101
|
+
|
|
102
|
+
{/* 🆕 Conditional countdown display */}
|
|
103
|
+
{shouldShowCountdown && (
|
|
104
|
+
<p style={{ fontSize: '0.9em', color: '#666' }}>
|
|
105
|
+
Serás redirigido en {countdown} segundos...
|
|
106
|
+
</p>
|
|
107
|
+
)}
|
|
108
|
+
|
|
109
|
+
{/* 🆕 Conditional button display */}
|
|
110
|
+
{buttonConfig && (
|
|
111
|
+
<Button
|
|
112
|
+
color={'primary'}
|
|
113
|
+
onClick={buttonConfig.action}
|
|
114
|
+
>
|
|
115
|
+
{buttonConfig.text}
|
|
116
|
+
</Button>
|
|
117
|
+
)}
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export default NotFound;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Card, CardContent, Typography } from '@mui/material';
|
|
3
|
+
import InfoIcon from '@mui/icons-material/Info';
|
|
4
|
+
|
|
5
|
+
export interface INoResults extends React.PropsWithChildren {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const NoResults: React.FC<INoResults> = React.memo((props) => {
|
|
11
|
+
const { title, description, children } = props;
|
|
12
|
+
|
|
13
|
+
// Memoize styles to prevent recalculation on every render
|
|
14
|
+
const styles = React.useMemo(() => ({
|
|
15
|
+
card: { p: 0 },
|
|
16
|
+
cardContent: {
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
alignItems: 'left',
|
|
20
|
+
gap: 2
|
|
21
|
+
},
|
|
22
|
+
header: {
|
|
23
|
+
display: 'flex',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
gap: 2
|
|
26
|
+
},
|
|
27
|
+
icon: { fontSize: 32 }
|
|
28
|
+
}), []);
|
|
29
|
+
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
console.log("Reloaded");
|
|
32
|
+
},[])
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Card sx={styles.card}>
|
|
36
|
+
<CardContent sx={styles.cardContent}>
|
|
37
|
+
<div style={styles.header}>
|
|
38
|
+
<InfoIcon sx={styles.icon} />
|
|
39
|
+
{title && <Typography variant="h5">{title}</Typography>}
|
|
40
|
+
</div>
|
|
41
|
+
{description && (
|
|
42
|
+
<Typography variant="body1" color="text.secondary">
|
|
43
|
+
{description}
|
|
44
|
+
</Typography>
|
|
45
|
+
)}
|
|
46
|
+
{children}
|
|
47
|
+
</CardContent>
|
|
48
|
+
</Card>
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
NoResults.displayName = 'NoResults';
|
|
53
|
+
|
|
54
|
+
export default NoResults;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import from 'dash-utils' instead
|
|
3
|
+
* Re-exported for backward compatibility
|
|
4
|
+
*/
|
|
5
|
+
export {
|
|
6
|
+
useNotifications,
|
|
7
|
+
type ProcessedNotification,
|
|
8
|
+
type ToastNotification,
|
|
9
|
+
type DialogNotification,
|
|
10
|
+
type UseNotificationsOptions,
|
|
11
|
+
type UseNotificationsReturn
|
|
12
|
+
} from 'dash-utils';
|
|
13
|
+
|
|
14
|
+
export { useNotifications as default } from 'dash-utils';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
const useQuickSearch = () => {
|
|
4
|
+
const quickSearchUseState = useState<string>(null);
|
|
5
|
+
|
|
6
|
+
const sendQuickSearchEvent = (quickSearchString: string) => {
|
|
7
|
+
window.dispatchEvent(
|
|
8
|
+
new MessageEvent('quickSearch', { data: { value: quickSearchString } }),
|
|
9
|
+
);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const eventHook = (e: any) => {
|
|
13
|
+
quickSearchUseState[1](e.data.value);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
window.addEventListener('quickSearch', eventHook);
|
|
18
|
+
return () => {
|
|
19
|
+
window.removeEventListener('quickSearch', eventHook);
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
quickSearchUseState: quickSearchUseState,
|
|
25
|
+
sendQuickSearchEvent: sendQuickSearchEvent,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default useQuickSearch;
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export { default as PackageRadioButtonGroup } from './components/custom/PackageRadioButtonGroup';
|
|
2
|
+
export { default as PackageCopyMethod } from './components/custom/PackageCopyMethod';
|
|
3
|
+
export { default as NotResults } from './components/theme/NotResults';
|
|
4
|
+
export { default as NotFound } from './components/theme/NotFound';
|
|
5
|
+
export { default as QuickSearch } from './components/dialog/QuickSearch';
|
|
6
|
+
|
|
7
|
+
export { default as PaginationComponent } from './components/tables/PaginationComponent';
|
|
8
|
+
|
|
9
|
+
export { default as AutocompleteCheckBoxArrayInput } from './components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput';
|
|
10
|
+
export { default as AutoCompleteCheckBoxInput } from './components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput';
|
|
11
|
+
export { default as AutocompleteCheckBoxArrayInputAutoSearch } from './components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput';
|
|
12
|
+
export { default as AutoCompleteCheckBoxInputAutoSearch } from './components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput';
|
|
13
|
+
// TODO: AutocompleteCheckBoxArrayAutoSearch.tsx.wip
|
|
14
|
+
export { default as SortableDatagrid } from './components/SortableDataGrid/SortableDataGrid';
|
|
15
|
+
|
|
16
|
+
export { default as SearchableSelectCheckboxes } from './components/SearchableSelects/SearchableSelectCheckboxes';
|
|
17
|
+
export { default as SingleImageUploader } from './components/Upload/SingleImageUploader'
|
|
18
|
+
export { default as ListActive } from './components/ListActive/ListActive';
|
|
19
|
+
|
|
20
|
+
// Custom Components
|
|
21
|
+
|
|
22
|
+
export { default as JsonColorSelector } from './components/JsonColorSelector/JsonColorSelector'
|
|
23
|
+
export { default as JsonColorSelectorEnhanced } from './components/JsonColorSelector/JsonColorSelectorEnhanced'
|
|
24
|
+
//export { default as useAsyncColorThief } from ''
|
|
25
|
+
export { default as Json } from './components/Json/Json'
|
|
26
|
+
export { default as JsonCssVarValues } from './components/JsonColorSelector/JsonCssVarValues'
|
|
27
|
+
export { default as NotificationPreferences } from './components/NotificationPreferences/NotificationPreferences'
|
|
28
|
+
|
|
29
|
+
// Audit Log Component
|
|
30
|
+
export { AuditLog } from './components/AuditLog';
|
|
31
|
+
export type { AuditLogProps, ActivityLogRecord } from './components/AuditLog';
|
|
32
|
+
|
|
33
|
+
// Notifications Components
|
|
34
|
+
export {
|
|
35
|
+
NotificationsCenter,
|
|
36
|
+
NotificationButton,
|
|
37
|
+
NotificationsMenu,
|
|
38
|
+
NotificationMenuItem,
|
|
39
|
+
ToastNotificationsStack,
|
|
40
|
+
DraggableNotificationDialog,
|
|
41
|
+
useNotificationsCenter,
|
|
42
|
+
formatTimeAgo,
|
|
43
|
+
generateNotificationId,
|
|
44
|
+
} from './components/notifications';
|
|
45
|
+
|
|
46
|
+
export type {
|
|
47
|
+
NotificationData,
|
|
48
|
+
ToastNotification as NotificationToast,
|
|
49
|
+
DialogNotification as NotificationDialog,
|
|
50
|
+
NotificationsCenterConfig,
|
|
51
|
+
NotificationsCenterLabels,
|
|
52
|
+
NotificationsCenterIcons,
|
|
53
|
+
NotificationButtonProps,
|
|
54
|
+
NotificationsMenuProps,
|
|
55
|
+
NotificationMenuItemProps,
|
|
56
|
+
ToastNotificationsStackProps,
|
|
57
|
+
DraggableNotificationDialogProps,
|
|
58
|
+
NotificationsCenterProps,
|
|
59
|
+
UseNotificationsCenterReturn,
|
|
60
|
+
} from './components/notifications';
|
|
61
|
+
|
|
62
|
+
// Hooks - Re-exported from dash-utils for backward compatibility
|
|
63
|
+
// @deprecated Import directly from 'dash-utils' instead
|
|
64
|
+
export { useDraggable } from './hooks/useDraggable';
|
|
65
|
+
export type { DraggablePosition, UseDraggableOptions, UseDraggableReturn } from './hooks/useDraggable';
|
|
66
|
+
|
|
67
|
+
export { useNotifications } from './hooks/useNotifications';
|
|
68
|
+
export type {
|
|
69
|
+
ProcessedNotification,
|
|
70
|
+
ToastNotification,
|
|
71
|
+
DialogNotification,
|
|
72
|
+
UseNotificationsOptions,
|
|
73
|
+
UseNotificationsReturn
|
|
74
|
+
} from './hooks/useNotifications';
|
|
75
|
+
|
|
76
|
+
export { useQuickSearch } from 'dash-utils';
|
|
77
|
+
export type { UseQuickSearchReturn } from 'dash-utils';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const setNativeValue = (element, value) => {
|
|
2
|
+
|
|
3
|
+
if(!element) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
let lastValue = element.value;
|
|
8
|
+
|
|
9
|
+
element.value = value;
|
|
10
|
+
/* @ts-ignore */
|
|
11
|
+
let event = new Event("input", { target: element, bubbles: true });
|
|
12
|
+
|
|
13
|
+
let tracker = element._valueTracker;
|
|
14
|
+
|
|
15
|
+
if (tracker) {
|
|
16
|
+
tracker.setValue(lastValue);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
element.dispatchEvent(event);
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default setNativeValue;
|