dgrcorrientes-modulos 1.0.3 → 1.0.4

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 (263) hide show
  1. package/README.md +12 -21
  2. package/package.json +1 -61
  3. package/.nvmrc +0 -1
  4. package/.prettierrc.cjs +0 -8
  5. package/.storybook/main.cjs +0 -11
  6. package/.storybook/manager-head.html +0 -2
  7. package/.storybook/manager.cjs +0 -6
  8. package/.storybook/preview-head.html +0 -3
  9. package/.storybook/preview.cjs +0 -11
  10. package/.storybook/themes.cjs +0 -14
  11. package/StoryBook.txt +0 -19
  12. package/dist/README.md +0 -12
  13. package/dist/package.json +0 -1
  14. package/dist-config.cjs +0 -57
  15. package/index.html +0 -13
  16. package/public/elevation.ico +0 -0
  17. package/public/elevationImage.png +0 -0
  18. package/public/vite.svg +0 -1
  19. package/src/App.scss +0 -36
  20. package/src/App.tsx +0 -34
  21. package/src/assets/react.svg +0 -1
  22. package/src/index.js +0 -70
  23. package/src/index.scss +0 -63
  24. package/src/index.ts +0 -108
  25. package/src/main.tsx +0 -11
  26. package/src/sass/base/_base.scss +0 -50
  27. package/src/sass/base/_controls.scss +0 -90
  28. package/src/sass/base/_datepicker.scss +0 -114
  29. package/src/sass/base/_typo.scss +0 -71
  30. package/src/sass/base/fonts/SFUIText-Bold.ttf +0 -0
  31. package/src/sass/base/fonts/SFUIText-BoldItalic.ttf +0 -0
  32. package/src/sass/base/fonts/SFUIText-Heavy.ttf +0 -0
  33. package/src/sass/base/fonts/SFUIText-HeavyItalic.ttf +0 -0
  34. package/src/sass/base/fonts/SFUIText-Light.ttf +0 -0
  35. package/src/sass/base/fonts/SFUIText-LightItalic.ttf +0 -0
  36. package/src/sass/base/fonts/SFUIText-Medium.ttf +0 -0
  37. package/src/sass/base/fonts/SFUIText-MediumItalic.ttf +0 -0
  38. package/src/sass/base/fonts/SFUIText-Regular.ttf +0 -0
  39. package/src/sass/base/fonts/SFUIText-RegularItalic.ttf +0 -0
  40. package/src/sass/base/fonts/SFUIText-Semibold.ttf +0 -0
  41. package/src/sass/base/fonts/SFUIText-SemiboldItalic.ttf +0 -0
  42. package/src/sass/bulma/bulma-changes.scss +0 -19
  43. package/src/sass/bulma/extensions/extensions.sass +0 -1
  44. package/src/sass/bulma/extensions/steps/bulma-steps.sass +0 -3
  45. package/src/sass/bulma/extensions/steps/index.sass +0 -421
  46. package/src/sass/bulma/variables/_variables-bulma.sass +0 -16
  47. package/src/sass/bulma/variables/components/card.sass +0 -20
  48. package/src/sass/bulma/variables/components/navbar.sass +0 -50
  49. package/src/sass/bulma/variables/components/tabs.sass +0 -28
  50. package/src/sass/bulma/variables/elements/button.sass +0 -46
  51. package/src/sass/bulma/variables/elements/notification.sass +0 -8
  52. package/src/sass/bulma/variables/elements/title.sass +0 -20
  53. package/src/sass/bulma/variables/grid/column.sass +0 -2
  54. package/src/sass/main.sass +0 -16
  55. package/src/sass/utilities/_bulma-variables.sass +0 -20
  56. package/src/sass/utilities/_derived-variables.scss +0 -68
  57. package/src/sass/utilities/_helpers.scss +0 -70
  58. package/src/sass/utilities/_variables.scss +0 -147
  59. package/src/stories/Changelog.stories.tsx +0 -73
  60. package/src/stories/Components/AssistanceDiary/AssistanceDiary.scss +0 -19
  61. package/src/stories/Components/AssistanceDiary/AssistanceDiary.stories.tsx +0 -25
  62. package/src/stories/Components/AssistanceDiary/AssistanceDiary.tsx +0 -57
  63. package/src/stories/Components/AverageAttended/AverageAttended.scss +0 -39
  64. package/src/stories/Components/AverageAttended/AverageAttended.stories.tsx +0 -71
  65. package/src/stories/Components/AverageAttended/AverageAttended.tsx +0 -311
  66. package/src/stories/Components/Breadcrumb/Breadcrumb.stories.tsx +0 -45
  67. package/src/stories/Components/Breadcrumb/Breadcrumb.tsx +0 -68
  68. package/src/stories/Components/Breadcrumb/breadcrumb.scss +0 -82
  69. package/src/stories/Components/CTA/CTA.scss +0 -76
  70. package/src/stories/Components/CTA/CTA.stories.tsx +0 -46
  71. package/src/stories/Components/CTA/CTA.tsx +0 -70
  72. package/src/stories/Components/Cards/Card CTA/CardCta.stories.tsx +0 -34
  73. package/src/stories/Components/Cards/Card CTA/CardCta.tsx +0 -81
  74. package/src/stories/Components/Cards/Card CTA/cardCta.scss +0 -71
  75. package/src/stories/Components/Cards/Card Expiration/cardExpiration.scss +0 -105
  76. package/src/stories/Components/Cards/Card Expiration/cardExpiration.stories.tsx +0 -40
  77. package/src/stories/Components/Cards/Card Expiration/cardExpiration.tsx +0 -95
  78. package/src/stories/Components/Cards/Card Vertical/CardVertical.stories.tsx +0 -43
  79. package/src/stories/Components/Cards/Card Vertical/CardVertical.tsx +0 -106
  80. package/src/stories/Components/Cards/Card Vertical/cardVertical.scss +0 -130
  81. package/src/stories/Components/Cards/CardActivity/cardActivity.scss +0 -31
  82. package/src/stories/Components/Cards/CardActivity/cardActivity.stories.tsx +0 -20
  83. package/src/stories/Components/Cards/CardActivity/cardActivity.tsx +0 -48
  84. package/src/stories/Components/Cards/CardHorizontal/CardHorizontal.stories.tsx +0 -96
  85. package/src/stories/Components/Cards/CardHorizontal/CardHorizontal.tsx +0 -94
  86. package/src/stories/Components/Cards/CardHorizontal/cardHorizontal.scss +0 -65
  87. package/src/stories/Components/Cards/CardUser/CardUser.stories.tsx +0 -135
  88. package/src/stories/Components/Cards/CardUser/CardUser.tsx +0 -122
  89. package/src/stories/Components/Cards/CardUser/cardUser.scss +0 -115
  90. package/src/stories/Components/Cart/Cart.scss +0 -279
  91. package/src/stories/Components/Cart/Cart.stories.tsx +0 -350
  92. package/src/stories/Components/Cart/Cart.tsx +0 -277
  93. package/src/stories/Components/Collapse/Collapse.scss +0 -339
  94. package/src/stories/Components/Collapse/Collapse.stories.tsx +0 -766
  95. package/src/stories/Components/Collapse/Collapse.tsx +0 -451
  96. package/src/stories/Components/CollapseEdit/CollapseEdit.scss +0 -128
  97. package/src/stories/Components/CollapseEdit/CollapseEdit.stories.tsx +0 -29
  98. package/src/stories/Components/CollapseEdit/CollapseEdit.tsx +0 -185
  99. package/src/stories/Components/CompleteDiary/CompleteDiary.scss +0 -165
  100. package/src/stories/Components/CompleteDiary/CompleteDiary.stories.tsx +0 -219
  101. package/src/stories/Components/CompleteDiary/CompleteDiary.tsx +0 -394
  102. package/src/stories/Components/Dropdown/Dropdown.scss +0 -60
  103. package/src/stories/Components/Dropdown/Dropdown.stories.tsx +0 -19
  104. package/src/stories/Components/Dropdown/Dropdown.tsx +0 -99
  105. package/src/stories/Components/EmptyState/EmptyState.stories.tsx +0 -46
  106. package/src/stories/Components/EmptyState/EmptyState.tsx +0 -44
  107. package/src/stories/Components/EmptyState/emptyState.scss +0 -75
  108. package/src/stories/Components/ErrorPage/ErrorPage.scss +0 -65
  109. package/src/stories/Components/ErrorPage/ErrorPage.stories.tsx +0 -164
  110. package/src/stories/Components/ErrorPage/ErrorPage.tsx +0 -107
  111. package/src/stories/Components/IncomingCall/IncomingCall.scss +0 -27
  112. package/src/stories/Components/IncomingCall/IncomingCall.stories.tsx +0 -43
  113. package/src/stories/Components/IncomingCall/IncomingCall.tsx +0 -76
  114. package/src/stories/Components/ModalConfirm/ModalConfirm.scss +0 -30
  115. package/src/stories/Components/ModalConfirm/ModalConfirm.stories.tsx +0 -21
  116. package/src/stories/Components/ModalConfirm/ModalConfirm.tsx +0 -118
  117. package/src/stories/Components/Pagination/Pagination.scss +0 -42
  118. package/src/stories/Components/Pagination/Pagination.stories.tsx +0 -25
  119. package/src/stories/Components/Pagination/Pagination.tsx +0 -143
  120. package/src/stories/Components/PerformanceAssessment/PerformanceAssessment.scss +0 -26
  121. package/src/stories/Components/PerformanceAssessment/PerformanceAssessment.stories.tsx +0 -27
  122. package/src/stories/Components/PerformanceAssessment/PerformanceAssessment.tsx +0 -108
  123. package/src/stories/Components/ShiftDiary/ShiftDiary.scss +0 -45
  124. package/src/stories/Components/ShiftDiary/ShiftDiary.stories.tsx +0 -32
  125. package/src/stories/Components/ShiftDiary/ShiftDiary.tsx +0 -92
  126. package/src/stories/Components/Stepper/Stepper.stories.tsx +0 -26
  127. package/src/stories/Components/Stepper/Stepper.tsx +0 -102
  128. package/src/stories/Components/Stepper/stepper.scss +0 -59
  129. package/src/stories/Components/Tabs/Tabs.stories.tsx +0 -76
  130. package/src/stories/Components/Tabs/Tabs.tsx +0 -111
  131. package/src/stories/Components/Tabs/tabs.scss +0 -118
  132. package/src/stories/Components/Tooltip/Tooltip.scss +0 -235
  133. package/src/stories/Components/Tooltip/Tooltip.stories.tsx +0 -125
  134. package/src/stories/Components/Tooltip/Tooltip.tsx +0 -222
  135. package/src/stories/Elements/Alert/Alert.stories.tsx +0 -65
  136. package/src/stories/Elements/Alert/Alert.tsx +0 -49
  137. package/src/stories/Elements/Alert/alert.scss +0 -189
  138. package/src/stories/Elements/Badge/Badge.stories.tsx +0 -15
  139. package/src/stories/Elements/Badge/Badge.tsx +0 -21
  140. package/src/stories/Elements/Badge/badge.scss +0 -24
  141. package/src/stories/Elements/Button/Button.stories.tsx +0 -54
  142. package/src/stories/Elements/Button/Button.tsx +0 -118
  143. package/src/stories/Elements/Button/button.scss +0 -102
  144. package/src/stories/Elements/Icon/Icon.stories.tsx +0 -33
  145. package/src/stories/Elements/Icon/Icon.tsx +0 -57
  146. package/src/stories/Elements/Icon/icon.scss +0 -15
  147. package/src/stories/Elements/Icon/icono.svg +0 -1
  148. package/src/stories/Elements/ProgressBar/ProgressBar.scss +0 -26
  149. package/src/stories/Elements/ProgressBar/ProgressBar.stories.tsx +0 -19
  150. package/src/stories/Elements/ProgressBar/ProgressBar.tsx +0 -35
  151. package/src/stories/Form/Autocomplete/Autocomplete.stories.tsx +0 -55
  152. package/src/stories/Form/Autocomplete/Autocomplete.tsx +0 -160
  153. package/src/stories/Form/Autocomplete/autocomplete.scss +0 -311
  154. package/src/stories/Form/Autocomplete-Prueba/Autocomplete.stories.tsx +0 -50
  155. package/src/stories/Form/Autocomplete-Prueba/AutocompletePrueba.tsx +0 -83
  156. package/src/stories/Form/Checkbox/Checkbox.stories.tsx +0 -26
  157. package/src/stories/Form/Checkbox/Checkbox.tsx +0 -89
  158. package/src/stories/Form/Checkbox/checkbox.scss +0 -41
  159. package/src/stories/Form/DatePicker/DatePickerExample.stories.tsx +0 -27
  160. package/src/stories/Form/DatePicker/DatePickerExample.tsx +0 -65
  161. package/src/stories/Form/DatePickerComponent/DatePickerComponent.scss +0 -116
  162. package/src/stories/Form/DatePickerComponent/DatePickerComponent.stories.tsx +0 -37
  163. package/src/stories/Form/DatePickerComponent/DatePickerComponent.tsx +0 -97
  164. package/src/stories/Form/Filters/Filters.stories.tsx +0 -84
  165. package/src/stories/Form/Filters/Filters.tsx +0 -230
  166. package/src/stories/Form/Filters/filters.scss +0 -261
  167. package/src/stories/Form/Input/Input.stories.tsx +0 -25
  168. package/src/stories/Form/Input/Input.tsx +0 -86
  169. package/src/stories/Form/Input/InputVar.sass +0 -26
  170. package/src/stories/Form/Input/input.scss +0 -19
  171. package/src/stories/Form/InputFormControl/Input-form-control.stories.tsx +0 -26
  172. package/src/stories/Form/InputFormControl/Input-form-control.tsx +0 -48
  173. package/src/stories/Form/InputFormControl/input-form-control.scss +0 -34
  174. package/src/stories/Form/Radio/Radio.stories.tsx +0 -19
  175. package/src/stories/Form/Radio/Radio.tsx +0 -84
  176. package/src/stories/Form/Radio/radio.scss +0 -19
  177. package/src/stories/Form/Search/Search.scss +0 -50
  178. package/src/stories/Form/Search/Search.stories.tsx +0 -26
  179. package/src/stories/Form/Search/Search.tsx +0 -84
  180. package/src/stories/Form/Select/Select.stories.tsx +0 -55
  181. package/src/stories/Form/Select/Select.tsx +0 -121
  182. package/src/stories/Form/Select/select.scss +0 -303
  183. package/src/stories/Form/Switch/Switch.stories.tsx +0 -17
  184. package/src/stories/Form/Switch/Switch.tsx +0 -36
  185. package/src/stories/Form/Switch/switch.scss +0 -123
  186. package/src/stories/Form/Textarea/Textarea.stories.tsx +0 -19
  187. package/src/stories/Form/Textarea/Textarea.tsx +0 -52
  188. package/src/stories/Form/Textarea/textarea.scss +0 -25
  189. package/src/stories/Form/UploadFileItem/UploadFileItem.scss +0 -49
  190. package/src/stories/Form/UploadFileItem/UploadFileItem.stories.tsx +0 -18
  191. package/src/stories/Form/UploadFileItem/UploadFileItem.tsx +0 -89
  192. package/src/stories/Form/UploadFiles/UploadFiles.scss +0 -17
  193. package/src/stories/Form/UploadFiles/UploadFiles.stories.tsx +0 -32
  194. package/src/stories/Form/UploadFiles/UploadFiles.tsx +0 -177
  195. package/src/stories/Layout/Footer/Footer.scss +0 -129
  196. package/src/stories/Layout/Footer/Footer.stories.tsx +0 -101
  197. package/src/stories/Layout/Footer/Footer.tsx +0 -81
  198. package/src/stories/Layout/Header/Header.scss +0 -190
  199. package/src/stories/Layout/Header/Header.stories.tsx +0 -223
  200. package/src/stories/Layout/Header/Header.tsx +0 -278
  201. package/src/stories/Layout/HeaderTable/HeaderTable.scss +0 -21
  202. package/src/stories/Layout/HeaderTable/HeaderTable.stories.tsx +0 -112
  203. package/src/stories/Layout/HeaderTable/HeaderTable.tsx +0 -72
  204. package/src/stories/Layout/Sidebar/Sidebar.scss +0 -50
  205. package/src/stories/Layout/Sidebar/Sidebar.stories.tsx +0 -744
  206. package/src/stories/Layout/Sidebar/Sidebar.tsx +0 -129
  207. package/src/stories/Layout/SidebarEmpty/SidebarEmpty.scss +0 -64
  208. package/src/stories/Layout/SidebarEmpty/SidebarEmpty.stories.tsx +0 -26
  209. package/src/stories/Layout/SidebarEmpty/SidebarEmpty.tsx +0 -100
  210. package/src/stories/Layout/Subtitle/Subtitle.scss +0 -88
  211. package/src/stories/Layout/Subtitle/Subtitle.stories.tsx +0 -46
  212. package/src/stories/Layout/Subtitle/Subtitle.tsx +0 -108
  213. package/src/stories/Layout/Title/Title.scss +0 -79
  214. package/src/stories/Layout/Title/Title.stories.tsx +0 -86
  215. package/src/stories/Layout/Title/Title.tsx +0 -96
  216. package/src/stories/Welcome.stories.tsx +0 -111
  217. package/src/stories/assets/404 Page Not Found _Two Color (1).png +0 -0
  218. package/src/stories/assets/404 Page Not Found _Two Color.png +0 -0
  219. package/src/stories/assets/Empty Inbox _Two Color.png +0 -0
  220. package/src/stories/assets/Loading _Two Color.png +0 -0
  221. package/src/stories/assets/Notifications_Two Color 1.png +0 -0
  222. package/src/stories/assets/Online protection_Two Color.png +0 -0
  223. package/src/stories/assets/Under Constructions _Two Color.png +0 -0
  224. package/src/stories/assets/bulma.png +0 -0
  225. package/src/stories/assets/burger.svg +0 -5
  226. package/src/stories/assets/code-brackets.svg +0 -1
  227. package/src/stories/assets/colors.svg +0 -1
  228. package/src/stories/assets/comments.svg +0 -1
  229. package/src/stories/assets/decor-bg.png +0 -0
  230. package/src/stories/assets/direction.svg +0 -1
  231. package/src/stories/assets/e-isologo.svg +0 -4
  232. package/src/stories/assets/e-isotype.svg +0 -4
  233. package/src/stories/assets/e-logo_negative.svg +0 -14
  234. package/src/stories/assets/e-logotype.svg +0 -14
  235. package/src/stories/assets/flow.svg +0 -1
  236. package/src/stories/assets/logo_gobierno_corrientes.svg +0 -9
  237. package/src/stories/assets/logo_rentas_corrientes.svg +0 -10
  238. package/src/stories/assets/logo_rentas_corrientes_compacto.svg +0 -10
  239. package/src/stories/assets/plugin.svg +0 -1
  240. package/src/stories/assets/repo.svg +0 -1
  241. package/src/stories/assets/stackalt.svg +0 -1
  242. package/src/stories/assets/storybook.svg +0 -13
  243. package/src/stories/assets/thumbnail-black.jpg +0 -0
  244. package/src/stories/assets/thumbnail-black[2].jpg +0 -0
  245. package/src/stories/assets/thumbnail.jpg +0 -0
  246. package/src/stories/assets/thumbnail[2].jpg +0 -0
  247. package/src/stories/changelog.ts +0 -389
  248. package/src/utils/functions.ts +0 -57
  249. package/src/vite-env.d.ts +0 -2
  250. package/static/e-isologo-192.jpg +0 -0
  251. package/static/e-isologo.svg +0 -4
  252. package/static/e-logotype.svg +0 -14
  253. package/static/favicon.ico +0 -0
  254. package/tsconfig.json +0 -22
  255. package/tsconfig.node.json +0 -9
  256. package/vite.config.ts +0 -22
  257. /package/{dist/components.js → components.js} +0 -0
  258. /package/{dist/components.umd.cjs → components.umd.cjs} +0 -0
  259. /package/{dist/elevation.ico → elevation.ico} +0 -0
  260. /package/{dist/elevationImage.png → elevationImage.png} +0 -0
  261. /package/{dist/index.d.ts → index.d.ts} +0 -0
  262. /package/{dist/style.css → style.css} +0 -0
  263. /package/{dist/vite.svg → vite.svg} +0 -0
@@ -1,394 +0,0 @@
1
- import {useEffect, useRef, useState} from 'react';
2
- import {Button} from '../../Elements/Button/Button';
3
- import {Icon} from '../../Elements/Icon/Icon';
4
- import './CompleteDiary.scss';
5
- import DatePicker from 'react-datepicker';
6
- import 'react-datepicker/dist/react-datepicker.css';
7
- import {Tooltip} from '../Tooltip/Tooltip';
8
-
9
- export interface ICompleteDiary {
10
- // BASE
11
- title?: string;
12
- labelName?: string;
13
- labelCuit?: string;
14
- labelStatus?: string;
15
- shifts: IShifts[];
16
- changeDate?: string;
17
- labelAll?: string;
18
- labelPresent?: string;
19
- labelMissing?: string;
20
- labelCatered?: string;
21
- iconText?: string;
22
- scheduleRest: IScheduleRest;
23
-
24
- // IS-OPTIONS
25
- showDiary?: boolean;
26
-
27
- // EVENTS
28
- onCancel?: () => void;
29
- onAttend?: () => void;
30
- onEllipse?: () => void;
31
- onDate?: (date: Date | null) => void;
32
-
33
- // GENERIC
34
- className?: string;
35
- }
36
- export interface IShifts {
37
- hour?: number;
38
- minute?: string;
39
- name?: string;
40
- cuit?: string;
41
- status?: 'Presente' | 'Ausente' | 'Atendido';
42
- colorBackgroundState?: string;
43
- iconColor?: string;
44
- showButton?: boolean;
45
- colorBackground?: string;
46
- menuDropComponent?: React.ReactNode;
47
- }
48
-
49
- interface IScheduleRest {
50
- start: Date;
51
- end: Date;
52
- }
53
-
54
- export const CompleteDiary = ({
55
- title,
56
- labelName,
57
- labelCuit,
58
- labelStatus,
59
- iconText,
60
- shifts,
61
- changeDate,
62
- labelAll,
63
- labelPresent,
64
- labelMissing,
65
- labelCatered,
66
- showDiary,
67
- scheduleRest,
68
- onCancel,
69
- onAttend,
70
- onEllipse,
71
- onDate,
72
- className,
73
- }: ICompleteDiary) => {
74
- const [turnos, setTurnos] = useState(shifts);
75
- const [filterState, setfilterState] = useState<string | null>(null);
76
- const [currentTime, setCurrentTime] = useState(new Date());
77
- const [selectedDate, setSelectedDate] = useState<Date | null>(null);
78
- const [quantitypresent, setquantitypresent] = useState<number>(0);
79
- const [quantitymissing, setquantitymissing] = useState<number>(0);
80
- const [quantitycatered, setquantitycatered] = useState<number>(0);
81
- const [totalQuantity, settotalQuantity] = useState<number>(0);
82
- const [menuExpanded, setMenuExpanded] = useState(false);
83
- const [expandedTooltip, setExpandedTooltip] = useState(false);
84
- const startTime = 8 * 60; // 8:00 AM en minutos
85
- const endTime = 18 * 60; // 6:00 PM en minutos
86
-
87
- const menuDropRef = useRef<HTMLDivElement>(null);
88
- const tooltipMenuRef = useRef<HTMLDivElement>(null);
89
-
90
- useEffect(() => {
91
- function handleClickOutside(event: MouseEvent) {
92
- // Verificar si el primer menú está desplegado y el clic no ocurrió dentro de él
93
- if (menuDropRef.current && menuExpanded) {
94
- if (!menuDropRef.current.contains(event.target as Node)) {
95
- setMenuExpanded(false);
96
- }
97
- }
98
-
99
- // Verificar si el segundo menú está desplegado y el clic no ocurrió dentro de él
100
- if (tooltipMenuRef.current && expandedTooltip) {
101
- if (!tooltipMenuRef.current.contains(event.target as Node)) {
102
- setExpandedTooltip(false);
103
- }
104
- }
105
- }
106
-
107
- document.addEventListener('click', handleClickOutside);
108
-
109
- return () => {
110
- document.removeEventListener('click', handleClickOutside);
111
- };
112
- }, [menuDropRef, menuExpanded, tooltipMenuRef, expandedTooltip]);
113
-
114
- const shiftsfilteredref = useRef<IShifts[]>([]);
115
-
116
- useEffect(() => {
117
- const intervalId = setInterval(() => {
118
- setCurrentTime(new Date());
119
- }, 1000);
120
-
121
- return () => clearInterval(intervalId);
122
- }, []);
123
-
124
- const formatTime = (date: Date) => {
125
- return date.toLocaleTimeString([], {hour: '2-digit', minute: '2-digit'});
126
- };
127
-
128
- const currentHour = currentTime.getHours();
129
- const currentMinutes = currentTime.getMinutes();
130
- const totalMinutes = currentHour * 60 + currentMinutes;
131
-
132
- const elapsedMinutes = totalMinutes - startTime;
133
-
134
- const adjustedMinutes = elapsedMinutes >= 0 ? (elapsedMinutes <= endTime - startTime ? elapsedMinutes : elapsedMinutes % (24 * 60)) : 0;
135
-
136
- const progress = (adjustedMinutes / (endTime - startTime)) * 100; // Usar el rango de 8 a 18 horas
137
-
138
- const formatDate = (date: Date | null): string => {
139
- if (!date) {
140
- // Si la fecha es null, muestra la fecha actual
141
- const currentDate = new Date();
142
- const options: Intl.DateTimeFormatOptions = {
143
- day: 'numeric',
144
- month: 'short',
145
- year: 'numeric',
146
- };
147
-
148
- return currentDate.toLocaleDateString('es-ES', options).replace('.', '');
149
- }
150
- const options: Intl.DateTimeFormatOptions = {
151
- day: 'numeric',
152
- month: 'short',
153
- year: 'numeric',
154
- };
155
- return date.toLocaleDateString('es-ES', options).replace('.', '');
156
- };
157
-
158
- useEffect(() => {
159
- // Filtrar los turnos cuando cambia el estado
160
- const filterShifts = (turnos: IShifts[], estado: string | null) => {
161
- switch (estado) {
162
- case 'Presente':
163
- return turnos.filter(turno => turno.status === 'Presente');
164
- case 'Ausente':
165
- return turnos.filter(turno => turno.status === 'Ausente');
166
- case 'Atendido':
167
- return turnos.filter(turno => turno.status === 'Atendido');
168
- default:
169
- return turnos;
170
- }
171
- };
172
-
173
- const shiftsFiltered = filterShifts(turnos, filterState);
174
- shiftsfilteredref.current = shiftsFiltered;
175
-
176
- // Calcular la cantidad por estado y total
177
- let present = 0;
178
- let missing = 0;
179
- let catered = 0;
180
-
181
- turnos?.forEach(turno => {
182
- switch (turno.status) {
183
- case 'Presente':
184
- present += 1;
185
- break;
186
- case 'Ausente':
187
- missing += 1;
188
- break;
189
- case 'Atendido':
190
- catered += 1;
191
- break;
192
- default:
193
- break;
194
- }
195
- });
196
-
197
- setquantitypresent(present);
198
- setquantitymissing(missing);
199
- setquantitycatered(catered);
200
- settotalQuantity(turnos.length);
201
- }, [turnos, filterState]);
202
-
203
- const addshiftInCurrentSchedule = (hour: number, minute: string) => {
204
- const shiftInCurrentSchedule = shiftsfilteredref.current.find(item => item.hour === hour && item.minute === minute);
205
-
206
- if (shiftInCurrentSchedule) {
207
- return (
208
- <div
209
- key={`${hour}:${minute}`}
210
- className="completediary__item is-flex is-align-items-center is-gap-5"
211
- style={{backgroundColor: shiftInCurrentSchedule.colorBackground}}
212
- >
213
- <div className="container is-flex is-fullw">
214
- <div className="info has-text-weight-semibold is-fullw">{shiftInCurrentSchedule.name}</div>
215
- <div className="info is-fullw">{shiftInCurrentSchedule.cuit}</div>
216
- <div
217
- className="info completediary__status is-flex is-align-items-center"
218
- style={{backgroundColor: shiftInCurrentSchedule.colorBackgroundState}}
219
- >
220
- <Icon icon="fa-solid fa-circle" color={shiftInCurrentSchedule.iconColor} className="mr-2 is-size-7" />
221
- <p className="has-text-light is-size-7">{shiftInCurrentSchedule.status}</p>
222
- </div>
223
- </div>
224
-
225
- <div className="completediary__buttons is-flex is-align-items-center is-gap-4">
226
- <div>
227
- <Button
228
- label="Cancelar"
229
- fill="outline"
230
- icon="fa-solid fa-xmark"
231
- color="secondary"
232
- trailingIcon={true}
233
- className={`is-size-7 ${shiftInCurrentSchedule.showButton ? '' : 'is-invisible'}`}
234
- onClick={() => onCancel && onCancel()}
235
- />
236
- </div>
237
- <div>
238
- <Button
239
- label="Atender"
240
- fill="solid"
241
- icon="fa-solid fa-arrow-right-to-bracket"
242
- trailingIcon={true}
243
- className={`is-size-7 ${shiftInCurrentSchedule.showButton ? '' : 'is-invisible'}`}
244
- onClick={() => onAttend && onAttend()}
245
- />
246
- </div>
247
- <div
248
- ref={menuDropRef}
249
- className="is-relative"
250
- onClick={() => {
251
- setMenuExpanded(!menuExpanded);
252
- onEllipse && onEllipse();
253
- }}
254
- >
255
- <Icon
256
- icon="fa-solid fa-ellipsis-vertical"
257
- className={`icon_ellipsis ${shiftInCurrentSchedule.showButton ? '' : 'is-invisible'}`}
258
- />
259
- {shiftInCurrentSchedule.menuDropComponent && menuExpanded && (
260
- <div className="completediary__dropComponent is-absolute">{shiftInCurrentSchedule.menuDropComponent}</div>
261
- )}
262
- </div>
263
- </div>
264
- </div>
265
- );
266
- }
267
- return <div style={{backgroundColor: '#CED4DA4D', height: '69px', borderRadius: '4px', border: '1px solid #E5E5E5'}}></div>;
268
- };
269
-
270
- return (
271
- <div className="elv-component elv-completediary">
272
- <div className={['completediary__head is-flex is-flex-direction-column is-gap-5', `${className ? ' ' + className : ''}`].join('')}>
273
- {showDiary && <div className="has-text-grey-dark has-text-weight-bold is-size-3">{title}</div>}
274
-
275
- <div className="completediary__head--breakpoint is-flex is-align-items-center is-justify-content-space-between ">
276
- <div className="is-flex is-align-items-center is-gap-4">
277
- <p className="is-size-7 has-text-weight-medium">{changeDate}</p>
278
- <div>
279
- <DatePicker
280
- selected={selectedDate}
281
- onChange={(date: Date | null) => {
282
- setSelectedDate(date), onDate && onDate(date);
283
- }}
284
- customInput={
285
- <div className="is-flex datePickerStyles">
286
- <span className="has-text-grey-dark">{formatDate(selectedDate)}</span>
287
- <Icon icon="fa-solid fa-chevron-up" className={`ml-3 rotateIcon `} />
288
- </div>
289
- }
290
- />
291
- </div>
292
- </div>
293
- <div className="completediary__head__filters is-flex is-align-items-center is-size-7 is-gap-4">
294
- <div className={`completediary__head__filter ${filterState === null ? 'filter' : ''}`} onClick={() => setfilterState(null)}>
295
- {`${labelAll} (${totalQuantity})`}
296
- </div>
297
- <div
298
- className={`completediary__head__filter ${filterState === 'Presente' ? 'filter' : ''}`}
299
- onClick={() => setfilterState('Presente')}
300
- >
301
- {`${labelPresent} (${quantitypresent})`}
302
- </div>
303
- <div
304
- className={`completediary__head__filter ${filterState === 'Ausente' ? 'filter' : ''}`}
305
- onClick={() => setfilterState('Ausente')}
306
- >
307
- {`${labelMissing} (${quantitymissing})`}
308
- </div>
309
- <div
310
- className={`completediary__head__filter ${filterState === 'Atendido' ? 'filter' : ''}`}
311
- onClick={() => setfilterState('Atendido')}
312
- >
313
- {`${labelCatered} (${quantitycatered})`}
314
- </div>
315
- </div>
316
- </div>
317
- <div className="completediary is-flex px-5 pt-5 is-flex-direction-column box">
318
- <div className="container is-flex is-size-7 has-text-grey-dark m-0 is-align-items-center is-justify-content-space-around">
319
- <div className="completediary__label">{labelName}</div>
320
- <div className="completediary__label">{labelCuit}</div>
321
- <div className="completediary__label is-flex is-align-items-center">
322
- <p className="completediary__statu">{labelStatus}</p>
323
- <div
324
- ref={tooltipMenuRef}
325
- className="completediary__icontooltip is-relative"
326
- onClick={() => {
327
- setExpandedTooltip(!expandedTooltip);
328
- }}
329
- >
330
- <Icon icon="fa-solid fa-circle-info" className="iconState ml-2 completediary__label" />
331
- {expandedTooltip && (
332
- <Tooltip active contentType="text" text={iconText} trianglePos="none" className="completediary__tooltip is-absolute" />
333
- )}
334
- </div>
335
- </div>
336
- </div>
337
-
338
- <div className="completediary__time time-bar is-flex is-flex-direction-column is-align-items-center is-fullw is-relative">
339
- <div className="time-range is-flex is-flex-direction-column-reverse is-size-7 has-text-weight-semibold is-gap-4 is-fullw">
340
- {Array.from({length: 22}, (_, index) => {
341
- const hour = Math.floor(index / 2) + 8;
342
- const minute = index % 2 === 0 ? '00' : '30';
343
- const showTime =
344
- hour < 18 || (hour === 18 && minute === '00') || (hour === 8 && minute === '00' && elapsedMinutes >= 24 * 60);
345
-
346
- // Crear un objeto Date para el tiempo actual
347
- const currentTime = new Date();
348
- currentTime.setHours(hour, parseInt(minute));
349
-
350
- // Verificar si el tiempo actual está dentro del horario de descanso
351
- const restSchedule = currentTime >= scheduleRest.start && currentTime < scheduleRest.end;
352
-
353
- // Mostrar el espacio de descanso en lugar de los turnos si es un horario de descanso
354
- if (restSchedule) {
355
- return (
356
- showTime &&
357
- hour < 18 && (
358
- <div key={index} className="time-label is-flex is-gap-4">
359
- <span className="time" style={{color: '#16A34A'}}>{`${hour}:${minute} h`}</span>
360
- <div className="is-fullw">
361
- <div style={{backgroundColor: '#ECFDF5', height: '66px', borderRadius: '4px', border: '1px solid #E5E5E5'}}></div>
362
- </div>
363
- </div>
364
- )
365
- );
366
- }
367
-
368
- const turnosEnHorario = shiftsfilteredref.current.filter(turno => turno.hour === hour && turno.minute === minute);
369
-
370
- return (
371
- // Mostrar solo las horas hasta las 18:00
372
- showTime &&
373
- hour < 18 && (
374
- <div key={index} className="time-label is-flex is-gap-4 ">
375
- <span className="time">{`${hour}:${minute} h`}</span>
376
- <div className={`is-fullw`}> {addshiftInCurrentSchedule(hour, minute)}</div>
377
- </div>
378
- )
379
- );
380
- }).reverse()}
381
- </div>
382
- <div
383
- className="current-time is-flex is-absolute is-align-items-center is-justify-content-center"
384
- style={{top: `${Math.max(0, Math.min(progress, 100))}%`}}
385
- >
386
- {/* <span>{formatTime(currentTime)}</span> */}
387
- <Icon icon="fa-solid fa-circle" className="icon-time is-absolute" />
388
- </div>
389
- </div>
390
- </div>
391
- </div>
392
- </div>
393
- );
394
- };
@@ -1,60 +0,0 @@
1
- @import '/src/sass/utilities/variables';
2
-
3
- .elv-dropdown {
4
- .e-dropdown {
5
- min-width: 250px;
6
- max-width: max-content;
7
- box-shadow: 0px 14px 24px rgba(20, 23, 38, 0.12);
8
- border-radius: 16px;
9
- z-index: 100;
10
-
11
- display: none;
12
-
13
- position: absolute;
14
- top: 100%;
15
-
16
- &--left {
17
- left: 0;
18
- }
19
-
20
- &--center {
21
- left: 50%;
22
- transform: translateX(-50%);
23
- }
24
-
25
- &--right {
26
- right: 0;
27
- }
28
-
29
- &--active {
30
- display: block;
31
- }
32
-
33
- .dropdown__list {
34
- list-style: none;
35
- font-weight: $fw-semibold;
36
- color: $text-900;
37
-
38
- .list__item {
39
- border-radius: 15px;
40
- gap: 10px;
41
-
42
- &--active {
43
- background-color: $muted-300;
44
-
45
- .item__icon {
46
- color: $primary-600;
47
- }
48
- }
49
-
50
- &--default {
51
- color: $text-500;
52
- }
53
-
54
- &:hover {
55
- background-color: $muted-300;
56
- }
57
- }
58
- }
59
- }
60
- }
@@ -1,19 +0,0 @@
1
- import {ComponentStory, ComponentMeta} from '@storybook/react';
2
- import {Dropdown} from './Dropdown';
3
-
4
- export default {
5
- title: 'Elements/Dropdown',
6
- component: Dropdown,
7
- args: {
8
- position: 'left',
9
- options: [{label: 'Opcion 1', icon: {icon: 'fas fa-user'}}, {label: 'Opcion 2'}, {label: 'Opcion 3'}],
10
- },
11
- } as ComponentMeta<typeof Dropdown>;
12
-
13
- const Template: ComponentStory<typeof Dropdown> = args => <Dropdown {...args} />;
14
-
15
- export const Standard = Template.bind({});
16
- Standard.args = {trigger: {label: 'Trigger'}};
17
-
18
- export const NoTrigger = Template.bind({});
19
- NoTrigger.args = {visible: false};
@@ -1,99 +0,0 @@
1
- import {useEffect, useRef, useState} from 'react';
2
- import {Button, IButton} from '../../Elements/Button/Button';
3
- import {Icon, IIcon} from '../../Elements/Icon/Icon';
4
- import './Dropdown.scss';
5
- import {generateRandomKey} from '../../../utils/functions';
6
-
7
- export interface IDropdown extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
8
- // base
9
- trigger?: IButton;
10
- options?: {label: string; icon?: IIcon; onClick?: () => void}[];
11
- position?: 'left' | 'center' | 'right';
12
-
13
- // boolean
14
- visible?: boolean;
15
-
16
- // events
17
- onClick?: () => void;
18
-
19
- // react
20
- className?: string;
21
- }
22
-
23
- export const Dropdown = ({trigger, options, position, visible, className, onClick, ...props}: IDropdown) => {
24
- const [activeState, setActiveState] = useState(visible ? visible : false);
25
-
26
- // =============================== REF USER ===============================
27
- const dropRef = useRef<HTMLDivElement>(null);
28
- useEffect(() => {
29
- function handleClickOutside(event: MouseEvent) {
30
- if (dropRef.current && !dropRef.current.contains(event.target as Node)) {
31
- setActiveState(false);
32
- }
33
- }
34
-
35
- document.addEventListener('click', handleClickOutside);
36
-
37
- return () => {
38
- document.removeEventListener('click', handleClickOutside);
39
- };
40
- }, [dropRef]);
41
-
42
- return (
43
- <div className="elv-component elv-dropdown" {...props}>
44
- {trigger ? (
45
- <div className="is-relative is-inline-block" ref={dropRef}>
46
- <Button
47
- {...trigger}
48
- onClick={() => {
49
- setActiveState(!activeState);
50
- }}
51
- />
52
- <div
53
- className={[
54
- `e-dropdown has-background-white`,
55
- `${activeState ? ' e-dropdown--active' : ''}`,
56
- `${position ? ' e-dropdown--' + position : ''}`,
57
- `${className ? ' ' + className : ''}`,
58
- ].join('')}
59
- >
60
- <ul className={['dropdown__list', ' has-text-weight-semibold', ' p-1'].join('')}>
61
- {options?.map((item, index) => (
62
- <li
63
- key={index + generateRandomKey()}
64
- className={[`list__item`, ` is-clickable`, ' is-flex is-align-items-center', ' py-4 px-2'].join('')}
65
- onClick={() => item.onClick && item.onClick()}
66
- >
67
- {item.icon && <Icon {...item.icon} />}
68
- {item.label}
69
- </li>
70
- ))}
71
- </ul>
72
- </div>
73
- </div>
74
- ) : (
75
- <div
76
- className={[
77
- `e-dropdown has-background-white`,
78
- `${visible ? ' e-dropdown--active' : ''}`,
79
- `${position ? ' e-dropdown--' + position : ''}`,
80
- `${className ? ' ' + className : ''}`,
81
- ].join('')}
82
- >
83
- <ul className="dropdown__list p-1">
84
- {options?.map((item, index) => (
85
- <li
86
- key={index}
87
- className={[`list__item`, ` is-clickable`, ' is-flex is-align-items-center', ' py-4 px-2'].join('')}
88
- onClick={() => item.onClick && item.onClick()}
89
- >
90
- {item.icon && <Icon {...item.icon} />}
91
- {item.label}
92
- </li>
93
- ))}
94
- </ul>
95
- </div>
96
- )}
97
- </div>
98
- );
99
- };
@@ -1,46 +0,0 @@
1
- import React from 'react';
2
- import {ComponentStory, ComponentMeta} from '@storybook/react';
3
- import {EmptyState} from './EmptyState';
4
-
5
- export default {
6
- title: 'Components/EmptyState',
7
- component: EmptyState,
8
- args: {
9
- orientation: 'horizontal',
10
- img: 'https://image.shutterstock.com/image-vector/electric-power-plug-holding-hand-260nw-530773483.jpg',
11
- error: 'Error 404',
12
- title: 'No podemos realizar la acción que intentas hacer',
13
- description:
14
- 'Amet minim mollit non deserunt ullamco est sit aliqua dolor do amet sint. Velit officia consequat duis enim velit mollit. Exercitation veniam consequat sunt nostrud amet.',
15
- buttonsActive: false,
16
-
17
- button: [
18
- {
19
- label: 'Button',
20
- size: 'normal',
21
- color: 'primary',
22
- fill: 'solid',
23
- loading: false,
24
- disabled: false,
25
- leadingIcon: false,
26
- type: 'button',
27
- onClick: () => console.log('Button Clicked'),
28
- },
29
- {
30
- label: 'Button',
31
- size: 'normal',
32
- color: 'primary',
33
- fill: 'link',
34
- loading: false,
35
- disabled: false,
36
- type: 'button',
37
- onClick: () => console.log('Button Clicked'),
38
- },
39
- ],
40
- },
41
- } as ComponentMeta<typeof EmptyState>;
42
-
43
- const Template: ComponentStory<typeof EmptyState> = args => <EmptyState {...args} />;
44
-
45
- export const Standard = Template.bind({});
46
- Standard.args = {};
@@ -1,44 +0,0 @@
1
- import {shortenText} from '../../../utils/functions';
2
- import './emptyState.scss';
3
- import {Button, IButton} from '../../Elements/Button/Button';
4
-
5
- export interface IEmptyState extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
6
- // base
7
- orientation: 'horizontal' | 'vertical';
8
- img: string;
9
- error: string;
10
- title: string;
11
- description: string;
12
- button: IButton[];
13
-
14
- // boolean
15
- buttonsActive: boolean;
16
-
17
- // react
18
- className?: string;
19
- }
20
-
21
- export const EmptyState = ({orientation, img, error, title, description, className, buttonsActive, button, ...props}: IEmptyState) => {
22
- return (
23
- <div className={`elv-component elv-e-state ${className ? className : ''}`} {...props}>
24
- <div className={`e-state ${orientation === 'vertical' ? 'e-state--vertical' : ''}`}>
25
- <div className="e-state__img-container">
26
- <img src={img} alt="" />
27
- </div>
28
- <div className="e-state__body">
29
- <div className="text-container">
30
- <p className="error">{error}</p>
31
- <p className="title is-4">{title}</p>
32
- <p className="description is-5">{description}</p>
33
- </div>
34
- {buttonsActive && (
35
- <div className="buttons-container">
36
- {button[0] && <Button isFullWidth={true} {...button[0]} />}
37
- {button[1] && <Button isFullWidth={true} {...button[1]} />}
38
- </div>
39
- )}
40
- </div>
41
- </div>
42
- </div>
43
- );
44
- };