@dashadmin/dash-components 1.3.72 → 1.3.74-srcfree.1

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 (60) hide show
  1. package/package.json +24 -21
  2. package/src/components/AuditLog/AuditLog.tsx +0 -490
  3. package/src/components/AuditLog/index.ts +0 -2
  4. package/src/components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput.tsx +0 -917
  5. package/src/components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput.tsx +0 -39
  6. package/src/components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput.tsx +0 -916
  7. package/src/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayAutoSearch.tsx.wip +0 -42
  8. package/src/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput.tsx +0 -44
  9. package/src/components/Json/Json.tsx +0 -312
  10. package/src/components/JsonColorSelector/JsonColorSelector.tsx +0 -1443
  11. package/src/components/JsonColorSelector/JsonColorSelector.tsx.bkup +0 -746
  12. package/src/components/JsonColorSelector/JsonColorSelectorEnhanced.tsx +0 -1135
  13. package/src/components/JsonColorSelector/JsonCssVarValues.tsx +0 -867
  14. package/src/components/JsonColorSelector/components/BasicColorSelector.tsx +0 -333
  15. package/src/components/JsonColorSelector/components/ColorEditDialog.tsx +0 -495
  16. package/src/components/JsonColorSelector/components/ColorPaletteItem.tsx +0 -80
  17. package/src/components/JsonColorSelector/components/ImageColorExtractor.tsx +0 -420
  18. package/src/components/JsonColorSelector/helpers/functions.tsx +0 -123
  19. package/src/components/JsonColorSelector/helpers/paletteDerivation.ts +0 -367
  20. package/src/components/JsonColorSelector/interfaces/interfaces.tsx +0 -22
  21. package/src/components/JsonColorSelector/useAsyncColorThief.tsx +0 -97
  22. package/src/components/ListActive/ListActive.tsx +0 -106
  23. package/src/components/ListActive/ListBoolean.tsx +0 -96
  24. package/src/components/NotificationPreferences/NotificationPreferences.tsx +0 -480
  25. package/src/components/NotificationPreferences/index.tsx +0 -2
  26. package/src/components/SearchableSelects/RASearchableSelect.tsx +0 -303
  27. package/src/components/SearchableSelects/RASearchableSelectCheckboxes.tsx +0 -617
  28. package/src/components/SearchableSelects/RASearchableSelectChips.tsx +0 -561
  29. package/src/components/SearchableSelects/RASearchableSelectChipsRecordContext.tsx +0 -366
  30. package/src/components/SearchableSelects/SearchableSelect.tsx +0 -323
  31. package/src/components/SearchableSelects/SearchableSelectCheckboxes.tsx +0 -358
  32. package/src/components/SortableDataGrid/README.md +0 -1
  33. package/src/components/SortableDataGrid/SortableDataGrid.tsx +0 -56
  34. package/src/components/SortableDataGrid/SortableDataGridBody.tsx +0 -175
  35. package/src/components/SortableDataGrid/SortableDataGridHeader.tsx +0 -171
  36. package/src/components/SortableDataGrid/SortableDataGridRow.tsx +0 -247
  37. package/src/components/Upload/SingleImageUploader.tsx +0 -55
  38. package/src/components/custom/PackageCopyMethod.tsx +0 -109
  39. package/src/components/custom/PackageRadioButtonGroup.tsx +0 -49
  40. package/src/components/dialog/Basic.tsx +0 -11
  41. package/src/components/dialog/Correct.tsx +0 -16
  42. package/src/components/dialog/Error.tsx +0 -15
  43. package/src/components/dialog/Info.tsx +0 -15
  44. package/src/components/dialog/InfoV2.tsx +0 -35
  45. package/src/components/dialog/NotFound.tsx +0 -18
  46. package/src/components/dialog/QuickSearch.tsx +0 -115
  47. package/src/components/notifications/NotificationsCenter.tsx +0 -743
  48. package/src/components/notifications/index.ts +0 -42
  49. package/src/components/tables/PaginationComponent.tsx +0 -17
  50. package/src/components/theme/AppLoadingFallback.tsx +0 -42
  51. package/src/components/theme/ErrorBoundary.tsx +0 -57
  52. package/src/components/theme/InitialLoader.tsx +0 -16
  53. package/src/components/theme/NotFound.tsx +0 -124
  54. package/src/components/theme/NotResults.tsx +0 -56
  55. package/src/hooks/useDraggable.ts +0 -11
  56. package/src/hooks/useNotifications.ts +0 -14
  57. package/src/hooks/useQuickSearch.tsx +0 -29
  58. package/src/index.tsx +0 -77
  59. package/src/styles/index.less +0 -0
  60. package/src/utils/setNativeValue.tsx +0 -23
@@ -1,42 +0,0 @@
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';
@@ -1,17 +0,0 @@
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;
@@ -1,42 +0,0 @@
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;
@@ -1,57 +0,0 @@
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;
@@ -1,16 +0,0 @@
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;
@@ -1,124 +0,0 @@
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/ErrorOutlined'
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;
@@ -1,56 +0,0 @@
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" sx={{
43
- color: "text.secondary"
44
- }}>
45
- {description}
46
- </Typography>
47
- )}
48
- {children}
49
- </CardContent>
50
- </Card>
51
- );
52
- });
53
-
54
- NoResults.displayName = 'NoResults';
55
-
56
- export default NoResults;
@@ -1,11 +0,0 @@
1
- /**
2
- * @deprecated Import from 'dash-utils' instead
3
- * Re-exported for backward compatibility
4
- */
5
- export {
6
- useDraggable,
7
- type DraggablePosition,
8
- type UseDraggableOptions,
9
- type UseDraggableReturn
10
- } from 'dash-utils';
11
-
@@ -1,14 +0,0 @@
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';
@@ -1,29 +0,0 @@
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 DELETED
@@ -1,77 +0,0 @@
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';
File without changes
@@ -1,23 +0,0 @@
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;