@dashadmin/dash-components 1.3.73 → 1.3.74-srcfree.2

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 (111) hide show
  1. package/dist/components/AuditLog/AuditLog.d.ts +27 -0
  2. package/dist/components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput.d.ts +22 -0
  3. package/dist/components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput.d.ts +7 -0
  4. package/dist/components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput.d.ts +22 -0
  5. package/dist/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput.d.ts +7 -0
  6. package/dist/components/Json/Json.d.ts +5 -0
  7. package/dist/components/JsonColorSelector/JsonColorSelector.d.ts +5 -0
  8. package/dist/components/JsonColorSelector/JsonColorSelectorEnhanced.d.ts +4 -0
  9. package/dist/components/JsonColorSelector/JsonCssVarValues.d.ts +5 -0
  10. package/dist/components/JsonColorSelector/components/BasicColorSelector.d.ts +9 -0
  11. package/dist/components/JsonColorSelector/components/ColorEditDialog.d.ts +12 -0
  12. package/dist/components/JsonColorSelector/components/ColorPaletteItem.d.ts +7 -0
  13. package/dist/components/JsonColorSelector/components/ImageColorExtractor.d.ts +9 -0
  14. package/dist/components/JsonColorSelector/helpers/functions.d.ts +11 -0
  15. package/dist/components/JsonColorSelector/helpers/paletteDerivation.d.ts +37 -0
  16. package/{src/components/JsonColorSelector/interfaces/interfaces.tsx → dist/components/JsonColorSelector/interfaces/interfaces.d.ts} +6 -8
  17. package/dist/components/JsonColorSelector/useAsyncColorThief.d.ts +11 -0
  18. package/dist/components/ListActive/ListActive.d.ts +10 -0
  19. package/dist/components/ListActive/ListBoolean.d.ts +10 -0
  20. package/dist/components/NotificationPreferences/NotificationPreferences.d.ts +6 -0
  21. package/dist/components/SearchableSelects/RASearchableSelect.d.ts +25 -0
  22. package/dist/components/SearchableSelects/RASearchableSelectCheckboxes.d.ts +35 -0
  23. package/dist/components/SearchableSelects/RASearchableSelectChips.d.ts +33 -0
  24. package/dist/components/SearchableSelects/RASearchableSelectChipsRecordContext.d.ts +30 -0
  25. package/dist/components/SearchableSelects/SearchableSelect.d.ts +25 -0
  26. package/dist/components/SearchableSelects/SearchableSelectCheckboxes.d.ts +29 -0
  27. package/dist/components/SortableDataGrid/SortableDataGrid.d.ts +7 -0
  28. package/dist/components/SortableDataGrid/SortableDataGridBody.d.ts +7 -0
  29. package/dist/components/SortableDataGrid/SortableDataGridHeader.d.ts +6 -0
  30. package/dist/components/SortableDataGrid/SortableDataGridRow.d.ts +5 -0
  31. package/dist/components/Upload/SingleImageUploader.d.ts +8 -0
  32. package/dist/components/custom/PackageCopyMethod.d.ts +15 -0
  33. package/dist/components/custom/PackageRadioButtonGroup.d.ts +8 -0
  34. package/dist/components/dialog/Basic.d.ts +2 -0
  35. package/dist/components/dialog/Correct.d.ts +2 -0
  36. package/dist/components/dialog/Error.d.ts +2 -0
  37. package/dist/components/dialog/Info.d.ts +2 -0
  38. package/dist/components/dialog/InfoV2.d.ts +2 -0
  39. package/dist/components/dialog/NotFound.d.ts +2 -0
  40. package/dist/components/dialog/QuickSearch.d.ts +6 -0
  41. package/dist/components/notifications/NotificationsCenter.d.ts +109 -0
  42. package/dist/components/notifications/index.d.ts +2 -0
  43. package/dist/components/tables/PaginationComponent.d.ts +4 -0
  44. package/dist/components/theme/AppLoadingFallback.d.ts +6 -0
  45. package/dist/components/theme/ErrorBoundary.d.ts +19 -0
  46. package/dist/components/theme/InitialLoader.d.ts +3 -0
  47. package/dist/components/theme/NotFound.d.ts +13 -0
  48. package/dist/components/theme/NotResults.d.ts +7 -0
  49. package/dist/hooks/useDraggable.d.ts +1 -0
  50. package/dist/hooks/useNotifications.d.ts +2 -0
  51. package/dist/hooks/useQuickSearch.d.ts +6 -0
  52. package/{src/index.tsx → dist/index.d.ts} +10 -58
  53. package/dist/utils/setNativeValue.d.ts +2 -0
  54. package/package.json +24 -21
  55. package/src/components/AuditLog/AuditLog.tsx +0 -490
  56. package/src/components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput.tsx +0 -917
  57. package/src/components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput.tsx +0 -39
  58. package/src/components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput.tsx +0 -916
  59. package/src/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayAutoSearch.tsx.wip +0 -42
  60. package/src/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput.tsx +0 -44
  61. package/src/components/Json/Json.tsx +0 -312
  62. package/src/components/JsonColorSelector/JsonColorSelector.tsx +0 -1443
  63. package/src/components/JsonColorSelector/JsonColorSelector.tsx.bkup +0 -746
  64. package/src/components/JsonColorSelector/JsonColorSelectorEnhanced.tsx +0 -1135
  65. package/src/components/JsonColorSelector/JsonCssVarValues.tsx +0 -867
  66. package/src/components/JsonColorSelector/components/BasicColorSelector.tsx +0 -333
  67. package/src/components/JsonColorSelector/components/ColorEditDialog.tsx +0 -495
  68. package/src/components/JsonColorSelector/components/ColorPaletteItem.tsx +0 -80
  69. package/src/components/JsonColorSelector/components/ImageColorExtractor.tsx +0 -420
  70. package/src/components/JsonColorSelector/helpers/functions.tsx +0 -123
  71. package/src/components/JsonColorSelector/helpers/paletteDerivation.ts +0 -367
  72. package/src/components/JsonColorSelector/useAsyncColorThief.tsx +0 -97
  73. package/src/components/ListActive/ListActive.tsx +0 -106
  74. package/src/components/ListActive/ListBoolean.tsx +0 -96
  75. package/src/components/NotificationPreferences/NotificationPreferences.tsx +0 -480
  76. package/src/components/SearchableSelects/RASearchableSelect.tsx +0 -303
  77. package/src/components/SearchableSelects/RASearchableSelectCheckboxes.tsx +0 -617
  78. package/src/components/SearchableSelects/RASearchableSelectChips.tsx +0 -561
  79. package/src/components/SearchableSelects/RASearchableSelectChipsRecordContext.tsx +0 -366
  80. package/src/components/SearchableSelects/SearchableSelect.tsx +0 -323
  81. package/src/components/SearchableSelects/SearchableSelectCheckboxes.tsx +0 -358
  82. package/src/components/SortableDataGrid/README.md +0 -1
  83. package/src/components/SortableDataGrid/SortableDataGrid.tsx +0 -56
  84. package/src/components/SortableDataGrid/SortableDataGridBody.tsx +0 -175
  85. package/src/components/SortableDataGrid/SortableDataGridHeader.tsx +0 -171
  86. package/src/components/SortableDataGrid/SortableDataGridRow.tsx +0 -247
  87. package/src/components/Upload/SingleImageUploader.tsx +0 -55
  88. package/src/components/custom/PackageCopyMethod.tsx +0 -109
  89. package/src/components/custom/PackageRadioButtonGroup.tsx +0 -49
  90. package/src/components/dialog/Basic.tsx +0 -11
  91. package/src/components/dialog/Correct.tsx +0 -16
  92. package/src/components/dialog/Error.tsx +0 -15
  93. package/src/components/dialog/Info.tsx +0 -15
  94. package/src/components/dialog/InfoV2.tsx +0 -35
  95. package/src/components/dialog/NotFound.tsx +0 -18
  96. package/src/components/dialog/QuickSearch.tsx +0 -115
  97. package/src/components/notifications/NotificationsCenter.tsx +0 -743
  98. package/src/components/notifications/index.ts +0 -42
  99. package/src/components/tables/PaginationComponent.tsx +0 -17
  100. package/src/components/theme/AppLoadingFallback.tsx +0 -42
  101. package/src/components/theme/ErrorBoundary.tsx +0 -57
  102. package/src/components/theme/InitialLoader.tsx +0 -16
  103. package/src/components/theme/NotFound.tsx +0 -124
  104. package/src/components/theme/NotResults.tsx +0 -56
  105. package/src/hooks/useDraggable.ts +0 -11
  106. package/src/hooks/useNotifications.ts +0 -14
  107. package/src/hooks/useQuickSearch.tsx +0 -29
  108. package/src/styles/index.less +0 -0
  109. package/src/utils/setNativeValue.tsx +0 -23
  110. /package/{src/components/AuditLog/index.ts → dist/components/AuditLog/index.d.ts} +0 -0
  111. /package/{src/components/NotificationPreferences/index.tsx → dist/components/NotificationPreferences/index.d.ts} +0 -0
@@ -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;
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;